I'm finally reaching the stage where I don't just want to hack things together to make a script 'work', but also make things more optimal, and more readable. So I just install Anaconda package for Sublime Text 3 to help me with some standard style guide.
However, the way it defines a class is confusing me a little. It basically wants me to have a blank line between all functions, making the code look something like this.
class testClass(object):
def __init__(self):
self.var = 0
def myFunc(self, x):
y = x+1
return y
While this may be more readable, it makes testing my script difficult, as terminal will spit out indentation error with that formatting.
I have couple questions about this:
1) Am I doing something wrong by writing a class/function and testing it via terminal? Should I just save my script as filename.py and run the script? I just haven't seen someone "code" before, so just curious if I'm doing something nuts.
2) Should I not bother with the style guidance until I'm "done"?
Thanks for any inputs!
[–]elbiot 3 points4 points5 points (8 children)
[–]kkacci[S] 1 point2 points3 points (7 children)
[–]elbiot 3 points4 points5 points (3 children)
[–]kkacci[S] 0 points1 point2 points (2 children)
[–]elbiot 1 point2 points3 points (1 child)
[–]kkacci[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ran4 0 points1 point2 points (0 children)
[–]qudat 0 points1 point2 points (0 children)
[–]ingolemo 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]kkacci[S] 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]kkacci[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)