Re: Request for a change in the csv module.

2007-03-13 Thread Diez B. Roggisch
Paulo da Silva schrieb: > [EMAIL PROTECTED] escreveu: >> On Mar 12, 4:26 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: > ... > >> locale.setlocale(locale.LC_NUMERIC, 'pt_BR.ISO8859-1') >> csv_writer = csv.writer(open("foo.csv","w"), dialect='excel') >> rows = (('testing', 1.23), ('testing', 2.34))

Re: Starting Python... some questions

2007-03-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I started using Python a couple of days ago - here are a few > questions: > > * Doesn't the __main__() method automatically execute when I run my > python program? Which "__main__" method ??? Anyway, the answer is no. Every code at the top-level (which includes imp

Re: Starting Python... some questions

2007-03-13 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Mon, 12 Mar 2007 21:39:11 -0700, jezonthenet wrote: > >> I started using Python a couple of days ago - here are a few >> questions: >> >> * Doesn't the __main__() method automatically execute when I run my >> python program? > > > No. > > >> * Only when I do an

mod_python's mechanism

2007-03-13 Thread memcached
Hello, I'm just curious that does mod_python have the same or similiar mechanism comparing to mod_perl? Thanks! AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. -- http://mail.pyt

Re: Signed zeros: is this a bug?

2007-03-13 Thread Hendrik van Rooyen
"Paddy" <[EMAIL PROTECTED]> wrote > > Hey, I'm still learnin'. Sweet! > contrary to popular belief, the answer to life, the universe, happiness and everything is not 42, but the above. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in a desktop environment

2007-03-13 Thread Bruno Desthuilliers
David Cramer a écrit : > On Mar 12, 9:56 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Diez B. Roggisch a écrit : >> >>> Bruno Desthuilliers wrote: Grant Edwards a écrit : (snip) > Python is _far_ more robust than C++. I wouldn't say so - robustness is a quality of a prog

Re: Program __main__ function

2007-03-13 Thread André Malo
Ben Finney wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > >> Now, when I write unit tests for my program (i.e. a Python module >> designed to be run as a command), it can still be imported safely >> into my unit tests, and all the code gets covered by test cases >> except the three-line stanza

Re: Request for a change in the csv module.

2007-03-13 Thread Szabolcs Nagy
> It would be much better to be able to specify an additional > variabel to the Dialect class and change csv. no it wouldn't this is a locale specific problem so it should be handled there -- http://mail.python.org/mailman/listinfo/python-list

Re: Starting an external, independent process from a script

2007-03-13 Thread Henrik Lied
I've tried os.spawnv and os.spawn, but these give no error and no result. Henrik Lied skreiv: > Hi there! > > I'm trying to create a video uploading service (just to learn). The > system is mostly based on Django, but the question I'm looking an > answer for is more related to Python. > > So, the

RE: Readline()

2007-03-13 Thread Taylor, Stuart
i have a thread class which should read the output from the procedure line by line and finish when the thread is set to kill: class KillableThread(threading.Thread): def __init__(self, name="thread", *args, **kwargs): threading.Thread.__init__(self, *args, **kwargs) self.name

Re: number generator

2007-03-13 Thread Duncan Booth
Dick Moores <[EMAIL PROTECTED]> wrote: > But let's say there is one more constraint--that for each n of the N > positive integers, there must be an equal chance for n to be any of > the integers between 1 and M-N+1, inclusive. Thus for M == 50 and N >== 5, the generated list of 5 should be as l

Re: Starting an external, independent process from a script

2007-03-13 Thread rishi pathak
You can do something like this: pid = os.fork() if pid != 0: os.execl("mencoder variables here and its arguments") else: continue exec will replace the current child process with the given command and as we are doing fork the command will get executed in a child process.You can also use os.s

Re: Starting an external, independent process from a script

2007-03-13 Thread Henrik Lied
Unfortunately, that didn't work either. The output is empty, I don't get a message, and I definitely don't get a converted file. 2007/3/13, rishi pathak <[EMAIL PROTECTED]>: You can do something like this: pid = os.fork() if pid != 0: os.execl("mencoder variables here and its arguments") el

