473,544 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
5
2,092
thread by: Graham Nicholls | last post Jul 18 '05 by: Graham Nicholls
Thanks to Richard and Alex, I'm doing this: seg_stru=">BHH" seg_data=self.fhand.read(struct.calcsize(seg_stru)) data=struct.unpack(seg_stru,seg_data) x=seg_data y=seg_data if debug: print ("DEBUG: Image is by pixels" % (self.fname,x,y))
3
9,200
thread by: Greg Brunet | last post Jul 18 '05 by: Alex Martelli
In puzzling over classes, I'm wondering if classes can have read-only static properties? I certainly seem to be able to do create static properties like this: class C(object): count = 0 def __init__(self,s): C.count += 1 self.Name = s
1
1,556
thread by: Bernd Lueth | last post Jul 18 '05 by: Cliff Wells
Dear Group, I've tried to use wxDir / wxFile ( read about them in the wxwindows docs coming with the wxPython distribution ) but somehow I'm not able to find out how to import these classe(s). Any help would be greatly appreciated. Regards, Bernd
6
4,563
thread by: Greg Brunet | last post Jul 18 '05 by: Aahz
I'm trying to write a package to handle working with DBase files. There's enough different stuff in handling them (unfortunately) that I'm not going to try to the interface DB-API 2.0 compliant - it'll be a lower level wrapper around reading & writing the DBF files. In trying to design a good framework, however, I'm unsure of how to progress....
2
1,802
thread by: chansky | last post Jul 18 '05 by: Terry Reedy
I read the following link about generator: http://www.python.org/peps/pep-0255.html but I am still not so clear on the use/purpose of a generator function other than the fact that a generator can retain the state of the local variables within the fuction body. Can someone out there shed some lights on this topic or share about how/when you...
0
1,407
thread by: Irmen de Jong | last post Jul 18 '05 by: Irmen de Jong
QOTW: "To make the instructions even friendlier it would also help if 'but Whatever You Do DON'T UNZIP THE FREAKIN' THING - This Means YOU John Latter!' were in large, bold, and underlined type. And preferably a different colour." -- John Latter, on Python's install instructions " What's more, these are three of Python's greatest...
0
1,211
thread by: | last post Jul 18 '05 by:
Yachting Heritage
1
2,372
thread by: hokiegal99 | last post Jul 18 '05 by: Christos TZOTZIOY Georgiou
I've written a small script (with much help from this list) that searches through a directory for files without a PC filename extension like .doc .xls and then adds them. The reason for writing the script is that I'm migrating several dozen Mac users to PCs over the next few months and many of the Mac files do not have PC filename extensions....
5
19,749
thread by: Dave Harrison | last post Jul 18 '05 by: Chris
Im sure this is a really obvious problem but : self.curs.execute( """SELECT * FROM user WHERE login LIKE '%%s%'""", ) will not work ... gives me an "unsupported format character ''' (0x27)" escaping the %'s with % as the doco recommends wont work either.
3
11,028
thread by: Graham Nicholls | last post Jul 18 '05 by: Alex Martelli
Hi, I'm trying to size a jpeg file. The file size is held in a short (2 byte integer) at a certain offset. Once I've found these two bytes (they're in MSB,LSB order), I need to convert them to an integer - now I know that in C I'd just cast a pointer to the offset to a short, and that python doesn't cast, so how can I extract the value from...
0
1,753
thread by: Oliver Emrich | last post Jul 18 '05 by: Oliver Emrich
p {margin: 0px} Hi all,  
0
1,441
thread by: Rolf Wester | last post Jul 18 '05 by: Rolf Wester
Hi, I just installed Python2.2.3 and Tcl8.4. When starting idle.py I get the error messgae that no usable init.tcl could be found. Python seems to look in a directory named ../tcl8.3. How can I tell Python to use Tcl8.4 (I tried to download Tcl8.3 at www.scriptics.com but when trying to download Tcl8.3 I end up with Tcl8.4). Thanks in...
1
2,091
thread by: R.Marquez | last post Jul 18 '05 by: R.Marquez
I uninstalled my 2.2.2 version of Python and related packages from my XP Professional station and proceeded to upgrade to the latest and greatest: Python2.3, win32all-155.exe, etc. When I try to start the Pythonwin editor, either through its shortcut or through right clicking on an existing module, a window pops up with the message: <Error...
1
2,499
thread by: Sami Viitanen | last post Jul 18 '05 by: Fredrik Lundh
Hello, I'm using os.popen and read for reading command input to string but the string doesn't contain the same output that running the command manually or with os.system contains. with os.system: cvs server: Diffing //Project1 File //Project1/testiware.txt is new; current revision 3.13 File //Project1/what_is_version_control.txt is new;...
2
2,228
thread by: Daniel Dittmar | last post Jul 18 '05 by: Andreas Jung
I'm trying to detect whether the Python currently running has been compiled for UCS2 or UCS4. I need this because I'm distributing a C extension. I've choosen to pack the binaries for all the Python versions into one download and then decide at runtime which one to load. And with RedHat compiling Python for UCS4, I'll have to do the same...
0
1,383
thread by: webmaster | last post Jul 18 '05 by: webmaster
See the following code. I wonder why in this case neither setp() nor getp() is called !? yetix@/home/ajung(1)% cat test.py class A: def __init__(self): self._p=None
2
1,352
thread by: Batista, Facundo | last post Jul 18 '05 by: Timo Warns
Example of class. Just an object between all of them in my program: class Example: def __init__(self, value): self.value = value return def getValue(self): return self.value
2
1,688
thread by: achrist | last post Jul 18 '05 by: Gerhard Häring
Have hit a problem with PySQLite and python 2.3. The new bool type doesn't want to get written properly to a database. I was expecting this to break when I started using True and False in python 2.2, but it didn't. Now there's a little trouble. I changed the _quote function in pysqlite main.py to look like: def _quote(value): if...
0
1,457
thread by: strong | last post Jul 18 '05 by: strong
may you help me?? thanks!! I want to establish a environment to server multi-user in win2000 I run a cgi-multithread-server program,its name is cgisrv.py and I write two programs to test it, one is named as test.py,another is result.py test.py : it has a form and a submit button,submit to result.py, it's just a html page result.py : use...
5
7,189
thread by: Andrew Gregory | last post Jul 18 '05 by: Eric Brunel
Could someone help me out with these few lines of code: I would like to know why the Quit button in this application removes the buttons and causes "Quitting" to be printed, but does not close the outer frame. Andrew. # Demonstration TK interface Windows application # Runs ok from within IDLE
0
1,807
thread by: bk | last post Jul 18 '05 by: bk
hi, thank you for the hint, but i solved the problem myself. i didnt knew that that the following two lines in py-script must be added: from win32com.client import gencache gencache.EnsureModule('{00062FFF-0000-0000-C000-000000000046}',0,8,0) now it works fine. my skills in python in python are not really advanced, so the...
0
1,061
thread by: Mirko Zeibig | last post Jul 18 '05 by: Mirko Zeibig
Hello, assuming I have a C++-library implementing tracing, where the tracefile is implemented as singleton and implements a method rotateLogs. Is it safe to have something like: def handleSIGUSR2(signal, frame): tracelib.rotateLogs()
1
2,182
thread by: Henrik Weber | last post Jul 18 '05 by: Henrik Weber
Hi. I have tried to add pychecker as an extension to pythonwin. Now I can have pychecker check the source file that is currently open in the editor with a single keypress. If someone is interested, here is how to do it: Create an empty file in your <pythondir>\Lib\site-packages\Pythonwin\pywin directory. Give it a name with .cfg as...
0
2,675
thread by: Juan Carlos CORUÑA | last post Jul 18 '05 by: Juan Carlos CORUÑA
Hello all, I have developed an automation server using Mark's win32 extensions and I must return a IStream COM object from one method of the automation server. Here is an extract of my code: class Stream: _public_methods_ =
0
1,646
thread by: jim | last post Jul 18 '05 by: jim
Hi, All I am using python (activestate 2.2.2-224) on XP home and have suddenly got the following error from a file which works fine under millenium. File "E:\code\Python\PyModbus\FEModbusV101.py", line 162, in ComPortWrite rc,mask =win32file.WaitCommEvent(self.hComm,self.Overlapped) api_error: (87, 'WaitCommError', 'The parameter is...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.