First  |  Prev |  Next  |  Last
Pages: 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
Fundamental Function Question (beginner)
When creating a function is there any difference between putting everything under the "def" or not? Here I created a function called CscoPortNum to convert the network port number field in a Cisco syslog string from a an ascii name back into its numeric form if required. Does it matter at all that I created the ... 11 Jan 2010 16:29
pyserial: Unexpected Local Echo
Hi, I am using pyserial. But I always get the local echo after I write some characters onto serial port and I find no way to disable this behavior. When I say 'local echo', I mean the next read operation will get characters that was just write to the same port. I run my program on cygwin (pyserial was also bu... 18 Jan 2010 02:05
force URLencoding script
Hi. I'm trying to figure out how to force URLencoding in my Python 2.4.3 environment receiving data an input argument but I'm really at a loss here. What am I doing wrong? #!/usr/bin/env python import sys from urllib import urlencode, urlopen from urllib2 import Request import urlparse destination = s... 18 Jan 2010 16:31
setTextAlignment function Qtablewidget PyQt
Hey! I am trying to align contents of some table cells but find the code below working for some fields and not for others. I am stuck as to why this is happening. Help will be gretly appreciated! setTextAlignment(QtCore.Qt.AlignVCenter) Cheers Zabin ... 10 Jan 2010 20:46
How to use list type generated by SWIG?
I am writing a small script to manage my ipod. I am using the python bindings for libgpod. I have never used swig, or used python to program against a c/c++ library. I can get the library to find my ipod, and parse its DB format, but I'm not sure how to interact with the types that some of the functions return... 10 Jan 2010 16:19
Fractional Hours from datetime?
Maybe there's a more elegant way to do this. I want to express the result of in fractional hours. Here's one way. xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 # now is in fractions of an hour ... 12 Jan 2010 15:10
Something More Elegant
Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where c.CategoryID=%s;' % (store, store, categoryID) cursor.execute(sql) tmp = [itm[0] for i... 9 Jan 2010 10:43
Porblem with xlutils/xlrd/xlwt
Whenever i run the code below I get the following error: AttributeError: 'Book' object has no attribute 'on_demand' WARNING: Failure executing file: <> Why is it so?? from xlrd import open_workbook from xlwt import easyxf from xlutils.copy import copy rb = open_workbook('source.xls',formatting_info... 10 Jan 2010 06:23
Append to an Excel file
Hi All, How do I add a line to an existing file. This should append to the existing data in the excel file, which was saved previously. Thanks, PP ... 12 Jan 2010 08:00
Scripting (was Re: Python books, literature etc)
On Thu, 2010-01-07, Peter wrote: [...] depending on your application domain, I liked: 1) Hans Petter Langtangen: Python Scripting for Computational Science A truly excellent book, not only with respect to Python Scripting , but also on how to avoid paying license fees by using opensource tools as... 9 Jan 2010 15:11
First  |  Prev |  Next  |  Last
Pages: 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226