Setting System Date And Time

2007-03-13 Thread Tzury
Is it possible to modify the Systems' Date and Time with python? -- http://mail.python.org/mailman/listinfo/python-list

Re: converting epoch time to string (and vice versa)

2007-03-13 Thread Paul McGuire
On Mar 13, 12:42 am, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a string in this format "DD/MM/YYY" for example: > tdate = "18/01/1990" > and Im trying to convert this to epoch time, can anyone help? > Im also trying to convert that epoch time to the string format > previously. Can anyone

Re: Single string print statements on multiple lines.

2007-03-13 Thread Bruno Desthuilliers
Goldfish a écrit : > http://www.catb.org/~esr/faqs/smart-questions.html > > Don't post homework questions. > Given the way the question was expressed, I don't think this particular rule applies here. Obviously, the OP is not trying to cheat (explicitelt aknowledging it is homework), and has a g

Re: Request for a change in the csv module.

2007-03-13 Thread Paulo da Silva
Diez B. Roggisch escreveu: > Paulo da Silva schrieb: ... >> That works but it is a pain to use. > > Why? I think it's straightforward. That is not the point. The problem is to have things generalized. I have some general purpose tables whose fields format I don't know in advance. Internally the

Re: Python in a desktop environment

2007-03-13 Thread Paul Boddie
On 13 Mar, 04:33, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-03-13, David Cramer <[EMAIL PROTECTED]> wrote: > > > and we already have a lot written in C++. [...] > I think you're nuts to decide that you need C++ before you've > tested a Python implementation, but it's your nickle. :) I'm

Re: converting epoch time to string (and vice versa)

2007-03-13 Thread Paul Boddie
On 13 Mar, 06:52, "Amit Khemka" <[EMAIL PROTECTED]> wrote: > On 3/13/07, Astan Chee <[EMAIL PROTECTED]> wrote: > > > I have a string in this format "DD/MM/YYY" for example: > > tdate = "18/01/1990" > > and Im trying to convert this to epoch time, can anyone help? > > import calendar > t = map(int,t

Re: Request for a change in the csv module.

2007-03-13 Thread Diez B. Roggisch
Paulo da Silva wrote: > Diez B. Roggisch escreveu: >> Paulo da Silva schrieb: > ... > >>> That works but it is a pain to use. >> >> Why? I think it's straightforward. > > That is not the point. The problem is to have things generalized. > I have some general purpose tables whose fields format I

Re: Request for a change in the csv module.

2007-03-13 Thread skip
Paulo> That is not the point. The problem is to have things generalized. Well, perhaps. One of the goals of the csv module was to do things the way Excel does things. Ideally, that would include formatting elements with locale sensitivity. I've been working on a csv module in Python, so I

most complete xml package for Python?

2007-03-13 Thread metaperl
Without even checking them all out, I'm thinking the Amara XML Toolkit must be the most feature-packed. The developers are readily available on IRC for support and they seem to make regular releases. As a meld3 user, I have been using ElementTree under the hood, but was dismayed to find out that y

Re: number generator

2007-03-13 Thread Dick Moores
At 02:52 AM 3/13/2007, Duncan Booth wrote: >Dick Moores <[EMAIL PROTECTED]> wrote: > > > But let's say there is one more constraint--that for each n of the N > > positive integers, there must be an equal chance for n to be any of > > the integers between 1 and M-N+1, inclusive. Thus for M == 50 and

How to capture environment state after running a shell script.

2007-03-13 Thread Gerard Flanagan
Hello, I have a third party shell script which updates multiple environment values, and I want to investigate (and ultimately capture to python) the environment state after the script has run. But running the script as a child process only sets values for that process, which are lost after executi

[EMAIL PROTECTED]

2007-03-13 Thread thatboatguy
[EMAIL PROTECTED] Here spider spider spiderr! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in a desktop environment

2007-03-13 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > > I'm a Python developer, I don't give a rats ass about what > > people say about C#, Python, or c++, they all have their uses. > > My main reasoning for considering C++ as the backend is some > > things (reading memory fo

Re: httplib/socket problems reading 404 Not Found response

2007-03-13 Thread Patrick Altman
> Yes, it's a known problem. See this message with a > self-response:http://mail.python.org/pipermail/python-list/2006-March/375087.html Are there plans to include this fix in the standard Python libraries or must I make the modifications myself (I'm running Python 2.5)? -- http://mail.python.

