Re: SCF released to GPL

2007-08-27 Thread Laurent Pointal
hg a écrit : > 2) I'm desperately searching for the French NG from my client but cannot > find it ... any clue ? Maybe you can pass the message ? Done. See http://groups.google.com/group/fr.comp.lang.python/browse_frm/thread/fa4474921f77b1be/8d6150d502447510#8d6150d502447510 -- http://mail.py

Re: Python's Suitability?

2007-08-27 Thread Kay Schluehr
On 28 Aug., 02:28, [EMAIL PROTECTED] (Michael R. Copeland) wrote: >Note that I'm not considering using the existing C/C++ code in my Web > application, because I don't know how to write a C/C++ Windows > application - and I'm sure the learning curve here is greater than > Python's. I'm a very

Re: Biased random?

2007-08-27 Thread Gabriel Genellina
En Mon, 27 Aug 2007 17:42:45 -0300, Ivan Voras <[EMAIL PROTECTED]> escribi�: > 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 m

Re: include folder

2007-08-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Raul Araya wrote: > 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 wasn't there, I mean the > whole folder /Phyton2.3 inside t

Re: "Try:" which only encompasses head of compound statement

2007-08-27 Thread Ben Finney
Scott David Daniels <[EMAIL PROTECTED]> writes: > Actually, this will be followed by some foolishness because > (1) [the "print" format argument was wrong] > and > (2) [the code attempts to loop over the failed input file anyway] You're right. Shame on me for posting untested code snippets, Thank

Re: Chaining programs with pipe

2007-08-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > En Mon, 27 Aug 2007 05:35:51 -0300, Lawrence D'Oliveiro > <[EMAIL PROTECTED]> escribi�: > >> In message <[EMAIL PROTECTED]>, >> Gabriel Genellina wrote: >> >>> On 22 ago, 11:08, Grant Edwards <[EMAIL PROTECTED]> wrote: >>> but I'm a

Re: "Try:" which only encompasses head of compound statement

2007-08-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Carl Banks wrote: > Consider this: is there any other code in your program that has to do > something different based on whether you successfully opened this file > or not? If so, how will you notify it whether the call has succeeded > or not? Very often, the call

Re: an eval()-like exec()

2007-08-27 Thread Gabriel Genellina
En Mon, 27 Aug 2007 15:59:25 -0300, Abel Daniel <[EMAIL PROTECTED]> escribi�: > 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. This last stage

Re: XML File -- dictionary edit/search

2007-08-27 Thread Marc 'BlackJack' Rintsch
On Mon, 27 Aug 2007 18:15:24 -0700, -b wrote: > I am trying to put together a python program that will be able to ask > for a word and its definition, then save that information into an xml > file for reference. I am not down right set on the file being in xml > format, but xml is the first thing

Python Classes

2007-08-27 Thread Lamonte Harris
How come you have to set the initialized created variables to equal the parameters, shouldn't that be default? class testing: def __init__(self,testing): self.testing = testing x = testing("testing") print x.testing How come self.testing = testing Can someone explain

Re: XML File -- dictionary edit/search

2007-08-27 Thread Nagarajan
On Aug 28, 6:15 am, -b <[EMAIL PROTECTED]> wrote: > I am trying to put together a python program that will be able to ask > for a word and its definition, then save that information into an xml > file for reference. I am not down right set on the file being in xml > format, but xml is the first thi

Re: Biased random?

2007-08-27 Thread Jun-geun Park
Jun-geun Park wrote: > 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

Re: sorting a list of lists

2007-08-27 Thread Gabriel Genellina
En Mon, 27 Aug 2007 15:41:15 -0300, iapain <[EMAIL PROTECTED]> escribi�: >> 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

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

2007-08-27 Thread Gabriel Genellina
En Mon, 27 Aug 2007 11:48:46 -0300, Carnell, James E <[EMAIL PROTECTED]> escribi�: >> 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!!!) Use "C:\\test.jpg" or r"C:\test.jpg" or "C:

