Here’s a couple of different ways you can use netsnmp in Python. I had a hard time finding documentation, and what I did find was old and outdated. I figured most of it out just by playing around with the library.
With python 3 you can override the print function’s delimiter value to make it null or whatever else you want. But if you’re stuck with 2.5 or 2.6 like the rest of us, try this on for size. The only problem with this is when you want to use it like a progress bar. If you do this in a loop over time, you will get the expected output, but over time it won’t be the way you expected.
It doesn’t get much easier than this. However, you must add routes for static files such as style sheets and images. These are things that you may take for granted if you’re used to relying on standalone web servers.
Here’s a simple trick to figure out where your python libraries are stored.
ver wish you could test your code on a machine that’s not connected to teh interwebs and doesn’t have python installed? I like portable applications for many reasons, mainly because they just work.
nstallation is easy. Just put the .vim file in ~/.vim/after/ftplugin/ and put the dictionary file somewhere else. Then add two lines to your .vimrc and that’s it. Just hit tab and it will give you a drop down menu allowing you to auto-complete if your cursor is sitting just after a keyword.
Object creation and deletion is handled for you, but have you ever thought about how it works, when is memory freed, etc.? Think of everything in python as an object. Even something as simple as this, and since’s its a string, you can invoke any string method. When you lose access to some object, that memory is freed on its own. If you assign a string to a variable, you will find the memory locations are the same. Calling __del__ only removes access to the object from the local or global namespace. It does not mean the memory location has been freed.
Requires web2py which includes Common shortcuts, Widgets, py2jquery module, Database store configuration settings, Class based menu builder, syntax highlighting, Output compression, and more.
Why can’t I find a code generator that works? Tepache is a code sketcher for python that uses pygtk and glade, but it is broken and it looks like it hasn’t been updated since July 2005 anyway. Gladex was broken out of the box. Autocode does not like my glade and the documentation is limited.
Sometimes a dictionary is nice for keeping things simple. You can directly access any value by looking at the key. But perhaps you need to split the dictionary up into two lists. Or go the other way; turn two related lists into a key-value dictionary.