Re: Python in a desktop environment

2007-03-13 Thread Grant Edwards
On 2007-03-13, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 12 Mar 2007 15:45:30 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> IMO, robustness is also a quality of a language. In language >> like C and C++, it's difficult to write a prog

Re: number generator

2007-03-13 Thread Anton Vredegoor
Dick Moores wrote: > If the added constraint is instead that the probability of generating > a given list of length N be the same as that of generating any other > list of length N, then I believe my function does the job. Of course, > [1,46,1,1,1] and [1,1,46,1,1], as Python lists, are distinc

Re: number generator

2007-03-13 Thread Duncan Booth
Dick Moores <[EMAIL PROTECTED]> wrote: >>On the other hand, making sure that each combination occurs equally >>often (as your example might imply) is doable but still leaves the >>question whether the order of the numbers matters: are [1,46,1,1,1] >>and [1,1,46,1,1] the same or different combinati

Re: most complete xml package for Python?

2007-03-13 Thread Gerard Flanagan
On Mar 13, 1:43 pm, "metaperl" <[EMAIL PROTECTED]> wrote: > Without even checking them all out, I'm thinking the Amara XML Toolkit > must be the most feature-packed. The developers are readily available > on IRC for support and they seem to make regular releases. > > As a meld3 user, I have been us

Re: glob.glob output

2007-03-13 Thread Hitesh
On Mar 12, 4:33 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Hitesh a écrit : > > > import string > > import os > > > f = open ("c:\\servername.txt", 'r') > > linelist = f.read() > > > lineLog = string.split(linelist, '\n') > > lineLog = lineLog [:-1] > > #print lineLog > > for l in lineLog

CD insert/eject detection

2007-03-13 Thread Mark Bryan Yu
Hi, I'm trying to make a Audio CD ripper using python. is there a way (library, module, etc) to detect when a CD was inserted or ejected? -- http://mail.python.org/mailman/listinfo/python-list

Re: glob.glob output

2007-03-13 Thread Bruno Desthuilliers
Hitesh a écrit : > On Mar 12, 4:33 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: >> Hitesh a écrit : >> (snip) > Thank you for your reply. > From the return value I am trying to figure out whether the file > xtRec* exist or not. Yes, I had understood this !-) What I wanted to point out was

