These should be automatically regenerated on the fly but I’ve noticed that if you restructure your code (i.e. move things around) they can get out of whack. Best to clean them up from time to time…
Handy function reference…
Well worth a read…
Having worked in a variety of other languages, my first instinct was to create classes with static methods for things like utility libraries. But after digging around Google for a bit, it seems like this isn’t necessarily the way things are done in Python:
I’m not sure where I stand on this just yet. The logical argument is that classes should only be used for when you need to instantiate something. But sometimes it’s handy to make use of class variables. And really the only difference is a small change in syntax:
Writing clean code means following standards, whether your own, your organizations or those of someone else.
Python likes to do things their way, so following this is a must:
As mentioned in the previous post, I’m a big fan of the IDE offerings from JetBrains (and who doesn’t love Prague). Tons of functionality, lightweight (when compared to my old friend Eclipse), lots of plugins and inexpensive.
One trick for any MacPorts users out there (yes, MacPorts, don’t judge), if you launch the application normally, you’ll end up using the system Python:
$ which python
No bueno. To fix this little inconvenience, PyCharm and PhpStorm offer the ability to create a command-line launcher:
You can then launch the IDE via the command-line and you’ll now be using the MacPorts binaries:
$ which python