Re: Hungarian Notation

2008-05-28 Thread Bruno Desthuilliers
Dan Bishop a écrit : On May 27, 12:28 am, "inhahe" <[EMAIL PROTECTED]> wrote: Does anybody know of a list for canonical prefixes to use for hungarian notation in Python? Not that I plan to name all my variables with hungarian notation, but just for when it's appropriate. pnWe vUse adjHungaria

Re: SocketServer, its offspring, and threads

2008-05-28 Thread Tim Roberts
eliben <[EMAIL PROTECTED]> wrote: > >I ended up using an ugly hack to make it work for me. Since >handle_request() only blocks until a request is received, the thread >can be unblocked by sending it a real message. So to stop a server, I >opened a XML-RPC client connection (using ServerProxy from x

Re: multi dimensional dictionary

2008-05-28 Thread Hrvoje Niksic
Gary Herron <[EMAIL PROTECTED]> writes: > mydict[(0,"person","setTime")] = "12:09:30" > mydict[(0,"person","clrTime")] = "22:09:30" Note that this is more succinctly written as: mydict[0, "person", "setTime"] = "12:09:30" with the added advantage that it looks like a multi-dimensional array

Re: Using poplib to parse headers

2008-05-28 Thread Tim Roberts
Jean-Claude Neveu <[EMAIL PROTECTED]> wrote: > >I am writing a Python program to check email using POP3. I've tried >the sample code from python.org, and it works great. In other words, >the code below successfully prints out my emails. > >import getpass, poplib, email >M = poplib.POP3('mail.blah

Does this path exist?

2008-05-28 Thread s0suk3
I wanted to ask for ways to test whether a path exists. I usually use os.path.exists(), which does a stat call on the path and returns True if it succeeds, or False if it fails (catches os.error). But stat calls don't fail only when a path doesn't exist. I see that, at least on Windows, the instanc

Re: Creating a web page with Python

2008-05-28 Thread subhabrata . iisc
Dear Mike, Thanx your solutions came to the very point. And you understood the problem so nicely. It is just perfect. Great. Regards, Subhabrata Banerjee. Mike Driscoll wrote: > On May 27, 9:25�am, [EMAIL PROTECTED] wrote: > > Dear Members of the group, > > If any one can help me with an idea how

Re: multi dimensional dictionary

2008-05-28 Thread Peter Otten
Gary Herron wrote: > Alok Kumar wrote: >> Dear All, >> >> I am using dictionary for filling my xpath parsed data. >> >> I wanted to use in the following manner. >> >> mydict[index] ["key1"] ["key2"]#Can someone help me with right >> declaration. >> >> So that I can fill my XML xpath parsed dat

Problem with py2exe

2008-05-28 Thread subhabrata . iisc
Dear Members of the group, py2exe does not seem to be integrating with 2.5 or later versions. I was trying to run it but requested only for 2.3. How can I run it? If any one can kindly help. Regards, Subhabrata Banerjee. -- http://mail.python.org/mailman/listinfo/python-list

Re: maximum recursion depth?

2008-05-28 Thread bearophileHUGS
Dennis Lee Bieber, the ghost: > I'd have to wonder why so many recursive calls? Why not? Maybe the algorithm is written in a recursive style. A language is good if allows you to use that style too. On modern CPUs 5 levels don't look that many levels. Bye, bearophile -- http://mail.python.org/

Re: A quick question

2008-05-28 Thread Paul Hankin
On May 28, 11:25 am, "James" <[EMAIL PROTECTED]> wrote: > word = raw_input("Type a word:") > start = len(word) > > for letter in range(start, 0, -1): > print letter Hi James, for letter in reversed(word): print letter -- Paul Hankin -- http://mail.python.org/mailman/listinfo/python-list

Re: A quick question

2008-05-28 Thread Bruno Desthuilliers
James a écrit : Hey everyone, I just started using python and cant figure this out, I'm trying to make a program where someone types in a word and the program gives it back backwards. For example if the person puts in "cat" I want the program to give it back as "tac" and what it does is prin

Re: Flash Decoder

2008-05-28 Thread Diez B. Roggisch
Ankit wrote: > Hi everyone,i wanted to build a flash decoder using python can > somebody tell me which library to use and what steps should i follow > to make a flash(video) decoder?By a decoder i mean that i need to > display all the pixel values of each frame.Waiting for your replies. Check out

Re: datetime.stdptime help

2008-05-28 Thread Laszlo Nagy
Out of curiosity -- just what zone /is/ "BDT"... The only thing that comes to mind is a type for "BST" (British Summer Time) I think you are right. This date string was taken from a .co.uk site. :-) My fault. It was a 3 letter code after a date, I was sure that it is a time zone. A