i can`t get python working on the command line (linux)

2007-03-13 Thread Mark
Hey, first of all: sorry for the 100% n00b question i`m brand new to python and i seem to start off with the biggest problem of all.. not even getting python to work. i`m running Fedora core 7 test 2 and all the python based applications are working fine (like pirut, pipet, and some other yum rel

Re: Eureka moments in Python

2007-03-13 Thread Brett g Porter
Steven D'Aprano wrote: > I'd be interested in hearing people's stories of Eureka moments in Python, > moments where you suddenly realise that some task which seemed like it > would be hard work was easy with Python. Mine was definitely when I was first working with the xmlrpc module, and I was pu

Re: CD insert/eject detection

2007-03-13 Thread Larry Bates
Mark Bryan Yu wrote: > Hi, > > I'm trying to make a Audio CD ripper using python. > > is there a way (library, module, etc) to detect when a CD was inserted > or ejected? > That is going to be OS dependent, so please share with us what OS you are on? -Larry -- http://mail.python.org/mailman/li

Re: CD insert/eject detection

2007-03-13 Thread Mark Bryan Yu
On Mar 13, 11:07 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Mark Bryan Yu wrote: > > Hi, > > > I'm trying to make a Audio CD ripper using python. > > > is there a way (library, module, etc) to detect when a CD was inserted > > or ejected? > > That is going to be OS dependent, so please share with

Re: number generator

2007-03-13 Thread Dick Moores
At 06:59 AM 3/13/2007, Anton Vredegoor wrote: >Dick Moores wrote: > > > If the added constraint is instead that the probability of generating > > a given list of length N be the same as that of generating any other > > list of length N, then I believe my function does the job. Of course, > > [1,46,

Re: help developing an editor to view openoffice files.

2007-03-13 Thread Ken Starks
krishnakant Mane wrote: > hello, > right now I am involved on doing a very important accessibility work. > as many people may or may not know that I am a visually handicap > person and work a lot on accessibility. the main issue at hand is to > create an accessible editor for open office. > there

Re: Best place for a function?

2007-03-13 Thread Inyeol Lee
On Sun, Mar 11, 2007 at 06:36:02PM +0100, Bruno Desthuilliers wrote: > Inyeol Lee a �crit : > > On Wed, Mar 07, 2007 at 05:27:04PM -0500, Sergio Correia wrote: > > > >>I'm writing a class, where one of the methods is kinda complex. The > >>method uses a function which I know for certain will not b

Re: glob.glob output

2007-03-13 Thread Hitesh
On Mar 13, 11:00 am, Bruno Desthuilliers wrote: > Hitesh a écrit : > > > On Mar 12, 4:33 pm, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > >> Hitesh a écrit : > > (snip) > > Thank you for your reply. > > From the return value I am trying to figure out whether the file > > xtRec* exist or no

Re: number generator

2007-03-13 Thread Anton Vredegoor
Dick Moores wrote: > Paul Rubin's fencepost method is about 14 times faster than mine for > the same M == 8 and N == 4! :( Actually they looked a bit similar after I had mucked a bit with them :-) But indeed it's slow. > Sorry, I don't understand this. Could you spell it out for me by > rewri

RE: i can`t get python working on the command line (linux)

2007-03-13 Thread Sells, Fred
looks like it is expecting command line agrs that are not there. put this at the top of your code to see what's going on import sys print sys.argv remembering that the first element printed is sys.argv[0] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of M

Communicating with a DLL under Linux

2007-03-13 Thread Mikael Olofsson
I am interested in peoples experience with communicating with DLLs under Linux. Situation: I'm an electrical engineer that finds pleasure in using my soldering iron from time to time. I also find programming, preferably in Python, entertaining. I wouldn't call myself a programmer, though. Now,

Re: struct.pack oddity

2007-03-13 Thread Erik Johnson
"Dave Opstad" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is the lack of a struct.error when the byte-order mark is at the start > of the format intentional? This seems like a bug to me, but maybe > there's a subtlety here I'm not seeing. I am by no means any sort of expert

Re: CD insert/eject detection

2007-03-13 Thread Diez B. Roggisch
Mark Bryan Yu wrote: > On Mar 13, 11:07 am, Larry Bates <[EMAIL PROTECTED]> wrote: >> Mark Bryan Yu wrote: >> > Hi, >> >> > I'm trying to make a Audio CD ripper using python. >> >> > is there a way (library, module, etc) to detect when a CD was inserted >> > or ejected? >> >> That is going to be O

Re: Request for a change in the csv module.

2007-03-13 Thread Paulo da Silva
Diez B. Roggisch escreveu: > Paulo da Silva wrote: ... > > That it does convert non-string-values to strings when writing could be seen > as convenience, or actual bug as it might cause troubles as you perceived > them - but the solution would clearly be to get rid of this functionality, > not en

Re: Request for a change in the csv module.

2007-03-13 Thread Paulo da Silva
[EMAIL PROTECTED] escreveu: > Paulo> That is not the point. The problem is to have things generalized. > > Well, perhaps. One of the goals of the csv module was to do things the way > Excel does things. It would be nice because many csv users use it to export files to spreadsheets and Excel

Server-side script takes way too long to launch

2007-03-13 Thread Teresa Hardy
I have a webpage calling a python script, using Apache serverhttp://localhost/cgi-bin/mycode.py?dmn I am using Firefox, WindowsXP Python 2.4 I can count to 13 from the time I click to the time the browser finds the path. The python runs okay when I finally get to it. In the first step it jus

Re: number generator

2007-03-13 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > P(m,n) has no known exact formula but can be computed > inductively rather easily. The partitions for m and n can be ranked in > lexicographic order from 0 to P(m,n)-1. Given a rank r in that range, one > can calculate the particular partition that