Re: "Try:" which only encompasses head of compound statement

2007-08-27 Thread Scott David Daniels
Ben Finney wrote: > [EMAIL PROTECTED] writes: > ... try to only catch exceptions from the > minimum amount of code that does one discrete action. > > try: > input_file = open(my_filename) > except IOError, exc: > print "Can't open myfile: %(exc)" % locals() > > for lin

Re: Socket - gaierror

2007-08-27 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: > On Aug 27, 4:22 pm, [EMAIL PROTECTED] (Douglas Wells) wrote: > > In article <[EMAIL PROTECTED]>, > > > > [EMAIL PROTECTED] writes: > > > On Aug 27, 12:32 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > > Changing it to IP gives me the

Re: Chaining programs with pipe

2007-08-27 Thread Gabriel Genellina
En Mon, 27 Aug 2007 05:35:51 -0300, Lawrence D'Oliveiro <[EMAIL PROTECTED]> escribi�: > 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

Re: some problems with mod_python

2007-08-27 Thread Johan
On Aug 24, 3:39 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Your problem is with Apache configuration, not with mod_python. The > AddHandler directive maps /*.py to your handler. So you have to > call .py to trigger the desired behaviour. If you want > *any* url under to be handled by mp

Re: include folder

2007-08-27 Thread Zentrader
> My Linux version is: Debian GNU-Linux > My Python version is: 2.3 Reinstalling Python would be my first option. Any of the versions can be downloaded from python.org but on debian you should be able to just use apt-get or one of the GUIs for apt-get. -- http://mail.python.org/mailman/listinfo

Re: Biased random?

2007-08-27 Thread Scott David Daniels
Ivan Voras 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 "envelope" of probability looks like

Asking all python programmers.

2007-08-27 Thread Lamonte Harris
Okay, I know you've guys told me millions of times to read the manual I've read a lot of it. What do you recommend studying the most? Python is my goal for the next year in the half. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to parse this line of code manually

2007-08-27 Thread Davy
On Aug 28, 11:00 am, Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > It is well known that Python is appreciated for its merit of concise. > However, I found the over concise code is too hard to understand for > me. > > Consider, for instance, > def known_edits2(word): > return set(e2 for e1 in e

How to parse this line of code manually

2007-08-27 Thread Davy
Hi all, It is well known that Python is appreciated for its merit of concise. However, I found the over concise code is too hard to understand for me. Consider, for instance, def known_edits2(word): return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in NWORDS) Shall I understand

Re: SCF released to GPL

2007-08-27 Thread hg
hg wrote: > Méta-MCI (MVP) wrote: >> Salut ! >> >> Le deuxième envoi aurait pu être en français. >> Cela aurait évité le doublon, tout en maintenant le message. >> >> @+ >> >> Michel Claveau >> > > ;-) > > No: > 1) The redundancy is due to the fact that I just moved to another > state/ISP and th

Re: SCF released to GPL

2007-08-27 Thread hg
Méta-MCI (MVP) wrote: > Salut ! > > Le deuxième envoi aurait pu être en français. > Cela aurait évité le doublon, tout en maintenant le message. > > @+ > > Michel Claveau > ;-) No: 1) The redundancy is due to the fact that I just moved to another state/ISP and that ... for some reason, the i

Re: Socket - gaierror

2007-08-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: > 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

XML File -- dictionary edit/search

2007-08-27 Thread -b
I am trying to put together a python program that will be able to ask for a word and its definition, then save that information into an xml file for reference. I am not down right set on the file being in xml format, but xml is the first thing that comes to mind, since I do not want to use a MySQL

Re: some problems with mod_python

2007-08-27 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : > Johan a écrit : > >> 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 thi

Re: some problems with mod_python

2007-08-27 Thread Bruno Desthuilliers
Johan a écrit : > 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 abo

Re: Error with Simplemapi.py

2007-08-27 Thread Mick Duprez
On Aug 27, 4:46 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > 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!:( ). > > G

Re: Socket - gaierror

2007-08-27 Thread half . italian
On Aug 27, 4:22 pm, [EMAIL PROTECTED] (Douglas Wells) wrote: > In article <[EMAIL PROTECTED]>, > > > > [EMAIL PROTECTED] writes: > > On Aug 27, 12:32 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > Changing it to IP gives me the same exact error... > > > File "bin/prgram.py", line 123, in notif

Re: convert non-delimited to delimited

2007-08-27 Thread Paul McGuire
On Aug 27, 12:59 pm, 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: > 0139,725635,9,2000,01,01,00,53

Re: "Try:" which only encompasses head of compound statement

2007-08-27 Thread Ben Finney
[EMAIL PROTECTED] writes: > try: > for line in open(myFileName): > count += openAndProcessSubfile(line) > except IOError: > print "Can't open myfile" > > ... now the 'except' incorrectly catches errors from > openAndProcessSubfile. So don't include it. You've discovered a good pr

Re: Socket - gaierror

2007-08-27 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: > On Aug 27, 12:32 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > Changing it to IP gives me the same exact error... > > File "bin/prgram.py", line 123, in notify > smtp = smtplib.SMTP("XXX.XXX.XXX.XXX") > > File "/usr/lib/python

Re: "Try:" which only encompasses head of compound statement

2007-08-27 Thread Carl Banks
On Aug 27, 5:35 pm, [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

Re: Biased random?

2007-08-27 Thread Robert Kern
Jun-geun Park wrote: > 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

Re: an eval()-like exec()

2007-08-27 Thread Matt McCredie
> 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: Biased random?

2007-08-27 Thread Sebastian Bassi
On 8/27/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > Play with your log to get the range you want Here you can get "true" random numbers (not pseudorandom, they claim to use a quatum generaton (?)) by fetching them from: http://random.irb.hr/ They give you a python class t insert into your code

Re: "Try:" which only encompasses head of compound statement

2007-08-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > 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). No, that's fine. The file object returne

Re: Socket - gaierror

2007-08-27 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > What could cause the shell to be > able to resolve the addresses properly, but not python? > nnsswitch.conf ? How did you test the name resolution in the shell--was it with "host" or "ping"? I would recommend ping, because that would use

Re: Biased random?

2007-08-27 Thread J. Cliff Dyer
I don't know if this is pythonic or not, but try something like this: from math import log from random import randint def: skewedrandom(n): int(log(randrange(1,n), 2)) Play with your log to get the range you want Cheers, Cliff Grant Edwards wrote: On 2007-08-27, Jun-geun Park <[EMAIL PROTE

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 c

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

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. >

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

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

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 h

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(myF

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 l

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 was

"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 += openAndProcessSubfile(lin

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 = su

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 combine

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 e

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

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

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 > > AddHandler python-program .py > PythonHandler test > PythonDebug On > > > In particular my AddHandler directive is different from yours. > If I did understand the

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)

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 > > AllowOverride All > AddHandler mod_python .py > PythonHandler mptest > PythonDebug On > This is the syntax I have working locally: # mod_python AddHandler python-program .py Python

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 i

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

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 a

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

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 ... -- http://mail.python.org/mailman/listinfo

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: 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

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

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 retur

[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 widg

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: > 0139,725635,9,2000,01,01,00,53,4,+42

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,

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. -- http://mail.python.org/mailman/listin

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: > 0139,725635,9,2000,01,01,00,53

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: > 0139,725635,9,2000,01,01,00,53,4,+42050

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-102800

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: > 0139,725635,9,2000,01,01,00,53,4,+42050,-10

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): > #d

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: >

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

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 t

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

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 -- http://mail.python.org/

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

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\pygame>remix.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

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 an

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]]

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: 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

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(r"C:\test.jpg") > > See http://docs.python.org/ref/strings.html r"C:\test.jpg" also "C:\\test.jpg" or 'C:/test.jpg' -- http:

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 we

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(r"C:\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: sm

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 re

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

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", "cred

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

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 a

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 ex

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 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

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

  1   2   >