Skip to content

Tag: python

Can i host multiple sites with one django installation

I have my own VPS server with Centos and cpanel/WHM Currently i am building one website in Django with djnago builin server. When site finishes then i will move to WSGI and apache I want to know that Can I host multiple sites with same django installation Also what bout apps which i have installed with pip li…

How to get formatted date time in python

I want my Linux Filename like this How can i get the date variable formatted like above in Python IN bash i write Answer You can use the same formatting string in strftime on a datetime object: Incidentally, I’d just like to put a word in for the joy of ISO-8601 date formatting

NoSQL Solution to Store Arrays?

I need a scalable NoSql solution to store data as arrays for many fields & time stamps, where the key is a combination of a field and a timestamp. Data would be stored in the following scheme: KEY –> “FIELD_NAME.YYYYMMDD.HHMMSS” VALUE –> [v1, v2, v3, v4, v5, v6] (v1..v6 are j…

Read/Write LabView TDMS files in python under linux

Does anyone know of a way to read and write the National Instruments binary file type (TDMS) in python under linux? I know that NI has a C DLL available, but I don’t know how to access that through python, or if I even can do so under linux. Answer It looks like TDMS isn’t directly supported under…

Format of /dev/input/event*

What is the “format” of the character devices located in /dev/input/event*? In other words, how can I decode the character stream? A Python example would be greatly appreciated. Answer Right here in the Input.py module. You’ll also need the event.py module.

How to detect if USB keyboard is plugged and unplugged

Is there any daemon/tool which will trigger some signal/event when USB keyboard is plugged and unplugged from pc? I need to know in my program when USB keyboard is plugged and unplugged. Any ideas on how to do this? Answer udev (Linux device manager) is the one that polls hardware. When it detects some change…

Python 2.7 cannot import PyQt4

I’ve upgraded to Python 2.7 from Python 2.6 on Ubuntu Maverick Meerkat (10.10) and I’m unable to import PyQt4. I installed both Python 2.7 (python2.7) and PyQt4 (python-qt4) from the Ubuntu repositories. I installed PyQt a while back, but I installed Python 2.7 recently. If I try Python 2.6 (since…

iwlist scan output format

I have to write a tool to get the encryption type out of a iwlist scan. I just can’t seem to find whether or not there’s a standard output. Googling it looks like people are posting slightly different formats, but I can’t tell if they just copy/pasted wrong or what. Specifically, in Encrypti…