Re: Server-side script takes way too long to launch

2007-03-13 Thread Josh Bloom
Teresa, when you call a python script this way, the server needs to load the python interpreter for each call. If you need faster execution you should look into having a server process running already. Something like mod_python for apache or CherryPy will help you speed this up. -Josh On 3/13/

Re: Communicating with a DLL under Linux

2007-03-13 Thread Grant Edwards
On 2007-03-13, Mikael Olofsson <[EMAIL PROTECTED]> wrote: > The gadget costs about 50 Euros. It's not a lot of money, but I would > not like to buy the thing if there is a substancial risk that I will not > be able to make it work on that computer. From what I've read on the > box, it assumes W

Re: Server-side script takes way too long to launch

2007-03-13 Thread Jeff McNeil
But even if the server was loading Python on each hit, which it will for CGI, it shouldn't take "a count to 13", especially on localhost. That to me is an indication of a further problem. Does it take that long to load with each hit, or just the first following a server restart? What do log time

Re: Communicating with a DLL under Linux

2007-03-13 Thread Bart Ogryczak
On Mar 13, 5:59 pm, Mikael Olofsson <[EMAIL PROTECTED]> wrote: > If the vendor claims that the DLL is for Windows, is it > reasonable to assume that it can be made to work under Linux, from > Python, that is? No. It's reasonable to assume, that there is no *easy* way to get Win32's DLL working und

Re: Eureka moments in Python

2007-03-13 Thread Dustan
On Mar 13, 10:05 am, Brett g Porter <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > I'd be interested in hearing people's stories of Eureka moments in Python, > > moments where you suddenly realise that some task which seemed like it > > would be hard work was easy with Python. > > Mine was

Re: Eureka moments in Python

2007-03-13 Thread [EMAIL PROTECTED]
On Mar 13, 2:16 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I'd be interested in hearing people's stories of Eureka moments in Python, > moments where you suddenly realise that some task which seemed like it > would be hard work was easy with Python. > ##I have this problem where, given a

Re: Communicating with a DLL under Linux

2007-03-13 Thread jkn
Hi Mikael It is probably worth you finding out more about the specific Hardware that Velleman use for this kit. Depending on the chip manufacturer, there may be more or less support already available. For instance, I have recently been communicating with the FTDI USB chips under windows. There

Re: struct.pack oddity

2007-03-13 Thread Larry Bates
Erik Johnson wrote: > "Dave Opstad" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Is the lack of a struct.error when the byte-order mark is at the start >> of the format intentional? This seems like a bug to me, but maybe >> there's a subtlety here I'm not seeing. > > I am b

Iterating across a filtered list

2007-03-13 Thread Drew
All - I'm currently writing a toy program as I learn python that acts as a simple address book. I've run across a situation in my search function where I want to iterate across a filtered list. My code is working just fine, but I'm wondering if this is the most "elegant" way to do this. Essentiall

Re: number generator

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 03:20:49 -0300, Hendrik van Rooyen <[EMAIL PROTECTED]> escribió: > Is it possible to devise a test that can distinguish between sets > of: > > - five random numbers that add to 50, and > - four random numbers and a fudge number that add to 50? > > My stats are way too small a

Tools for GUI/graphics

2007-03-13 Thread Paulo da Silva
I need to make some data representation. Basically a major window for a 2D chart, a scrollable window with some few small 2D graphics. The rest is a normal form with buttons, labels and entries. I thought of doing that using Tkinter+pmw+blt. But now I'm considering use a web solution. Is there any

Re: CD insert/eject detection

2007-03-13 Thread [EMAIL PROTECTED]
I've never used it myself, but pygame (based on SDL - so it should work for MS Windows, Linux, and Apple OSX) has a CD module with some potentially useful functions, CD.eject() and CD.get_empty(). http://www.pygame.org/docs/ref/cdrom.html#pygame.cdrom.CD -sjbrown On Mar 13, 7:54 am, "Mark Bryan

Re: Iterating across a filtered list