A quick question

2008-05-28 Thread James
Hey everyone, I just started using python and cant figure this out, I'm trying to make a program where someone types in a word and the program gives it back backwards. For example if the person puts in "cat" I want the program to give it back as "tac" and what it does is prints out 3,2,1. Ho

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Ulrich Eckhardt
Chris wrote: > On May 28, 11:08 am, [EMAIL PROTECTED] wrote: >> Say I have a file, utf8_input, that contains a single character, é, >> coded as UTF-8: >> >> $ hexdump -C utf8_input >>  c3 a9 >> 0002 [...] > weird thing is 'c3 a9' is é on my side... and copy/pasting the é > gives me 'e

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Chris
On May 28, 11:08 am, [EMAIL PROTECTED] wrote: > Hi, > > I have problems getting my Python code to work with UTF-8 encoding > when reading from stdin / writing to stdout. > > Say I have a file, utf8_input, that contains a single character, é, > coded as UTF-8: > >         $ hexdump -C utf8_input >  

Re: Does this path exist?

2008-05-28 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: > I wanted to ask for ways to test whether a path exists. I usually use > os.path.exists(), which does a stat call on the path and returns True > if it succeeds, or False if it fails (catches os.error). But stat > calls don't fail only when a path doesn't exist. I see that,

Re: Does this path exist?

2008-05-28 Thread Chris
On May 28, 10:59 am, [EMAIL PROTECTED] wrote: > On May 28, 3:47 am, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > I wanted to ask for ways to test whether a path exists. I usually use > > > os.path.exists(), which does a stat call on the path and returns True > >

Flash Decoder

2008-05-28 Thread Ankit
Hi everyone,i wanted to build a flash decoder using python can somebody tell me which library to use and what steps should i follow to make a flash(video) decoder?By a decoder i mean that i need to display all the pixel values of each frame.Waiting for your replies. Regards Ankit Anand -- http://

Re: Does this path exist?

2008-05-28 Thread s0suk3
On May 28, 3:47 am, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I wanted to ask for ways to test whether a path exists. I usually use > > os.path.exists(), which does a stat call on the path and returns True > > if it succeeds, or False if it fails (catches os.error). Bu

Re: Problem with py2exe

2008-05-28 Thread inhahe
i used py2exe with python 2.5 and it worked fine just the other day. py2exe-0.6.6.win32-py2.5.exe was the download filename. <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dear Members of the group, > py2exe does not seem to be integrating with 2.5 or later versions. > I was tryin

Re: A quick question

2008-05-28 Thread D'Arcy J.M. Cain
On Wed, 28 May 2008 10:25:01 - "James" <[EMAIL PROTECTED]> wrote: > Hey everyone, > > I just started using python and cant figure this out, I'm trying to > make a program where someone types in a word and the program gives it > back backwards. For example if the person puts in "cat" I want

Re: tarfile.open(mode='w:gz'|'w|gz'|..., fileobj=StringIO()) fails.

2008-05-28 Thread [EMAIL PROTECTED]
That is right, only bz2 is affected. I am happy that i could help. ;) Regards Sebastian Noack -- http://mail.python.org/mailman/listinfo/python-list

Re: A quick question

2008-05-28 Thread Chris
On May 28, 12:25 pm, "James" <[EMAIL PROTECTED]> wrote: > Hey everyone, > > I just started using python and cant figure this out, I'm trying to > make a program where someone types in a word and the program gives it > back backwards.  For example if the person puts in "cat" I want the > program to

Re: graphical ide??

