Updated Cygwin Package: python-2.5-1

2007-03-13 Thread Jason Tishler
New News: === I have updated the version of Python to 2.5-1. The tarballs should be available on a Cygwin mirror near you shortly. The following is the only notable change since the previous release: o upgrade to Python 2.5 Old News: === Python is an interpreted, interactive,

Re: Starting Python... some questions

2007-03-13 Thread Tim Roberts
You only need three things here: [EMAIL PROTECTED] wrote: #!/usr/bin/python import scapy import struct class lldp_class: def __init__(self): self.chassis_id_tlv = None def chassis_id(subtype, chassis_info): Make that def chassis_id(self, subtype,

Re: Starting Python... some questions

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 03:13:37 -0300, je . [EMAIL PROTECTED] escribió: I added the self parameter to the the chassis_id function, however I now have a problem and question regarding encoding MAC addresses for a struct. What string format am I supposed to use? py data = [int(x,16) for

help developing an editor to view openoffice files.

2007-03-13 Thread krishnakant Mane
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 are a lot of things remaining on

Re: Calling cpp from python/SWIG

2007-03-13 Thread Gabriel Genellina
En Tue, 13 Mar 2007 03:33:43 -0300, Frank [EMAIL PROTECTED] escribió: 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 you're going to call a single function, declare it with

Eureka moments in Python

2007-03-13 Thread Steven D'Aprano
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 had a recent one, where I had spent some time creating a function which took a list as an argument, and then

Re: number generator

2007-03-13 Thread Hendrik van Rooyen
Nick Craig-Wood [EMAIL PROTECTED] wrote: Paul Rubin http wrote: The fencepost method still seems to be simplest: t = sorted(random.sample(xrange(1,50), 4)) print [(j-i) for i,j in zip([0]+t, t+[50])] Mmm, nice. Here is another effort which is easier to reason about the

Re: Python in a desktop environment

2007-03-13 Thread krishnakant Mane
I have coded some complex programs in python in the recent past. I find it very robust and also not very slow (as is depicted by the starter of this thread ) I use wxpython on the gui side and testify that it is indeed very suitable for huge gui apps. may be pyqt is good enough too and I believe

Re: number generator

2007-03-13 Thread Dick Moores
At 06:38 AM 3/10/2007, Steven D'Aprano wrote: On Sat, 10 Mar 2007 02:32:21 -0800, Dick Moores wrote: So why not just repeatedly call a function to generate lists of length N of random integers within the appropriate range (the closed interval [1,M-N-1]), and return the first list the sum of

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

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

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 import of my

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

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 bruno. [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 program, not of a

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

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 user

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 likely

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

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

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

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 good

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,tdate.split('/'))

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 don't know

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

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 N == 5,

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

[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 for example)

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

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

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

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

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 using

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: path1 = +

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

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

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

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

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 us what OS

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

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

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

Re: glob.glob output

2007-03-13 Thread Hitesh
On Mar 13, 11:00 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] 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

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

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

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.

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 on

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 OS dependent, so please

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 enhance

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 is

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

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 has

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

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

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

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 under

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 list

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 by no means

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.

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

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

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 elegant

Re: Iterating across a filtered list

2007-03-13 Thread Drew
On Mar 13, 2:42 pm, Paul Rubin http://[EMAIL PROTECTED] 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 dictionary

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 child

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 considering

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 pathak

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 each

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 Python

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

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:

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 call

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 course

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

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

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

Re: Iterating across a filtered list

2007-03-13 Thread Arnaud Delobelle
On Mar 13, 7:36 pm, Paul Rubin http://[EMAIL PROTECTED] 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.search know

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:

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

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!

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

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(name)])

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

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

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

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

  1   2   >