2007-03-13 Thread Paul Rubin
"Drew" <[EMAIL PROTECTED]> writes: > I'm currently writing a toy program as I learn python that acts as a > simple address book. I've run across a situation in my search function > where I want to iterate across a filtered list. My code is working > just fine, but I'm wondering if this is the most

Setting Up SOAPpy for Python v2.5 on Windows?

2007-03-13 Thread Steve
Hi All, What are the required version of the SOAPpy, PyXML, fpconst that are needed to run under the Python 2.5 environment on Windows? Locations for the downloads? Thanks! Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating across a filtered list

2007-03-13 Thread Drew
On Mar 13, 2:42 pm, Paul Rubin wrote: > If I can decipher your Ruby example (I don't know Ruby), I think you > want: > >for name,contact in contacts.iteritems(): > if re.search('search', name): > print contact > > If you just want to filter the diction

Re: How to capture environment state after running a shell script.

2007-03-13 Thread attn . steven . kuo
On Mar 13, 5:57 am, "Gerard Flanagan" <[EMAIL PROTECTED]> wrote: > Hello, > > I have a third party shell script which updates multiple environment > values, and I want to investigate (and ultimately capture to python) > the environment state after the script has run. But running the script > as a c

Re: Tools for GUI/graphics

2007-03-13 Thread Larry Bates
Paulo da Silva wrote: > I need to make some data representation. > Basically a major window for a 2D chart, > a scrollable window with some few small 2D > graphics. The rest is a normal form with > buttons, labels and entries. > > I thought of doing that using Tkinter+pmw+blt. > But now I'm consid

Re: Starting an external, independent process from a script

2007-03-13 Thread Gabriel Genellina
On 12 Mar 2007 16:13:51 -0700, Henrik Lied <[EMAIL PROTECTED]> wrote: >> I'm trying to create a video uploading service (just to learn). The >> system is mostly based on Django, but the question I'm looking an >> answer for is more related to Python. En Tue, 13 Mar 2007 06:57:33 -0300, rishi path

Re: Iterating across a filtered list

2007-03-13 Thread Arnaud Delobelle
On Mar 13, 6:04 pm, "Drew" <[EMAIL PROTECTED]> wrote: > All - Hi! [snip] > http://pastie.caboo.se/46647 There is no need for such a convoluted list comprehension as you iterate over it immediately! It is clearer to put the filtering logic in the for loop. Moreover you recalculate the regexp for

Re: Iterating across a filtered list

2007-03-13 Thread Paul Rubin
"Drew" <[EMAIL PROTECTED]> writes: > You're exactly on the mark. I guess I was just wondering if your first > example (that is, breaking the if statement away from the iteration) > was preferred rather than initially filtering and then iterating. I think the multiple statement version is more in P

Re: Iterating across a filtered list

2007-03-13 Thread Paul Rubin
"Arnaud Delobelle" <[EMAIL PROTECTED]> writes: > in the for loop. Moreover you recalculate the regexp for each element > of the list. The re library caches the compiled regexp, I think. -- http://mail.python.org/mailman/listinfo/python-list

Re: help developing an editor to view openoffice files.

2007-03-13 Thread Colin J. Williams
Ken Starks wrote: > krishnakant Mane wrote: >> hello, >> right now I am involved on doing a very important accessibility work. >> as many people may or may not know that I am a visually handicap >> person and work a lot on accessibility. the main issue at hand is to >> create an accessible editor

Re: Setting Up SOAPpy for Python v2.5 on Windows?

2007-03-13 Thread Steven Bethard
Steve wrote: > What are the required version of the SOAPpy, PyXML, fpconst that are > needed to run under the Python 2.5 environment on Windows? If you're not married to SOAPpy, you can use elementsoap which has just a single download and works with ElementTree from the 2.5 stdlib: http://e

ANN: ActivePython 2.5.0.0 is now available

2007-03-13 Thread Trent Mick
I'm happy to announce that ActivePython 2.5.0.0 is now available for download from: http://www.activestate.com/products/activepython/ This is the first release of ActivePython for Python version 2.5. Apologies for the long delay between core Python 2.5 and this release. The good news is that

Re: Communicating with a DLL under Linux

2007-03-13 Thread John Nagle
Mikael Olofsson wrote: > I am interested in peoples experience with communicating with DLLs under > Linux. > > Situation: > > I'm an electrical engineer that finds pleasure in using my soldering > iron from time to time. I also find programming, preferably in Python, > entertaining. I wouldn't

Re: Single string print statements on multiple lines.

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 08:31:17 -0300, Bruno Desthuilliers <[EMAIL PROTECTED]> escribió: > Obviously, the OP is not trying to cheat (explicitelt > aknowledging it is homework), and has a good enough understanding of > what the usual solution is (asking for the escape char in Python). > > Now of cou

Re: struct.pack oddity

2007-03-13 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: > 1) You can't put 10 into a half-word. The limit is 2**16 > or 65535. On Python 2.5 I get: Yes, I know. I used that example to illustrate the problem. If a value does not fit a format then Python should report that con