2008-05-28 Thread TheSaint
On 19:48, martedì 27 maggio 2008 Alex Gusarov wrote: > I tried Eric (on windows), but then decided in favour of Eclipse + > PyDev. I'm a KDE fan :) and I like Qt design. I've Qt designer installed, but I much like if I can use an IDE which write python code, rather than wrappers. I've just been

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread dave_140390
> Shouldn't you do data = data.decode('utf8') ? Yes, that's it! Thanks. -- dave -- http://mail.python.org/mailman/listinfo/python-list

Re: maximum recursion depth?

2008-05-28 Thread Marc 'BlackJack' Rintsch
On Wed, 28 May 2008 02:28:54 -0700, bearophileHUGS wrote: > Dennis Lee Bieber, the ghost: >> I'd have to wonder why so many recursive calls? > > Why not? Because of the recursion limit of course. And function call overhead in Python is quite high compared to an iterative approach. Ciao,

UTF-8 and stdin/stdout?

2008-05-28 Thread dave_140390
Hi, I have problems getting my Python code to work with UTF-8 encoding when reading from stdin / writing to stdout. Say I have a file, utf8_input, that contains a single character, é, coded as UTF-8: $ hexdump -C utf8_input c3 a9 0002 If I read this file by

Re: A quick question

2008-05-28 Thread D'Arcy J.M. Cain
On Wed, 28 May 2008 10:25:01 - "James" <[EMAIL PROTECTED]> wrote: > I just started using python and cant figure this out, I'm trying to > make a program where someone types in a word and the program gives it > back backwards. For example if the person puts in "cat" I want the > program to g

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: > Hi, > > I have problems getting my Python code to work with UTF-8 encoding > when reading from stdin / writing to stdout. > > Say I have a file, utf8_input, that contains a single character, é, > coded as UTF-8: > > $ hexdump -C utf8_input > c3 a9

BeautifulSoup: problems with parsing a website

2008-05-28 Thread Marco Hornung
Hy guys, I'm using the python-framework BeautifulSoup(BS) to parse some information out of a german soccer-website. I spend some qualitiy time with the BS-docs, but I couldn't really figure out how to get what I was looking for. Here's the deal: I want to parse the article shown on the website. T

Re: A quick question

2008-05-28 Thread Bruno Desthuilliers
D'Arcy J.M. Cain a écrit : On Wed, 28 May 2008 10:25:01 - "James" <[EMAIL PROTECTED]> wrote: Hey everyone, I just started using python and cant figure this out, I'm trying to make a program where someone types in a word and the program gives it back backwards. For example if the person p

Re: php vs python

2008-05-28 Thread Michael Fesser
.oO(Ivan Illarionov) >No. Language does matter. And the weather. If you know how to program, you can write good code in any language if you're familiar enough with it. Many people write good code in PHP, and many write total crap in C/C++. It's almost never about the language, but about the prog

Simple Doc Test failing without any reason [Help Needed]

2008-05-28 Thread afrobeard
The following following code fails with the failiure:- File "test.py", line 27, in __main__.sanitize_number Failed example: sanitize_number('0321-4683113') Expected: '03214683113' Got: '03214683113' Expected and Got looks the same. The value should verify. What am I doing wrong her

Re: Flash Decoder

2008-05-28 Thread Ankit
Thanks for replying guys but could you be a little more specific like in terms of steps i shd follow to make the decoder and also how is ffmpeg/libffmpeg going to help.. Regards Ankit Anand -- http://mail.python.org/mailman/listinfo/python-list

Re: Flash Decoder

2008-05-28 Thread Mathieu Prevot
2008/5/28 Diez B. Roggisch <[EMAIL PROTECTED]>: > Ankit wrote: > >> Hi everyone,i wanted to build a flash decoder using python can >> somebody tell me which library to use and what steps should i follow >> to make a flash(video) decoder?By a decoder i mean that i need to >> display all the pixel va

Re: Flash Decoder

2008-05-28 Thread Mathieu Prevot
2008/5/28 Ankit <[EMAIL PROTECTED]>: > Thanks for replying guys but could you be a little more specific like > in terms of steps i shd follow to make the decoder and also how is > ffmpeg/libffmpeg going to help.. You can start by getting familiar with ffmpeg [1] by playing with it and glance at it

Re: Simple Doc Test failing without any reason [Help Needed]

