ANN: SCF released

2007-08-27 Thread hg
Dear all, I am releasing much of my work including SCF (Cross platform Smart Card library Tools written in Python) to the GPL license. If interested, go to http://www.SnakeCard.com/Source.html I am moving the doc to doxygen and cleaning up the code, so what you'll see there will change in

ANN: PyPE 2.8.6

2007-08-27 Thread Josiah Carlson
=== What is PyPE? === PyPE (Python Programmers' Editor) was written in order to offer a lightweight but powerful editor for those who think emacs is too much and idle is too little. Syntax highlighting is included out of the box, as is multiple open documents via tabs. Beyond the basic

Python-URL! - weekly Python news and links (Aug 27)

2007-08-27 Thread Gabriel Genellina
QOTW: There is something to be said for Python's 'elitism' ;) - Carsten Haese While the discipline of TDD is good and useful, there's a time and place for unstructured and informal experimentation too. - Steven D'Aprano Issue tracker migration is complete - now at

Re: Error with Simplemapi.py

2007-08-27 Thread Mick Duprez
On Aug 27, 2:00 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 24 Aug 2007 04:03:05 -0300, Mick Duprez [EMAIL PROTECTED] escribi?: I have a small problem. I get an error I don't know how to resolve, any help would be much appreciated. I'm using Python25 on winXP pro and the script

Re: Error with Simplemapi.py

2007-08-27 Thread Gabriel Genellina
En Mon, 27 Aug 2007 03:05:30 -0300, Mick Duprez [EMAIL PROTECTED] escribi�: Thank you very much Gabriel, changing the NULL to None did the trick (it also helps if I reload the changed module after editing!:( ). Glad to see it worked. Yes that is an old script and I will look into your

Let's Unite Against Jews and Mongrels!

2007-08-27 Thread Nenad Milicevic - The Aryan Serb
Rise up and shine, white sons and daughters Rise up and shine, you gotta fight to part those waters When we swim in the light, all will be okay The black, yellow and brown man will wash away. -- Let's break the chains of Jewish and black domination! Unite, white

Win32: Detecting when system is locked or sleeping

2007-08-27 Thread Muhammad_Shiraz
Hi I saw your post on the net. We are having a similar problem. Did you ever find out how to detect system lock? Muhammad Asif Shiraz Dell Inc. - eIntelligence Ph: 512.728.6479 -- http://mail.python.org/mailman/listinfo/python-list

Re: Co-developers wanted: document markup language

2007-08-27 Thread Wildemar Wildenburger
Robert Kern wrote: Wildemar Wildenburger wrote: Torsten Bronger wrote: Hallöchen! Yes, you're German. Have you ever noticed that (we) Germans are virtually the only ones that feel the need to rub our nationality into everyones faces? ;) Howdy! We Americans

POP3 - Saving an image attachment only.

2007-08-27 Thread Sick Monkey
I wrote some code below (Code1 block) which will read a pop3 email account and will open each email in the inbox. What I want my code to do is only pull the attachment; as you see below I basically output everything. Is there an easy way to just pull attachments? (NOTE, the only attachements

Lists

2007-08-27 Thread Lamonte Harris
Ok a = ['spam', 'eggs', 100, 1234] So basically when I do print a[1:-1] that will display all the choices in the array besides 0,3 Slicing was kinda weird, just making sure. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to replace a method in an instance.

2007-08-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Aug 22, 12:48 am, Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : (snip) Of course, a function in a class is also know as a method. Less obvious but still wrong !-) I wish the authors of the Python books would get a clue then.

Best open source Python online *CHAT* apps?

2007-08-27 Thread [EMAIL PROTECTED]
Best open source Python online chat apps? I believe there are a few PHP online chat apps to allow people to have conversation via a web server but a Python one would soothe the soul. Any available? Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Chaining programs with pipe

2007-08-27 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Gabriel Genellina wrote: On 22 ago, 11:08, Grant Edwards [EMAIL PROTECTED] wrote: but I'm a Unix guy who occasionally tries to ship a Windows version of a Python app: the concept of a process defaulting to having a stderr or stdout that wasn't writable was

Re: Win32: Detecting when system is locked or sleeping

2007-08-27 Thread Tim Golden
[EMAIL PROTECTED] wrote: I saw your post on the net. We are having a similar problem. Did you ever find out how to detect system lock? I can't seem to see the original post you're referring to (reading this via the mailing list) but assuming that by locked you mean: Ctrl-Alt-Del locked, then

Re: pySerial in a daemon process

2007-08-27 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], paul wrote: Before I had posted this question first thing I did was to look at / dev/ttyS0, and indeed the group is dialout (gid=20)... What are the full protections on the serial port? That is, can you post the output of ls -l /dev/ttyS0 please? --

Re: SCF released to GPL

2007-08-27 Thread M�ta-MCI \(MVP\)
Salut ! Le deuxième envoi aurait pu être en français. Cela aurait évité le doublon, tout en maintenant le message. @+ Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: my parser.py isn't imported

2007-08-27 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Torsten Bronger wrote: So I'd like to know a means to tell *explicitly* what I want to import. Maybe I could use the imp module but that's ugly. That seems to be the standard Python-provided way to explicitly import the file you want from the place you want. I

Re: my parser.py isn't imported

2007-08-27 Thread Torsten Bronger
Hallöchen! John Machin writes: Torsten Bronger wrote: I have a module parser.py in the same directory as the main module. In the main module, I import parser. On Linux, this works as expected, however on Windows, it imports the stdlib parser module. sys.path[0] points to the directory

Re: ANN: SCF released GPL

2007-08-27 Thread Stefan Behnel
Alex Martelli wrote: hg [EMAIL PROTECTED] wrote: ... I am looking for a free subversion server resource to put the code ... if you know of any. Check out code.google.com -- it has a hosting service for open source code, too, these days (and it IS subversion). It's Google, though, so it

Re: Let's Unite Against Jews and Mongrels!

2007-08-27 Thread Raptor
ra ra ra ra ra rara ra ra ra you're so irrelevant man!!! Nenad Milicevic - The Aryan Serb [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Rise up and shine, white sons and daughters Rise up and shine, you gotta fight to part those waters When we swim in the light, all will

Re: ANN: SCF released GPL

2007-08-27 Thread Stefan Behnel
Paul Rubin wrote: hg [EMAIL PROTECTED] writes: I am looking for a free subversion server resource to put the code ... if you know of any. Does it have to be SVN? I think Savannah and Sourceforge both still use CVS. At least SF has usable Subversion support by now. You can choose between

wx.grid and different Value Choice each line ?

2007-08-27 Thread BH
Hi, Hox can I have different value choice for each line in a grid with wxPython ? I want to develop a small software for satisfaction surveys. Each line of the grid is a different question. Sometimes answers are the sames between two lines, but sometimes not. Thx, Bertrand --

Re: Lists

2007-08-27 Thread Wildemar Wildenburger
Lamonte Harris wrote: Ok a = ['spam', 'eggs', 100, 1234] So basically when I do print a[1:-1] that will display all the choices in the array besides 0,3 Slicing was kinda weird, just making sure. And your question is? /W -- http://mail.python.org/mailman/listinfo/python-list

Re: how setup a dll file as a module?

2007-08-27 Thread Diez B. Roggisch
smalltalk wrote: in arcgis , arcgisscripting is a dll file there is a script as following: import arcgisscripting gp = arcgisscripting.create() why can the script run? how can we setup a dll file as a module? There can be python-extension that are essentially C-modules. You can

Re: beginner, idomatic python 2

2007-08-27 Thread Steve Holden
bambam wrote: [but he top-posted] Dan Bishop [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Aug 23, 10:21 pm, bambam [EMAIL PROTECTED] wrote: Would someone like to suggest a replacement for this? This is a function that returns different kinds of similar objects, depending on

Python-URL! - weekly Python news and links (Aug 27)

2007-08-27 Thread Gabriel Genellina
QOTW: There is something to be said for Python's 'elitism' ;) - Carsten Haese While the discipline of TDD is good and useful, there's a time and place for unstructured and informal experimentation too. - Steven D'Aprano Issue tracker migration is complete - now at

Re: Error with long running web spider

2007-08-27 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Josh Volz wrote: My problem is that I keep having an issue where the program appears to freeze. Once this freezing happens the activity of the program drops to zero. No exception is thrown or caught. The program simply stops doing anything. It even stops

Re: how setup a dll file as a module?

2007-08-27 Thread smalltalk
On Aug 27, 6:45 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: smalltalk wrote: in arcgis , arcgisscripting is a dll file there is a script as following: import arcgisscripting gp = arcgisscripting.create() why can the script run? how can we setup a dll file as a module? There

Re: non-blocking communication with imaplib

2007-08-27 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Igor V. Rafienko wrote: I would like to talk to an IMAP-server, imaplib being the tool of choice, of course. Unfortunately it may happen that the IMAP-server fails to respond to certain commands, and I would like to be able to detect that within a given time

Re: beginner, idomatic python 2

2007-08-27 Thread Bruno Desthuilliers
bambam a écrit : OTSteve, could you please stop top-posting ?-) TIA /OT Dan Bishop [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Aug 23, 10:21 pm, bambam [EMAIL PROTECTED] wrote: Would someone like to suggest a replacement for this? This is a function that returns different

Re: beginner, idiomatic python

2007-08-27 Thread Bruno Desthuilliers
bambam a écrit : Thank you, I have been through the tutorial several times, I guess I'm just not smart enough. Perhaps I have been led astray by what I read here? My code started like this: for i in range(self.parent.GetPageCount()): I was asked: Does page count change? i.e. is it

Re: Problem from complex string messing up

2007-08-27 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Well, anyway, a javascript error pops-up somewhere in that code after I run my script on the files. What is the error? In Firefox, under the Tools menu, select Error Console. Click the Clear icon to get rid of whatever junk may already

Re: expat error, help to debug?

2007-08-27 Thread Andreas Lobinger
Aloha, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Andreas Lobinger wrote: Anyone any idea where the error is produced? Do you want to try adding an EndElementHandler as well, just to get more information on where the error might be happening? I want. Adding an EndElement (left

Re: Parser Generator?

2007-08-27 Thread Paul McGuire
On Aug 26, 10:48 pm, Steven Bethard [EMAIL PROTECTED] wrote: Paul McGuire wrote: On Aug 26, 8:05 pm, Ryan Ginstrom [EMAIL PROTECTED] wrote: The only caveat being that since Chinese and Japanese scripts don't typically delimit words with spaces, I think you'd have to pass the text through

Re: wx.grid and different Value Choice each line ?

2007-08-27 Thread kyosohma
On Aug 27, 5:08 am, BH [EMAIL PROTECTED] wrote: Hi, Hox can I have different value choice for each line in a grid with wxPython ? I want to develop a small software for satisfaction surveys. Each line of the grid is a different question. Sometimes answers are the sames between two lines,

RE:question

2007-08-27 Thread JYOUNG79
Hi MRAB, Thanks so much for taking the time to help me with this! I've learned a ton from the example you sent! I studied each part of your code so I could get a good understanding of how it worked. There was one question I had; on the regex line, you used (\d+)$ and I was curious why

Re: Let's Unite Against Jews and Mongrels!

2007-08-27 Thread Lost in the Wasteland
Nenad Milicevic - The Aryan Serb wrote: Belgrade, Serbia Looks like a nice place to vacation. == Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News== http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups = East and West-Coast

Re: wxpython on FreeBSD 6.2 broken

2007-08-27 Thread kyosohma
On Aug 26, 7:35 am, Michael S [EMAIL PROTECTED] wrote: Good day all, I was wondering if anyone was using the latest wxpython on FreeBSD 6. I just installed it yesterday as well as wxGlade. wxGlade doesn't function properly - it does not display any controls. I then tried some simple

Re: Best open source Python online *CHAT* apps?

2007-08-27 Thread kyosohma
On Aug 27, 3:12 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Best open source Python online chat apps? I believe there are a few PHP online chat apps to allow people to have conversation via a web server but a Python one would soothe the soul. Any available? Thanks, Chris Dunno, but

How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread rfv-370
have made the following small test: Before starting my test my UsedPhysicalMemory(PF): 555Mb tf=range(0,1000)PF: 710Mb ( so 155Mb for my List) tf=[0,1,2,3,4,5] PF: 672Mb (Why? Why the remaining 117Mb is not freed?) del tfPF: 672Mb (unused

Re: Parser Generator?

2007-08-27 Thread Steven Bethard
Paul McGuire wrote: On Aug 26, 10:48 pm, Steven Bethard [EMAIL PROTECTED] wrote: In Japanese and Chinese tokenization, word boundaries are not marked by different classes of characters. They only exist in the mind of the reader who knows which sequences of characters could be words given the

Image.open( C:\test.jpg) is this wrong ?

2007-08-27 Thread Carnell, James E
I am trying to simply open an image with PIL... My problem is that I don't know what my active directory is so I am putting an absolute path name in quotes. It can't find the specified file or directory. I'm horrible with docs. I also tried to save an image file (to find where it saved it,

Re: How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread Alex Martelli
rfv-370 [EMAIL PROTECTED] wrote: have made the following small test: Before starting my test my UsedPhysicalMemory(PF): 555Mb tf=range(0,1000)PF: 710Mb ( so 155Mb for my List) tf=[0,1,2,3,4,5] PF: 672Mb (Why? Why the remaining 117Mb is not freed?) del tf

Re: How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread MC
Hi! For windows, I had a soft for this (reduce_memory.exe). Sorry, it's not write with Python. If you want, I will give a URL for download it. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: How to replace a method in an instance.

2007-08-27 Thread Alex Martelli
Bruno Desthuilliers [EMAIL PROTECTED] wrote: Of course, a function in a class is also know as a method. Less obvious but still wrong !-) I wish the authors of the Python books would get a clue then. I'd think that at least some authors of some Python books would explain all this

getLabel() CD-ROM

2007-08-27 Thread Guillermo Heizenreder
Hi list, I'm new whit pygtk library. I'm interest to know if there is a class in the graphics library that it can provide me with information about the CD-ROM label ( something similar to class KMount in the graphic library pykde[1]). At the time I'm using pycdio class[2],but i don't wont to my

Re: How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread Marc 'BlackJack' Rintsch
On Mon, 27 Aug 2007 07:18:26 -0700, rfv-370 wrote: have made the following small test: Before starting my test my UsedPhysicalMemory(PF): 555Mb tf=range(0,1000)PF: 710Mb ( so 155Mb for my List) tf=[0,1,2,3,4,5] PF: 672Mb (Why? Why the remaining 117Mb is not freed?)

Re: How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread Peter Otten
Alex Martelli wrote: Integer objects that are once generated are kept around in a free list against the probability that they might be needed again in the future (a Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type help, copyright, credits or

Re: How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread Peter Otten
Peter Otten wrote: Alex Martelli wrote: Integer objects that are once generated are kept around in a free list against the probability that they might be needed again in the future (a Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type

Re: comparing two lists

2007-08-27 Thread Ladislav Andel
I have learnt a lot from your example and used it for my purpose. Thank you, it very helped me. Lada Peter Otten wrote: Ladislav Andel wrote: need to be stopped before deleting any instance from items. So I need to call stopLoop method in the given item in items before it gets removed.

Re: Image.open( C:\test.jpg) is this wrong ?

2007-08-27 Thread Simon Brunning
On 8/27/07, Carnell, James E [EMAIL PROTECTED] wrote: Image.open(C:\test.jpg) Try: Image.open(rC:\test.jpg) See http://docs.python.org/ref/strings.html -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo:

weird edgecolumn behavior in scintilla

2007-08-27 Thread SHY
hey everyone, i decided its time to heavily improve myself in python-gui programming and so i started building my own editor/ide for PHP. so far, most of the general/basic features are inspired (read: mostly copy-pasted) by eric4 IDE build upon qt4/scintilla combination. but i came across to a

Re: Image.open( C:\test.jpg) is this wrong ?

2007-08-27 Thread Tim Williams
On 27/08/07, Simon Brunning [EMAIL PROTECTED] wrote: On 8/27/07, Carnell, James E [EMAIL PROTECTED] wrote: Image.open(C:\test.jpg) Try: Image.open(rC:\test.jpg) See http://docs.python.org/ref/strings.html rC:\test.jpg also C:\\test.jpg or 'C:/test.jpg' --

Re: passing arguments with ampersands

2007-08-27 Thread SHY
that was the problem. when i manually reassociated the extension, i somehow didnt quote the argument for the filename. my bad. thanks for the various explanations and options for this :) cheers. 2007/8/20, Gabriel Genellina [EMAIL PROTECTED]: En Sat, 18 Aug 2007 09:24:35 -0300, SHY [EMAIL

sorting a list of lists

2007-08-27 Thread nicksavill
Hi, i would like to sort a list of lists. The list is first sorted on the second item in the sub-lists (which I can do), then on the third item (which I can't). eg. records = [['dog',1,2], ['chair',2,1], ['cat',1,3], ['horse',3,4], ['table',3,2], ['window',3,5]] I want sorted to [['dog',1,2],

Re: sorting a list of lists

2007-08-27 Thread Peter Otten
[EMAIL PROTECTED] wrote: i would like to sort a list of lists. The list is first sorted on the second item in the sub-lists (which I can do), then on the third item (which I can't). eg. records = [['dog',1,2], ['chair',2,1], ['cat',1,3], ['horse',3,4], ['table',3,2], ['window',3,5]] I

Re: Python error on Mac

2007-08-27 Thread Jay Loden
Clover wrote: When trying to do some things on my Mac (starting Lyx, compiling Latex via TextMate) I get this error: python: execv: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python: No such file or directory I (and people on Lyx and

Re: the del function

2007-08-27 Thread Matt McCredie
For some odd reason the del array[ray] isn't actually deleting the array item in the list I get the following output: C:\Documents and Settings\program\Desktop\python\pygameremix.py [2, 2, 2, 4, 4, 4, 4, 3, 3, 3, 3] [2, 2, 2, 4, 4, 4, 4, 3, 3, 3, 3] [2, 2, 2, 2, 4, 4, 4, 3, 3, 3, 3] [2,

Re: Co-developers wanted: document markup language

2007-08-27 Thread Steve Holden
Wildemar Wildenburger wrote: Robert Kern wrote: Wildemar Wildenburger wrote: Torsten Bronger wrote: Hallöchen! Yes, you're German. Have you ever noticed that (we) Germans are virtually the only ones that feel the need to rub our nationality into everyones faces? ;)

Re: sorting a list of lists

2007-08-27 Thread iapain
i would like to sort a list of lists. The list is first sorted on the second item in the sub-lists (which I can do), then on the third item (which I can't). Write a comparator instead of dirty hacks mylistoflist.sort(mycomparator) def mycomparator(a, b): #do --

Re: How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread M�ta-MCI \(MVP\)
Re! Sended by direct (private) e-mail @+ Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

convert non-delimited to delimited

2007-08-27 Thread RyanL
I'm a newbie! I have a non-delimited data file that I'd like to convert to delimited. Example... Line in non-delimited file: 01397256359210100534+42050-102800FM-15+1198KAIA Should be: 0139,725635,9,2000,01,01,00,53,4,+42050,-102800,FM-15,+1198,KAIA What is the best way to go about

Re: How to free memory ( ie garbage collect) at run time with Python 2.5.1(windows)

2007-08-27 Thread M�ta-MCI \(MVP\)
Aïe! gmail said : illegal attachment (because .exe?) I will try to send a zipped-file... @+ Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: beginner, idiomatic python

2007-08-27 Thread Neil Cerutti
On 2007-08-27, bambam [EMAIL PROTECTED] wrote: Thank you, I have been through the tutorial several times, I guess I'm just not smart enough. Perhaps I have been led astray by what I read here? My code started like this: for i in range(self.parent.GetPageCount()): I was asked: Does page

Re: sorting a list of lists

2007-08-27 Thread Stefan Behnel
iapain wrote: i would like to sort a list of lists. The list is first sorted on the second item in the sub-lists (which I can do), then on the third item (which I can't). Write a comparator instead of dirty hacks mylistoflist.sort(mycomparator) def mycomparator(a, b): #do Taking

Re: convert non-delimited to delimited

2007-08-27 Thread Mark Elston
* RyanL wrote (on 8/27/2007 10:59 AM): I'm a newbie! I have a non-delimited data file that I'd like to convert to delimited. Example... Line in non-delimited file: 01397256359210100534+42050-102800FM-15+1198KAIA Should be:

Re: convert non-delimited to delimited

2007-08-27 Thread [EMAIL PROTECTED]
On Aug 27, 1:35 pm, Mark Elston [EMAIL PROTECTED] wrote: * RyanL wrote (on 8/27/2007 10:59 AM): I'm a newbie! I have a non-delimited data file that I'd like to convert to delimited. Example... Line in non-delimited file: 01397256359210100534+42050-102800FM-15+1198KAIA

Re: convert non-delimited to delimited

2007-08-27 Thread Michael Bentley
On Aug 27, 2007, at 10:59 AM, RyanL wrote: I'm a newbie! I have a non-delimited data file that I'd like to convert to delimited. Example... Line in non-delimited file: 01397256359210100534+42050-102800FM-15+1198KAIA Should be:

Re: convert non-delimited to delimited

2007-08-27 Thread Matimus
On Aug 27, 10:59 am, RyanL [EMAIL PROTECTED] wrote: I'm a newbie! I have a non-delimited data file that I'd like to convert to delimited. Example... Line in non-delimited file: 01397256359210100534+42050-102800FM-15+1198KAIA Should be:

Re: sorting a list of lists

2007-08-27 Thread iapain
Taking advantage of stable sorting is totally not a hack. The OP just tried the two sorting steps in the wrong order. I didnt say not to use stable sorting, but write a generic function and hacky code. It is always better to adopt a generic approach. --

Re: beginner, idiomatic python

2007-08-27 Thread Neil Cerutti
On 2007-08-27, Neil Cerutti [EMAIL PROTECTED] wrote: This sort of suggests a direct solution: for i in xrange(self.parent.GetPageCount()): if i = self.parent.GetPageCount(): break # do stuff At least that way you're spared the manual manipulation of i. On second thought, that last

Re: convert non-delimited to delimited

2007-08-27 Thread Neil Cerutti
On 2007-08-27, RyanL [EMAIL PROTECTED] wrote: I'm a newbie! I have a non-delimited data file that I'd like to convert to delimited. Example... Line in non-delimited file: 01397256359210100534+42050-102800FM-15+1198KAIA Should be:

[PyQt] Help on resizing a custom widget

2007-08-27 Thread [EMAIL PROTECTED]
Ok, here's what's going on. I've just created a custom widget. it works great. I'm having some trouble, however, figuring out how to allow the said widget to resize. For example, when I throw the widget into a new dialog (using Qt Designer), I want to be able to drag it larger/smaller and have

an eval()-like exec()

2007-08-27 Thread Abel Daniel
Hi! A python interactive interpreter works by having the user type in some code, compiling and running that code, then printing the results. For printing, the results are turned into strings. I would like make an interpreter which does this, without the last part: i.e. where the results are

Re: Image.open( C:\test.jpg) is this wrong ?

2007-08-27 Thread Nicholas Amorim
Ah My problem is that I don't know what my active directory is so I am putting an absolute path name in quotes. import os os.getcwd() # it returns your current directory -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting a list of lists

2007-08-27 Thread [EMAIL PROTECTED]
On Aug 27, 2:41 pm, iapain [EMAIL PROTECTED] wrote: ... It is always better to adopt a generic approach. The above statement is incorrect. -- http://mail.python.org/mailman/listinfo/python-list

Socket - gaierror

2007-08-27 Thread half . italian
Hi all, I'm having trouble with the socket module resolving a hostname. It seems like this is a system level problem, but I'm not even sure where to start. I can ping the smtp server by name and IP, but when smtp.SMTP(theHost) tries to get the hostname, it keeps giving me the following error:

Re: beginner, idiomatic python

2007-08-27 Thread Paul Rubin
Neil Cerutti [EMAIL PROTECTED] writes: i = 0 while i self.parent.GetPageCount(): # do stuff i += 1 Alternatively: from itertools import count for i in count(): if i = self.parent.GetPageCount(): break ... --

Re: Socket - gaierror

2007-08-27 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi all, I'm having trouble with the socket module resolving a hostname. It seems like this is a system level problem, but I'm not even sure where to start. I can ping the smtp server by name and IP, but when smtp.SMTP(theHost) tries to get the hostname, it keeps

Re: Socket - gaierror

2007-08-27 Thread half . italian
On Aug 27, 12:32 pm, Larry Bates [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi all, I'm having trouble with the socket module resolving a hostname. It seems like this is a system level problem, but I'm not even sure where to start. I can ping the smtp server by name and IP, but

some problems with mod_python

2007-08-27 Thread Johan
Hi I have installed and tested this on centos, fedora and freebsd all give the same problem so I guess I missed some steps. I have compiled bot apache (2.2.4) and mod_python (3.3.1) according to the docs and no problem with this. But when I have made everything about testing mod_python an browse

Getting subprocesses to be hidden on Windows

2007-08-27 Thread geoffbache
Hi, As part of my efforts to write a test tool that copes with GUIs nicely, I'm trying to establish how I can start a GUI process on Windows that will not bring up the window. So I try to hide the window as follows: info = subprocess.STARTUPINFO() info.dwFlags |= subprocess.STARTF_USESHOWWINDOW

Re: some problems with mod_python

2007-08-27 Thread Greg Donald
On 8/27/07, Johan [EMAIL PROTECTED] wrote: This I added to httpd.conf Directory /opt/site/htdocs/test AllowOverride All AddHandler mod_python .py PythonHandler mptest PythonDebug On /Directory This is the syntax I have working locally: # mod_python

Re: [PyQt] Help on resizing a custom widget

2007-08-27 Thread Phil Thompson
On Monday 27 August 2007, [EMAIL PROTECTED] wrote: Ok, here's what's going on. I've just created a custom widget. it works great. I'm having some trouble, however, figuring out how to allow the said widget to resize. For example, when I throw the widget into a new dialog (using Qt Designer), I

Re: some problems with mod_python

2007-08-27 Thread Johan
On Aug 27, 10:29 pm, Greg Donald [EMAIL PROTECTED] wrote: This is the syntax I have working locally: # mod_python Directory /opt/local/apache2/htdocs/modpython AddHandler python-program .py PythonHandler test PythonDebug On /Directory In particular my AddHandler directive is

Re: sorting a list of lists

2007-08-27 Thread Tuomas
records = [['dog',1,2], ['chair',2,1], ['cat',1,3], ['horse',3,4], ... ['table',3,2], ['window',3,5]] sorted(records, key = lambda x: (x[1], x[2])) [['dog', 1, 2], ['cat', 1, 3], ['chair', 2, 1], ['table', 3, 2], ['horse', 3, 4], ['window', 3, 5]] [EMAIL PROTECTED] wrote: Hi, i would

Biased random?

2007-08-27 Thread Ivan Voras
Hi, I have a list of items, and need to choose several elements from it, almost random. The catch is that the elements from the beginning should have more chance of being selected than those at the end (how much more? I don't care how the envelope of probability looks like at this point - can be

Re: Help on resizing a custom widget

2007-08-27 Thread [EMAIL PROTECTED]
On Aug 27, 4:40 pm, Phil Thompson [EMAIL PROTECTED] wrote: On Monday 27 August 2007, [EMAIL PROTECTED] wrote: Ok, here's what's going on. I've just created a custom widget. it works great. I'm having some trouble, however, figuring out how to allow the said widget to resize. For example,

Re: Biased random?

2007-08-27 Thread Jon Clements
How about decorating your list of elements with an additional value, which indicates the weight of that element. A value of 1 will indicate 'as likely as any other', 1 will be 'less likely than' any other and 1 will be 'more likely than any other'. Then create a sorted list based on the combined

Re: Getting subprocesses to be hidden on Windows

2007-08-27 Thread kyosohma
On Aug 27, 3:21 pm, geoffbache [EMAIL PROTECTED] wrote: Hi, As part of my efforts to write a test tool that copes with GUIs nicely, I'm trying to establish how I can start a GUI process on Windows that will not bring up the window. So I try to hide the window as follows: info =

Try: which only encompasses head of compound statement

2007-08-27 Thread Jameson . Quinn
I have: try: for line in open(myFileName): count += 1 except IOError: print Can't open myfile (I know, this is bad, I never close the file, but its just for illustration). But then I change it to: try: for line in open(myFileName): count +=

include folder

2007-08-27 Thread Raul Araya
Dear Python users and developers: My trouble is as follows: I'm putting back on line an old pc-linux cluster. Today while trying to install a python based program I got an error regarding the Python.h file that should be in the /include/Phyton2.3 folder. So I went looking for the file but it

Re: Biased random?

2007-08-27 Thread Jun-geun Park
Ivan Voras wrote: Hi, I have a list of items, and need to choose several elements from it, almost random. The catch is that the elements from the beginning should have more chance of being selected than those at the end (how much more? I don't care how the envelope of probability looks like

Re: Try: which only encompasses head of compound statement

2007-08-27 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: I have: try: for line in open(myFileName): count += 1 except IOError: print Can't open myfile (I know, this is bad, I never close the file, but its just for illustration). But then I change it to: try: for line in open(myFileName):

Re: Biased random?

2007-08-27 Thread Grant Edwards
On 2007-08-27, Jun-geun Park [EMAIL PROTECTED] wrote: I have a list of items, and need to choose several elements from it, almost random. The catch is that the elements from the beginning should have more chance of being selected than those at the end (how much more? I don't care how the

Re: my parser.py isn't imported

2007-08-27 Thread John Machin
On Aug 27, 7:33 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Torsten Bronger wrote: So I'd like to know a means to tell *explicitly* what I want to import. Maybe I could use the imp module but that's ugly. That seems to be the

Re: Image.open( C:\test.jpg) is this wrong ?

2007-08-27 Thread Matt McCredie
Image.open(C:\test.jpg) # this is what I have right now. And it can't find the file or directory. The file is there (it is everywhere on my computer now!!!) I found some code where they apply the file path to a variable in single quotes. Is that how it is done. Also I thought single quotes

Re: some problems with mod_python

2007-08-27 Thread Graham Dumpleton
On Aug 28, 6:13 am, Johan [EMAIL PROTECTED] wrote: Hi I have installed and tested this on centos, fedora and freebsd all give the same problem so I guess I missed some steps. I have compiled bot apache (2.2.4) and mod_python (3.3.1) according to the docs and no problem with this. But when

Re: Socket - gaierror

2007-08-27 Thread half . italian
On Aug 27, 12:47 pm, [EMAIL PROTECTED] wrote: On Aug 27, 12:32 pm, Larry Bates [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi all, I'm having trouble with the socket module resolving a hostname. It seems like this is a system level problem, but I'm not even sure where to

Re: Biased random?

2007-08-27 Thread [EMAIL PROTECTED]
On Aug 27, 3:42 pm, Ivan Voras [EMAIL PROTECTED] wrote: Hi, I have a list of items, and need to choose several elements from it, almost random. The catch is that the elements from the beginning should have more chance of being selected than those at the end (how much more? I don't care how

  1   2   >