Re: httplib/socket problems reading 404 Not Found response

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 10:38:24 -0300, Patrick Altman <[EMAIL PROTECTED]> escribió: >> Yes, it's a known problem. See this message with a >> self-response:http://mail.python.org/pipermail/python-list/2006-March/375087.html > Are there plans to include this fix in the standard Python libraries >

Getting a service's banner by connect to a port

2007-03-13 Thread mmcgee00
Hi, Currently, I am trying to get different service banner by connecting to different ports using python (code below). The versions I am working with are python 4.2.1 and fedora core 4. I am trying to reproduce a very small piece of nmap, since nmap has to get a port's banner in order to figure

Re: Iterating across a filtered list

2007-03-13 Thread Bruno Desthuilliers
Paul Rubin a écrit : > "Drew" <[EMAIL PROTECTED]> writes: > >>You're exactly on the mark. I guess I was just wondering if your first >>example (that is, breaking the if statement away from the iteration) >>was preferred rather than initially filtering and then iterating. > > > I think the multip

Re: Iterating across a filtered list

2007-03-13 Thread Arnaud Delobelle
On Mar 13, 7:36 pm, Paul Rubin wrote: > "Arnaud Delobelle" <[EMAIL PROTECTED]> writes: > > in the for loop. Moreover you recalculate the regexp for each element > > of the list. > > The re library caches the compiled regexp, I think. That would surprise me. How can re.s

Re: struct.pack oddity

2007-03-13 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, "Erik Johnson" <[EMAIL PROTECTED]> wrote: > Barring anyone else disagreeing with classifying it as a bug, I would > suggest reporting it. Proper procedure for reporting a bug appears to be > covered in section B of the Python Library Reference: > http://docs.py

Re: ActivePython 2.5.0.0 is now available

2007-03-13 Thread Bror Johansson
"Trent Mick" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > I'm happy to announce that ActivePython 2.5.0.0 is now available for > download > from: > http://www.activestate.com/products/activepython/ > > This is the first release of ActivePython for Python version 2.5. > A

Re: Need help with a string plz! (newbie)

2007-03-13 Thread Bruno Desthuilliers
Grant Edwards a écrit : (snip) > I don't know if emacs still includes Zippy quotes > (of if they've been updated), but you used to be able to do > "esc-X yow" and emacs would show you a random Zippy quote. > It's still there. -- http://mail.python.org/mailman/listinfo/python-list

Calling cpp from python/SWIG

2007-03-13 Thread Frank
Hi, I have the following problem: I want to parse an array M1 from python to a cpp function fct which returns an array M2. How can I do this best? Is SWIG appropriate or is there something else? If someone could give some code example or a link to a page with examples, that would be great! Tha

Re: Iterating across a filtered list

2007-03-13 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > I don't know if I qualify as a Python traditionalist, but I'm using > Python since the 1.5.2 days, and I usually favor list comps or > generator expressions over old-style loops when it comes to this kind > of operations. I like genexps when they'r

Re: Iterating across a filtered list