2008-05-28 Thread Gerard Flanagan
On May 28, 1:48 pm, afrobeard <[EMAIL PROTECTED]> wrote: > The following following code fails with the failiure:- > > File "test.py", line 27, in __main__.sanitize_number > Failed example: > sanitize_number('0321-4683113') > Expected: > '03214683113' > Got: > '03214683113' > > Expected

Re: Struct usages in Python

2008-05-28 Thread Alok Kumar
while traversing I get out of index error as mentioned below. class EventTimeFilter: def __init__(self): * self.event = [Event()]* def populateScheduleData(self): self.doc = libxml2.parseFile(self.FILENAME) for eachcamera in self.doc.xpathEval('SetDeviceConfigura

Re: Simple Doc Test failing without any reason [Help Needed]

2008-05-28 Thread afrobeard
I copied the text off here into a new file and it worked!. I then took a diff between the version that didnt work and the version that worked and the only difference was a couple of spaces after this line:- >>> sanitize_number('0321-4683113')>> brackets> Apparently they caused the test case to f

Re: Flash Decoder

2008-05-28 Thread Mathieu Prevot
2008/5/28 ankit anand <[EMAIL PROTECTED]>: > hmm i am more interested in .swf format and more specifically i would like > to have all the pixel values of all the frames can i do that using this > library? Not with ffmpeg. You can check out the code from Gnash [1] or Swfdec [2] or start you swf dec

Re: Python and Flaming Thunder

2008-05-28 Thread Dave Parker
> Does this mean that Flaming Thunder requires explicit checking rather > than offering exceptions? Right now, yes, Flaming Thunder has minimal error handling. But error handling is rising on the list of priorities for the next few weeks (arrays, matrices, and 3D graphics are the hightest). I th

Re: multi dimensional dictionary

2008-05-28 Thread Paul McGuire
On May 28, 3:11 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Gary Herron wrote: > > Alok Kumar wrote: > >> Dear All, > > >> I am using dictionary for filling my xpath parsed data. > > >> I wanted to use in the following manner. > > >> mydict[index] ["key1"] ["key2"]    #Can someone help me with rig

Re: Python and Flaming Thunder

2008-05-28 Thread Duncan Booth
Dave Parker <[EMAIL PROTECTED]> wrote: > Catch also gives you a > single, uniform, syntactically unambiguous way to embed statements (or > whole statement lists) into expressions -- without causing the > syntactic problems of = statements in if statements or the obfuscation > of question mark nota

Error handling in Python

2008-05-28 Thread subhabrata . iisc
Dear Members of the group, If I open a url by urlopen in the urllib, the file is either opening a file or if no url is there it would give error. The error is generated can be handled by IOError handling schemes. But if there are thousands or millions of URLs and I do not know who will open and who

Re: Python and Flaming Thunder

2008-05-28 Thread Dave Parker
> That error message is the erlang interpreter saying "Hey I know X is > 8, and you've said it is 10 - that can't be right", which is pretty > much what math teachers say too... I enjoyed the discussion of how different languages handle the notion of "="; I learned something new. Thanks. On May

Re: Struct usages in Python

2008-05-28 Thread Alok Kumar
I am getting following error when tried as you suggested. self.event = [] #Create an empty list, bind to the name "event" under the "self" namespace self.event.append(Event()) #Create an event object and append to the end of the list *class Event(): ^ SyntaxError: in

ctypes, function pointers and a lot of trouble

2008-05-28 Thread Matt
Hi friends, Okay so well, I have quite a problem right now with a file stream. What I am doing is to use the Cannon SDK dlls to get control over my old Cannon A60 Camera for some surveillance useage. By using ctypes it all worked well until now. I am able to load the dlls, use a lot of funct

Re: Error handling in Python

2008-05-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Dear Members of the group, > If I open a url by urlopen in the urllib, the file is either opening a > file or if no url is there it would give error. The error is generated > can be handled by IOError handling schemes. > But if there are thousands or millions of URLs and

Re: Flash Decoder

2008-05-28 Thread Max Erickson
"Mathieu Prevot" <[EMAIL PROTECTED]> wrote: > 2008/5/28 Diez B. Roggisch <[EMAIL PROTECTED]>: >> Ankit wrote: >> >>> Hi everyone,i wanted to build a flash decoder using python can >>> somebody tell me which library to use and what steps should i >>> follow to make a flash(video) decoder?By a decod

Using an object-relational mapper to convert between databases

2008-05-28 Thread Ben Sizer
Hello, I'd like to be able to do the following: - open a connection to a MySQL or PostgreSQL database - read the schema and contents for one or more tables - create a new sqlite database file and open a connection to it - write out the previously-read tables and their contents to this new dat

Re: php vs python

2008-05-28 Thread cokofreedom
On May 28, 1:42 pm, Michael Fesser <[EMAIL PROTECTED]> wrote: > .oO(Ivan Illarionov) > > >No. Language does matter. > > And the weather. > > If you know how to program, you can write good code in any language if > you're familiar enough with it. Many people write good code in PHP, and > many write

Re: Does this path exist?

2008-05-28 Thread Chris Hulan
On May 28, 4:59 am, [EMAIL PROTECTED] wrote: > On May 28, 3:47 am, Matt Nordhoff <[EMAIL PROTECTED]> wrote: ... > Thanks. So if OSError().errno == errno.ENOENT, then it means the path > doesn't exist? (What does "ENOENT" stan for?) I always read it as Error NO ENTry -- http://mail.python.org/mailm

Re: Struct usages in Python

2008-05-28 Thread J. Cliff Dyer
On Wed, 2008-05-28 at 09:31 -0400, Alok Kumar wrote: > I am getting following error when tried as you suggested. > > self.event = [] #Create an empty list, bind to the name "event" under > the "self" namespace >self.event.append(Event()) #Create an event object and > append to the e

Re: php vs python

2008-05-28 Thread Ivan Illarionov
On Wed, 28 May 2008 06:04:54 +, Tim Roberts wrote: > Ivan Illarionov <[EMAIL PROTECTED]> wrote: >>On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: >>> In reply to Your message dated Monday, May 26, 2008, 04:47:00, >>> > As I've said before - good programmers can write good code in any

A video introducing Ulipad, an IDE mainly for Python

2008-05-28 Thread Dick Moores
I've been using Ulipad, a free IDE mainly for Python, and written in wxPython, for a couple of years, and think it's terrific. Now another user, Kelie Feng, has made an 8-minute video showing it off. The visual clarity of the video is remarkable. You can download it (Introducing_Ulipad_2008-05-

Using PEFile to replace Images in PE EXE

2008-05-28 Thread GeoffreyF67
I am trying to script some image changes for multiple EXE files in linux. The problem I'm running across is that I haven't been able to find anything out there that can do this...until now. It *looks* like pefile (available at google code) would do the trick. Unfortunately I know absolutely noth

Re: Python and Flaming Thunder

2008-05-28 Thread Dave Parker
> > If catch(set x to y+z.) < 0.1 then go to tinyanswer. > > So what does this do exactly if the set throws an error? I think the catch should catch the error thrown by set, compare it to 0.1, the comparison will not return true because the error is not less than 0.1, and so the go-to to tinyanswe

pydb remote debugging/cmd.Cmd over socket?

2008-05-28 Thread Diez B. Roggisch
Hi, I'm fiddling around with pydb. Installation and usage are fine. What I especially like is the fact that you can attach a signal such that you drop into debugging mode on demand. But this is of limited use to me in situations where a server is written in python. According to the source, pydb's

BadStatusLine error

2008-05-28 Thread Jim
Hi I get a BadStatusLine error (indicated below). Can anyone help with how to catch error in code before abort? Thanks Jim Traceback (most recent call last): File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework \scriptutils.py", line 310, in RunScript exec codeObject in __main__.

Re: BadStatusLine error

2008-05-28 Thread Diez B. Roggisch
Jim wrote: > Hi > > I get a BadStatusLine error (indicated below). Can anyone help with > how to > catch error in code before abort? http://docs.python.org/tut/node10.html Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes, function pointers and a lot of trouble

2008-05-28 Thread Nick Craig-Wood
Matt <[EMAIL PROTECTED]> wrote: > Okay so well, I have quite a problem right now with a file stream. What > I am doing is to use the Cannon SDK dlls to get control over my old > Cannon A60 Camera for some surveillance useage. > > By using ctypes it all worked well until now. I am able to loa

Re: definition of a highlevel language?

2008-05-28 Thread Robert Brown
"inhahe" <[EMAIL PROTECTED]> writes: > I like to think of a language that would combine low-level and high-level > features to be used at the programmer's whim. C--, High Level Assembly, and > C++ with in-line assembly are examples, but none of them come as high-level > as Python. Other possib

Re: Python Threads - stopped vs. gone vs. Alive

2008-05-28 Thread RossGK
On May 28, 12:01 pm, RossGK <[EMAIL PROTECTED]> wrote: > I'm a newbie to python threads, and playing with some simple client > server stuff and lots of print statements. > > My server thread launched with > self.worker = WorkerThread(self) > completes an interaction and then if I check on it's

Any way to loop through object variables?

2008-05-28 Thread Dave Challis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Just wondering if there's a way to iterate through all variables which an object has set? Specifically, I'm using the OptionParser module, which returns an options object, containing all command line options as object variables. I'd like to itera

accessing class attributes

2008-05-28 Thread eliben
Hello, I have a game class, and the game has a state. Seeing that Python has no enumeration type, at first I used strings to represent states: "paused", "running", etc. But such a representation has many negatives, so I decided to look at the Enum implementation given here: http://aspn.activestate

Python Threads - stopped vs. gone vs. Alive

2008-05-28 Thread RossGK
I'm a newbie to python threads, and playing with some simple client server stuff and lots of print statements. My server thread launched with self.worker = WorkerThread(self) completes an interaction and then if I check on it's status with print "Status:", self.workerI get

Re: Any way to loop through object variables?

2008-05-28 Thread Gary Herron
Dave Challis wrote: Hi, Just wondering if there's a way to iterate through all variables which an object has set? Specifically, I'm using the OptionParser module, which returns an options object, containing all command line options as object variables. I'd like to iterate over these rather than

Re: accessing class attributes

2008-05-28 Thread Gary Herron
eliben wrote: Hello, I have a game class, and the game has a state. Seeing that Python has no enumeration type, at first I used strings to represent states: "paused", "running", etc. But such a representation has many negatives, so I decided to look at the Enum implementation given here: http://

Re: php vs python

2008-05-28 Thread Jerry Stuckle
[EMAIL PROTECTED] wrote: On May 28, 1:42 pm, Michael Fesser <[EMAIL PROTECTED]> wrote: .oO(Ivan Illarionov) No. Language does matter. And the weather. If you know how to program, you can write good code in any language if you're familiar enough with it. Many people write good code in PHP, an

Re: accessing class attributes

2008-05-28 Thread Arnaud Delobelle
eliben <[EMAIL PROTECTED]> writes: > Hello, > > I have a game class, and the game has a state. Seeing that Python has > no enumeration type, at first I used strings to represent states: > "paused", "running", etc. But such a representation has many > negatives, so I decided to look at the Enum imp

Re: A video introducing Ulipad, an IDE mainly for Python

2008-05-28 Thread Dick Moores
Date: Wed, 28 May 2008 11:29:59 -0400 From: "Sean Azelton" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [Tutor] A video introducing Ulipad, an IDE mainly for Python For those looking for the codec and not running Windows, you can find it here for Mac OS X as well http://www.techsmith.

Problem using Idle under Linux - mouse not working well

2008-05-28 Thread Matthias Sommer
I have a strange problem using the python-Idle: I'm used to be able to position the cursor by clicking on the desired position. When I run Idle under Mandriva (or under Arch Linux as well) this does not work. Running under windows it works, running under Xandros linux on my eee pc it works to

Re: Overloading virtual method of widget without inheriting (PyQt)

2008-05-28 Thread Alex Gusarov
> I have a feeling that the form produced by Qt Designer, once converted to > code, contains references to QCalendarWidget where you really want to use a > customized calendar widget. If so, you should "promote" the calendar widget > in Qt Designer to use your widget instead, and make sure you impo

Re: graphical ide??

2008-05-28 Thread Marc Pelletier
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I'm unsure if you're looking for a development environment like these: > http://wiki.python.org/moin/IntegratedDevelopmentEnvironments > or an interface designer for wxPython (see the bottom part of > http://wiki.python.

Re: definition of a highlevel language?

2008-05-28 Thread Stef Mientki
Avowkind wrote: On May 27, 6:34 am, [EMAIL PROTECTED] wrote: (might not be the right forum for this but...) what is the definition of a highlevel-language? well there isnt one specifically and wikipedia and the like gives just a very general description obv you can say it abstracts away low

Re: Struct usages in Python

2008-05-28 Thread Alex Gusarov
> class Event(object): > > Always subclass object, unless you have a very compelling reason not to, > or you are subclassing something else. > I've thought that if I write class Event: pass , it'll be subclass of object too, I was wrong? -- Best regards, Alex Gusarov -- http://mail.python.

Re: datetime.stdptime help

2008-05-28 Thread mblume
Am Tue, 27 May 2008 12:37:34 -0700 schrieb Dennis Lee Bieber: > > From the library reference: > """ > Support for the %Z directive is based on the values contained in tzname > and whether daylight is true. Because of this, it is platform-specific > except for recognizing UTC and GMT which ar

Re: Python Threads - stopped vs. gone vs. Alive

2008-05-28 Thread RossGK
I've answered my own question about the "None" state - an event was setting the thread to None where I didn't expect it. However, my question slightly repositioned is if a Thread is "Stopped" it still seems to exist. Is there someway to make it go away, send it to garbage collection etc? Other p

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-28 Thread davidj411
On May 28, 2:22 am, Kam-Hung Soh <[EMAIL PROTECTED]> wrote: > David Jackson wrote: > > i used the csv module and saved its contents to a list. > > > ['Date', 'No.', 'Description', 'Debit', 'Credit'] > > ['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45'] > > ['3/04/2007', '5678', 'THE HOME DEP

Re: Struct usages in Python

2008-05-28 Thread Diez B. Roggisch
Alex Gusarov schrieb: class Event(object): Always subclass object, unless you have a very compelling reason not to, or you are subclassing something else. I've thought that if I write class Event: pass , it'll be subclass of object too, I was wrong? Yes. That is the somewhat unfortu

Re: Struct usages in Python

2008-05-28 Thread Arnaud Delobelle
"Alex Gusarov" <[EMAIL PROTECTED]> writes: >> class Event(object): >> >> Always subclass object, unless you have a very compelling reason not to, >> or you are subclassing something else. >> > > I've thought that if I write > > class Event: > pass > > , it'll be subclass of object too, I was

Re: Struct usages in Python

2008-05-28 Thread Arnaud Delobelle
Arnaud Delobelle <[EMAIL PROTECTED]> writes: > "Alex Gusarov" <[EMAIL PROTECTED]> writes: > >>> class Event(object): >>> >>> Always subclass object, unless you have a very compelling reason not to, >>> or you are subclassing something else. >>> >> >> I've thought that if I write >> >> class Event

while-loop?

2008-05-28 Thread huub
Hi, Being a newbie with Python, I'm trying a short program with this: > <..> t = RoboInterface() > <..> while not t.Digital(1): # while endpoint is not reached 15 pass However, it always hangs on the 'while', which I can't find in the tutorial at http://www.python.org/doc/. Assumi

Re: Python Threads - stopped vs. gone vs. Alive

2008-05-28 Thread Francesco Bochicchio
On Wed, 28 May 2008 11:38:53 -0700, RossGK wrote: > > I've answered my own question about the "None" state - an event was > setting the thread to None where I didn't expect it. > > However, my question slightly repositioned is if a Thread is "Stopped" > it still seems to exist. Is there someway

Re: maximum recursion depth?

2008-05-28 Thread Sebastian 'lunar' Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> ] > On Wed, 28 May 2008 02:28:54 -0700, bearophileHUGS wrote: > >> Dennis Lee Bieber, the ghost: >>> I'd have to wonder why so many recursive calls? >> >> Why not? > > Because of the recursion limit of

Re: Python and Flaming Thunder

2008-05-28 Thread Luis Zarrabeitia
On Wednesday 28 May 2008 09:22:53 am Dave Parker wrote: > I think in a month or two, Flaming Thunder will be using catch/throw > exception and error handling.  So, for example: Nice... Flaming Thunder sure evolves quickly. Too quickly to be considered a 'feature' of the language. Following your p

Problem with subprocess and mkstemp

2008-05-28 Thread Hans Larsen
Hello, I'm having this script here: import sys, tempfile, subprocess if len(sys.argv) > 1: i = 0 while i < 1000: print "Hello World" * 500 i = i + 1 exit( 1 ) h,fp = tempfile.mkstemp() print "out: " + fp out = open(fp, "r") proc = subp

Re: while-loop?

2008-05-28 Thread Marc 'BlackJack' Rintsch
On Wed, 28 May 2008 19:56:55 +0200, huub wrote: > Being a newbie with Python, I'm trying a short program with this: > > > <..> >> t = RoboInterface() > > <..> >> while not t.Digital(1): # while endpoint is not reached >> 15 pass > > However, it always hangs on the 'while', which I can

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-05-28 Thread Matthias Bläsing
Am Wed, 28 May 2008 10:41:51 -0700 schrieb davidj411: > I like the str2num function approach, but then i get left with a float > that has more than 2 decimal spaces , i.e. 11.50 becomes > 11.449 and round will not fix that. Welcome to the wonderful world of floating point numbers. For

Re: Python and Flaming Thunder

2008-05-28 Thread Dan Upton
On Wed, May 28, 2008 at 11:09 AM, Dave Parker <[EMAIL PROTECTED]> wrote: >> > If catch(set x to y+z.) < 0.1 then go to tinyanswer. >> >> So what does this do exactly if the set throws an error? > > I think the catch should catch the error thrown by set, compare it to > 0.1, the comparison will not

Threads and import

2008-05-28 Thread rsoh . woodhouse
Hi, I'm trying to work out some strange (to me) behaviour that I see when running a python script in two different ways (I've inherited some code that needs to be maintained and integrated with another lump of code). The sample script is: # Sample script, simply create a new thread and run a # re

Re: accessing class attributes

2008-05-28 Thread giltay
On May 28, 12:09 pm, eliben <[EMAIL PROTECTED]> wrote: > Hello, > > I have a game class, and the game has a state. Seeing that Python has > no enumeration type, at first I used strings to represent states: > "paused", "running", etc. But such a representation has many > negatives, so I decided to l

Re: Threads and import

2008-05-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Hi, I'm trying to work out some strange (to me) behaviour that I see when running a python script in two different ways (I've inherited some code that needs to be maintained and integrated with another lump of code). The sample script is: # Sample script, simply creat

Re: Threads and import

2008-05-28 Thread rsoh . woodhouse
On May 28, 8:26 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > Hi, > > > I'm trying to work out some strange (to me) behaviour that I see when > > running a python script in two different ways (I've inherited some > > code that needs to be maintained and in

Re: looking for membership management software -- Open Source, written in Python

2008-05-28 Thread Rick Kwan
On May 27, 6:13 am, Laura Creighton <[EMAIL PROTECTED]> wrote: > In a message of Mon, 26 May 2008 12:38:28 PDT, [EMAIL PROTECTED] writes: > > >I forgot to ask: what's your target platform? I mentioned Organizer's > >Database, but it only runs on Windows. If you need a Linux or OS X > >solution, t

Re: php vs python

2008-05-28 Thread Paul Rubin
Jerry Stuckle <[EMAIL PROTECTED]> writes: > A good OO programmer could easily write good functional code. Over on #haskell there's a general belief that learning Haskell is easier for nonprogrammers than it is for OO programmers, since the OO programmers first have to unlearn what they previously

Re: Threads and import

2008-05-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: On May 28, 8:26 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] schrieb: Hi, I'm trying to work out some strange (to me) behaviour that I see when running a python script in two different ways (I've inherited some code that needs to be maintaine

Re: confused by HTMLParser class

2008-05-28 Thread Stefan Behnel
globalrev wrote: > tried all kinds of combos to get this to work. In case you meant to say that you can't get it to work, consider using lxml instead. http://codespeak.net/lxml http://codespeak.net/lxml/lxmlhtml.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Martin v. Löwis
> $ cat utf8_from_stdin.py > import sys > data = sys.stdin.read() > print "length of data =", len(data) sys.stdin is a byte stream in Python 2, not a character stream. To make it a character stream, do sys.stdin = codecs.getreader("utf-8")(sys.stdin) HTH, Martin -- http:/

  1   2   >