How do I send single character ASCII data to a serial port with python.
I'v looked at pyserial but I can't seem to figure out how to do it. I only need to send one at a time? Please help? ...
I'v looked at pyserial but I can't seem to figure out how to do it. I only need to send one at a time? Please help? ...
I want to integrate Python with FusionCharts and MySQL. I have python programs to create/access MySQL DB. The same data which resides in the MySQL DB has to be projected to the user in the FusionCharts using Python scripts. Please help me out on this. ...
How would I do this? I want to iterate through each word and see if it fits certain parameters (for example is it longer than 4 letters..etc. not really important though). The text file is literally a rambling of text with punctuation and white spaces, much like this posting. ...
Im trying to check a file line by line for any_string=any_string. It must be that format, no spaces or anything else. The line must contain a string then a "=" and then another string and nothing else. Could someone help me with the syntax in python to find this please? =] pattern='*\S\=\S*' I have this, but im pretty sure its wrong h...
I was profiling the performance of my web application using Google's Page Speed plugin for Firebug and one of the things it says is that I should 'leverage caching' — "The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources". When I dug deeper I ...
Python disables MSCRT assertions for debug mode during the initialization of exceptions module when it is built in debug mode. At least from the source code, I can see Python 2.6.5 doing this for _MSC_VER >= 1400 i.e. Visual C++ 2005. Does anyone know why? ...
I've got a wxpython grid, and I'm changing the background color of a cell to show that something has happened to it. I'd like to fade the color change in/out (like JavaScript in the browser) for a smoother look. Is this possible to do? Right now, I'm just changing the background color, and then changing it back after a 1.5-second inter...
I want to implement a tree structure which has fixed depth, i.e. when adding children to the leef nodes, the whole tree structure should "move up". This also means that several roots can exist simultaneously. See example beneath: In this example, the green nodes are added in iteration 1, deleting the top node (grey) and making the two b...
OK, So I have tried this with & without a virtualenv: uwsgi --home /home/auston/new_proj/ --socket /tmp/uwsgi2.sock --chmod-socket --module app_wsgi --pp /home/auston/new_proj/nikeshere --logto /tmp/uwsgi.log --master --processes 4 -P Pretty much no matter what, I get this: *** Starting uWSGI 0.9.6.5 (32bit) on [Thu Oct 21 08:05:44 2...
Been looking over the python docs for code formatting best practice for large lists and dictionaries, eg something = {'foo' : 'bar', 'foo2' : 'bar2', 'foo3' : 'bar3'..... 200 chars wide etc..} or something = {'foo' : 'bar', 'foo2' : 'bar2', 'foo3' : 'bar3', ... } or something = {...
Hi ! I need to convert tiff file to gif . can some one give me php or python script to do that ? ...
This is a sigmoid function: I know x. How can I calculate F(x) in Python now? Let's say x = 0.458. F(x) = ? ...
In a text file like this: First Name last name # secone name Address Line 1 Address Line 2 Work Phone: Home Phone: Status: First Name last name # ....same as above... I need to match string 'Work Phone:' then go two lines up and insert character '|' in the begining of line. so pseudo code would be: if "Work Phone:" in line: go u...
I have to label something in a "strong monotone increasing" fashion. Be it Invoice Numbers, sipping label numbers or the like. A number MUST NOT BE used twice Every number SHOULD BE used when exactly all smaller numbers have been used (no holes). Fancy way of saying: I need to count 1,2,3,4 ... The number Space I have available are t...
I have the following axis labels and legend. plt.ylabel("ratio_2") plt.xlabel("n_1") plt.legend(('alpha_1','alpha_2' ), loc = 'best',shadow = True) ...
Is there a tool to check if a Python code conforms to the law of Demeter? I found a mention of Demeter in pychecker, but it seems that the tool understands this law different to what I expect: http://en.wikipedia.org/wiki/Law_of_Demeter The definition from wikipedia: the Law of Demeter for functions requires that a method M of an objec...
I have string which is representing time in HH:MM:SS.sss format ,Now i have to convert this sting into HH:MM:SS.ssssss format.Please let me know how to do this? ...
Hello Friends, I have an error when i used pyqrcode. [root@localhost python2.6]# python Python 2.6.5 (r265:79063, Sep 7 2010, 07:31:57) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import qrcode Traceback (most recent call last): File "<stdin>", li...
I try to combine AND and OR in a filter using Q objects. It looks like that the | behave like an AND. This is related to the previous annotate which is run in the same query and not as a subquery. What is the correct way to handle this with Django? models.py class Type(models.Model): name = models.CharField(_('name'), max_length=1...
Hi! I'm new to django and can't find a way to get this to work in django templates. The idea is to check if previous items first letter is equal with current ones, like so: {% for item in items %} {% ifequal item.name[0] previous_item.name[0] %} {{ item.name[0] }} {% endifequal %} {{ item.name }}<br /> {% endforeach ...