2007-03-13 Thread Arnaud Delobelle
On Mar 13, 8:53 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Paul Rubin a écrit : [snip] > > Iterators like that are a new Python feature > > List comps are not that new (2.0 or 2.1 ?): > print "\n".join([contact for name, contact in contacts.items() \ > if search.match

Re: ActivePython 2.5.0.0 is now available

2007-03-13 Thread Trent Mick
Bror Johansson wrote: > I did notice the download earlier today and I have installed it on five > Windows-machines (two WinXPPro and three Win2K) and have found one > consistent error. > > Whenever I try Help->Python Manuals from PythonWin I get this errormessage: > > "Internal error in hel

Re: Starting Python... some questions

2007-03-13 Thread jezzzz .
All, thank you for your responses. I learned much and made some modifications in my small program. Currently I am attempting to put together a packet that contains a Python message (created using struct.pack) and a Scapy message (Ether()). Having a packet with combined payload from Python and S

help!! *extra* tricky web page to extract data from...

2007-03-13 Thread [EMAIL PROTECTED]
How extract the visible numerical data from this Microsoft financial web site? http://tinyurl.com/yw2w4h If you simply download the HTML file you'll see the data is *not* embedded in it but loaded from some other file. Surely if I can see the data in my browser I can grab it somehow right in a P

Re: Iterating across a filtered list

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 15:04:50 -0300, Drew <[EMAIL PROTECTED]> escribió: > I'm currently writing a toy program as I learn python that acts as a > simple address book. I've run across a situation in my search function > where I want to iterate across a filtered list. My code is working > just fine, b

Re: ANN: ActivePython 2.5.0.0 is now available

2007-03-13 Thread Wensui Liu
Is it free of charge? On 3/13/07, Trent Mick <[EMAIL PROTECTED]> wrote: > I'm happy to announce that ActivePython 2.5.0.0 is now available for download > from: > http://www.activestate.com/products/activepython/ > > This is the first release of ActivePython for Python version 2.5. Apologies >

Re: Iterating across a filtered list

2007-03-13 Thread Arnaud Delobelle
On Mar 13, 8:59 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: [snip] > def find(self, search): > search_re = re.compile(search, re.IGNORECASE) > for result in [self.contacts[name] for name in self.contacts if > search_re.match(name)]: > print result I do not see how for

Re: Iterating across a filtered list

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 17:19:53 -0300, Arnaud Delobelle <[EMAIL PROTECTED]> escribió: > On Mar 13, 7:36 pm, Paul Rubin wrote: >> >> The re library caches the compiled regexp, I think. > > That would surprise me. > How can re.search know that string.lower(search) is the sa

Re: ANN: ActivePython 2.5.0.0 is now available

2007-03-13 Thread Trent Mick
Yes. Wensui Liu wrote: > Is it free of charge? > > On 3/13/07, Trent Mick <[EMAIL PROTECTED]> wrote: >>... >> ActivePython is ActiveState's binary distribution of Python. Builds for >> Windows, Mac OS X, Linux, HP-UX and AIX are made freely available. >>... -- http://mail.python.org/mailman/lis

Re: help!! *extra* tricky web page to extract data from...

2007-03-13 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > How extract the visible numerical data from this Microsoft financial > web site? > > http://tinyurl.com/yw2w4h > > If you simply download the HTML file you'll see the data is *not* > embedded in it but loaded from some other file. > > Surely if I can see the data in

Re: help!! *extra* tricky web page to extract data from...

2007-03-13 Thread Max Erickson
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > How extract the visible numerical data from this Microsoft > financial web site? > > http://tinyurl.com/yw2w4h > > If you simply download the HTML file you'll see the data is *not* > embedded in it but loaded from some other file. > > Surely if I

Re: using python to visit web sites and print the web sites image to files

2007-03-13 Thread [EMAIL PROTECTED]
> The reason I want to do simulation but not just crawling is : we have > to check many web pages' front page to see whether it conform to our > visual standard, e.g, it should put a search box on the top part of > the page. It's tedious for human work. So I want to 'crawl and save > the visual pre

Re: Iterating across a filtered list

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 18:16:32 -0300, Arnaud Delobelle <[EMAIL PROTECTED]> escribió: > On Mar 13, 8:59 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > [snip] >> def find(self, search): >> search_re = re.compile(search, re.IGNORECASE) >> for result in [self.contacts[name] for name

  1   2   >