Re: Display directory pyqt4 and Python

2009-04-02 Thread Diez B. Roggisch
Dunwitch schrieb: I've looked around for the answer and have decided to ask an expert for the solution. Whats suppose to happen is a user pushes a button and displays the directory content in the text edit window on the gui. Everything works, apart from the fact that it only shows the last file i

Re: python for loop

2009-04-02 Thread Hrvoje Niksic
Carl Banks writes: > This is unforgiveable, not only changing the indexing semantics of > Python (because a user would have NO CLUE that something underlying > has been changed, and thus it should never be done), but also for > the needless abuse of exec. Then I guess you'd fire Guido, too -- fr

Re: python for loop

2009-04-02 Thread Arnaud Delobelle
Carl Banks wrote: > On Apr 1, 2:32 pm, Arnaud Delobelle wrote: Check the date on the line above (and the PS in that post). > > If I were your boss and you ever pulled something like this, your ass > would be so fired. > > This is unforgiveable, not only changing the indexing semantics of > Pyth

Re: Converting a PIL image object to a buffer

2009-04-02 Thread Diez B. Roggisch
Simon Hibbs schrieb: On 1 Apr, 21:43, Gary Herron wrote: Simon Hibbs wrote: I'm trying to dump a snapshot of my application window to the clipboard. I can use ImageGrab in PIL to get the screen data into a PIL image object, which i have converted to a bitmap using ImageWin, but when I try to p

Re: How to get the version of a file on WinOS?

2009-04-02 Thread Hill
On 3月26日, 下午4时27分, Tim Golden wrote: > Hill wrote: > > As you know , we can see the file version from by "right click menu > > and click the detail tab". > > Now i am wondering how to get this version number using python? > > Thanks very much! > > If you're talking about a .DLL then this is probab

Re: Help for Toplevel

2009-04-02 Thread Eric Brunel
Muddy Coder wrote: > Hi Folks, > > I have a problem of handling Toplevel window. Basically, I wrote a > listbox viewer with scrollbars, and saved in file listbo.py. Then in > my main GUI window, with menu, I need to launch the listbox viewer, in > a new window. Obviously, a Toplevel window is neede

Python3: to add, remove and change

2009-04-02 Thread bearophileHUGS
Here an informal list in random order of things that I may like to add or to remove to/from Python3.x+. The things I list here don't come from fifty hours of thinking of mine, and they may be often wrong. But I use Python2.x often enough, so such things aren't totally random either. To remove: ma

Re: Sending SMS using python script

2009-04-02 Thread Matteo
I use a programme, written in Python, which sends sms through the sms providers. You might want to have a look to the source code: http://www.moioli.net/Progetti___1/MoioSMS___Messaggi_GRATIS_da_Internet22.html -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pass one HTML values to another HTML

2009-04-02 Thread Gabriel Genellina
En Tue, 31 Mar 2009 08:27:18 -0300, Kalyan escribió: by using python and google app engine how can i pass one HTML values to another HTML .. i am very new to Python programing Example : in one HTML i entered Name and Address fields and i submit the page at that time i want to see thos

Re: Hands on Python - Problem with Local Cgi Server

2009-04-02 Thread Gabriel Genellina
En Tue, 31 Mar 2009 09:56:48 -0300, Gary Wood escribió: I have the DOS box with the message Localhost CGI server started But when i try this I get the Windows Error Failed to Connect The connection was refused when attempting to contact localhost:8080. Try a different port instead of 8080

Re: pygame and socket.recv

2009-04-02 Thread Hendrik van Rooyen
"Aaron Brady" wrote: > Hi, > > I tried writing a small game on a pygame layer. The graphics are > fine, and at the moment, it is not graphics intensive. It is multi- > player, and for the communication, I am sending a pickle string across > a LAN, once per frame. How big is this pickle - i.

Re: Help for Toplevel

2009-04-02 Thread Gabriel Genellina
En Wed, 01 Apr 2009 21:55:52 -0300, Muddy Coder escribió: I have a problem of handling Toplevel window. Basically, I wrote a listbox viewer with scrollbars, and saved in file listbo.py. Then in my main GUI window, with menu, I need to launch the listbox viewer, in a new window. Obviously, a T

Re: python for loop

2009-04-02 Thread Carl Banks
On Apr 1, 11:28 pm, Hrvoje Niksic wrote: > Carl Banks writes: > > This is unforgiveable, not only changing the indexing semantics of > > Python (because a user would have NO CLUE that something underlying > > has been changed, and thus it should never be done), but also for > > the needless abuse

Re: python for loop

2009-04-02 Thread John O'Hagan
On Thu, 2 Apr 2009, Steven D'Aprano wrote: > On Thu, 02 Apr 2009 04:23:32 +, John O'Hagan wrote: > > Beyond being part of a conventionally-ordered set of keys, what can an > > ordinality of zero actually mean? (That's a sincere question.) > [snip erudite definition of cardinality] > For non-i

Re: how to optimize zipimport

2009-04-02 Thread Gabriel Genellina
En Mon, 30 Mar 2009 09:39:20 -0300, Coonay escribió: On Mar 26, 1:38 pm, John Machin wrote: Why are you explicitly using the zipimport module? In other words, why don't you put the full path of the zip file in sys.path and then just use the normal "import module_in_the_zip" mechanism? Note t

Re: Display directory pyqt4 and Python

2009-04-02 Thread Dunwitch
On Apr 2, 3:02 am, "Diez B. Roggisch" wrote: > Dunwitch schrieb: > > > > > I've looked around for the answer and have decided to ask an expert > > for the solution. Whats suppose to happen is a user pushes a button > > and displays the directory content in the text edit window on the gui. > > Ever

Re: python for loop

2009-04-02 Thread Arnaud Delobelle
Steven D'Aprano wrote: > In set theory, you start by defining the integers like this: > > 0 is the cardinality (size) of the empty set, the set with nothing in it. > > 1 is the cardinality of the set of empty sets, that is, the set > containing nothing but the empty set. > > 2 is the cardinality o

Re: New super python vm

2009-04-02 Thread locoyfeo
> Sounds good, but do you have binaries yet? because i can't compile > from source distros. Binaries?? Hmm... ok, I filed a bug. -- http://mail.python.org/mailman/listinfo/python-list

Re: A design problem I met again and again.

2009-04-02 Thread Martin P. Hellwig
Steven D'Aprano wrote: If you have too much code in one file, it will upset the balance of the spinning hard drive platter, and it will start to wobble and maybe even cause a head-crash. That is why proper designed operating systems, like windows 95,rarely write one continuous block but spre

Re: py2exe fails to make valid exe

2009-04-02 Thread Gabriel Genellina
En Wed, 01 Apr 2009 01:30:39 -0300, prakash jp escribió: On --> python setup.py py2exe the dist folder is created but the exe creted is not working it throws an error "pythons ps.popen function" Please copy & paste the actual error message and the stack trace. setup.py: #python setup.py

Re: py2exe problem

2009-04-02 Thread Gabriel Genellina
En Wed, 01 Apr 2009 17:51:52 -0300, Wolfgang Forstmeier escribió: what kind of error do I have with getting this error at starting my app. Im am not using IdleConf.GetOption right now. Warning: configHandler.py - IdleConf.GetOption - problem retrieving configration option 'name' from s

Re: modifying a list element from a function

2009-04-02 Thread Gabriel Genellina
En Mon, 30 Mar 2009 13:19:57 -0300, TP escribió: Adrian Dziubek wrote: Could you explain your high level goal for this? It looks like a very wicked way of doing things. Have You tried to read the list methods' documentation? Maybe there you find something you need (like list.index)? I have

Re: pygame and socket.recv

2009-04-02 Thread Tim Wintle
On Wed, 2009-04-01 at 18:45 -0700, Aaron Brady wrote: > > My game loop looks like this: > > poll events, get 1 at most > send to server > wait for server reply > render entire frame The look I'm suggesting is: poll events write to (non-blocking) socket render frame check non-blocking socket and

Re: python for loop

2009-04-02 Thread Gabriel Genellina
En Wed, 01 Apr 2009 08:04:12 -0300, andrew cooke escribió: something i don't think has been mentioned much - if you're using "range()" in your python code then you're almost always doing it wrong. i just grepped lepl and i use range 20 times in 9600 lines of code. out of those, all but 3 ar

Re: A design problem I met again and again.

2009-04-02 Thread Tim Rowe
2009/4/1 一首诗 : > Hi all, > > I am a programmer who works with some different kinds of programming > languages, like python, C++(in COM), action script, C#, etc. > > Today, I realized that, what ever language I use, I always meet a same > problem and I think I never solve it very well. > > The probl

Re: how to optimize zipimport

2009-04-02 Thread John Machin
On Mar 30, 11:39 pm, Coonay wrote: > On Mar 26, 1:38 pm, John Machin wrote: > > > On Mar 26, 2:06 pm, Coonay wrote: > > > > On Mar 26, 10:41 am, Coonay wrote: > > > > > in my mudule ,i import another mudule from a zip , > > > > > when i call  my mudle method,the module in the zip will be impor

Re: Sending SMS using python script

2009-04-02 Thread Banibrata Dutta
Hi Guptha: Most SMS providers (you'd be dealing with resellers mostly) have some kind of HTTP API to send SMS (even bulk SMS, upto a point). So you using standard Python HTTP module to invoke the SMS provider API. For SMS service providers, just google thru or search yellow pages in your region of

Re: py2exe problem

2009-04-02 Thread Wolfgang Forstmeier
On 02.04.2009 11:34, Gabriel Genellina wrote: En Wed, 01 Apr 2009 17:51:52 -0300, Wolfgang Forstmeier escribió: what kind of error do I have with getting this error at starting my app. Im am not using IdleConf.GetOption right now. Warning: configHandler.py - IdleConf.GetOption - problem retri

Re: Sending SMS using python script

2009-04-02 Thread guptha
On Apr 2, 12:41 pm, Matteo wrote: > I use a programme, written in Python, which sends sms through the sms > providers. You might want to have a look to the source code: > > http://www.moioli.net/Progetti___1/MoioSMS___Messaggi_GRATIS_da_Inter... Thanks for your reply Matteo It will be more helpfu

Low level hard drive reading

2009-04-02 Thread Gabriel
Hello, I have to write linux application that will analyze disk/partition (ext3 filesystem) on really low level. It has to find/analyze files on the disk by reading disk blocks to analyze file's headers to find out file type and then blocks related to file to get file content. The second par

Re: A design problem I met again and again.

2009-04-02 Thread andrew cooke
Lawrence D'Oliveiro wrote: >> What are the average size of source files in your project? If it's >> far lower than 15,000, don't feel it's a little unbalance? > > Why? one reason is that it becomes inefficient to find code. if you structure code as a set of nested packages, then a module, and

Re: speech recognition help

2009-04-02 Thread Murali kumar
hi all.. I tried following tools by ur advice.. 1. cmu sphinx: tried and managed run the demo programs.. but the accuracy is so bad. for that i tried for how to train the grammer. but for that i had no guidance.. docs give me the headache.. after 2 weeks.. i concluded that it will

Re: Python Goes Mercurial

2009-04-02 Thread Paul Boddie
On 2 Apr, 04:27, Lawrence D'Oliveiro wrote: > In message <7a1dd0d8-1978-470b- > > [email protected]>, Paul Boddie wrote: > > And I've heard stories of "bait and > > switch" with Git: "you can do XYZ with Git but not with ..." followed > > by the discovery that you can'

Re: Low level hard drive reading

2009-04-02 Thread Jeremiah Dodds
On Thu, Apr 2, 2009 at 12:36 PM, Gabriel wrote: > Hello, > I have to write linux application that will analyze disk/partition (ext3 > filesystem) on really low level. It has to find/analyze files on the disk by > reading disk blocks to analyze file's headers to find out file type and > then bloc

Re: Python Goes Mercurial

2009-04-02 Thread Jeremiah Dodds
The one thing that makes me want to use git more than any other dvcs is that you don't have to create a new directory for branches. This may be possible in other dvcs's , but git is the only one I've seen advertise the capability. -- http://mail.python.org/mailman/listinfo/python-list

python installer

2009-04-02 Thread Murali kumar
hi all.. To distribute my application.. what will be the best..? python installer.. or py2exe..? using : python 2.6 , wxpython 2.8.9 -- http://mail.python.org/mailman/listinfo/python-list

simple iterator question

2009-04-02 Thread Neal Becker
How do I interleave 2 sequences into a single sequence? How do I interleave N sequences into a single sequence? -- http://mail.python.org/mailman/listinfo/python-list

Incomplete exception tracebacks when importing from zipped modules

2009-04-02 Thread [email protected]
I can't seem to get complete tracebacks when modules imported from zip archives raise exceptions. For instance, consider the following module: def i_raise(): raise Exception("Test!") i_raise() When I import this module, within a .zip, from a script, I get the following traceback: Traceback (

Re: xml to xhtml

2009-04-02 Thread jud779
On Apr 1, 11:16 am, Joe Riopel wrote: > On Wed, Apr 1, 2009 at 10:43 AM,   wrote: > > If anyone can give me some guidance what should be the best way to > > generate html/xhtml page using python would be great. I am open to > > other options like xsl or anything else that can make things simple. >

Re: Python Goes Mercurial

2009-04-02 Thread David Cournapeau
On Thu, Apr 2, 2009 at 9:12 PM, Paul Boddie wrote: > > "You can do it, but as soon as you go to merge with another repo that > had the unedited commit history, you’ll bump into weirdness (and > probably invalidate your whole reason for rebasing, which was to clean > up the history)." > >  - http:

Any library to bind python with Yahoo mail service

2009-04-02 Thread guptha
Hi friends, I came across libgmail library that can be used to bind python with Google Gmail's service .Likewise is there any library available to access the service of Yahoo mail from python code . I like to send sms from my application via Yahoo mail Service . Thanks -- http://mail.python.org/m

Re: Python Goes Mercurial

2009-04-02 Thread Kay Schluehr
On 1 Apr., 07:56, Lawrence D'Oliveiro wrote: > In message <35d429fa-5d13-4703- > > [email protected]>, John Yeung wrote: > > Here's one that clearly expresses strong antipathy: > > > http://mail.python.org/pipermail/python-dev/2009-March/087971.html > > There are lots

Re: simple iterator question

2009-04-02 Thread George Sakkis
On Apr 2, 8:32 am, Neal Becker wrote: > How do I interleave 2 sequences into a single sequence? > > How do I interleave N sequences into a single sequence? http://lmgtfy.com/?q=python+interleave+sequences http://code.activestate.com/recipes/511480/ http://code.activestate.com/recipes/528936/ HT

Re: simple iterator question

2009-04-02 Thread andrew cooke
Neal Becker wrote: > How do I interleave 2 sequences into a single sequence? > > How do I interleave N sequences into a single sequence? don't know if there's a better way, but from itertools import izip def interleave(*doodahs): for together in izip(*doodahs): for single in together:

Re: Python Goes Mercurial

2009-04-02 Thread David Smith
Kay Schluehr wrote: > On 1 Apr., 07:56, Lawrence D'Oliveiro central.gen.new_zealand> wrote: >> In message <35d429fa-5d13-4703- >> >> [email protected]>, John Yeung wrote: >>> Here's one that clearly expresses strong antipathy: >>> http://mail.python.org/pipermail/pytho

Re: pygame and socket.recv

2009-04-02 Thread Aaron Brady
On Apr 2, 1:19 am, "Hendrik van Rooyen" wrote: > "Aaron Brady"  wrote: > > > Hi, > > > I tried writing a small game on a pygame layer.  The graphics are > > fine, and at the moment, it is not graphics intensive.  It is multi- > > player, and for the communication, I am sending a pickle string acr

Class methods read-only by default?

2009-04-02 Thread Emanuele D'Arrigo
Hi Everybody! I just tried this: >>> class C(object): ...def method(self): ...pass ... >>> c = C() >>> delattr(c, "method") Traceback (most recent call last): File "", line 1, in AttributeError: 'C' object attribute 'method' is read-only How come? Who told the class to make the m

Re: Sending SMS using python script

2009-04-02 Thread Matteo
I don't really know, because I didn't write it myself ;) I think it basically logs in into a service provider site with pycurl, follows the right links, reads captcha's and writes an SMS, which is then sent by the provider itself. I can give you the direct link to the source code from the same sit

Re: simple iterator question

2009-04-02 Thread KDr2
>>> def xl(a): ... return list(reduce(lambda x,y:x+y,zip(*a))) ... >>> xl([[1,2],[3,4]]) [1, 3, 2, 4] like this? Best Regards, -- KDr2, at x-macro.com. On Thu, Apr 2, 2009 at 8:32 PM, Neal Becker wrote: > How do I interleave 2 sequences into a single sequence? > > How do I interleave N

Re: simple iterator question

2009-04-02 Thread John O'Hagan
On Thu, 2 Apr 2009, Neal Becker wrote: > How do I interleave 2 sequences into a single sequence? > > How do I interleave N sequences into a single sequence? Here's one way: def interleave(*args): for n in range(min(len(i) for i in args)) : for i in args: yield i[n] HTH,

Python Client for Second Life

2009-04-02 Thread Lawson English
hey all, a reminder for anyone interested in the python second life client, pyogp, we have our own irc channel on freenode called pyogp, and our own in-world discussion group, also called pyogp. Lawson (Saijanai in Second Life) ___ mmox mailing list m

Python wrapper for Ebay

2009-04-02 Thread nagraj
Hi Can anyone suggest me which is the best python wrapper for Ebay APIs? I've currently gone thru PyEbay and EasyBay. But have not seen much activities on them since couple of years. Also I'm not able to find any particular forums or discussion groups. I could find PyAWS for Amazon which is really

Re: Class methods read-only by default?

2009-04-02 Thread andrew cooke
Emanuele D'Arrigo wrote: > Hi Everybody! > > I just tried this: > class C(object): > ...def method(self): > ...pass > ... c = C() delattr(c, "method") > > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'C' object attribute 'method' is read-o

Re: Help with dict and iter

2009-04-02 Thread Sion Arrowsmith
mattia wrote: > So, I'm looking for a way to "reset" the next() value every >time i complete the scan of a list. itertools.cycle ? -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: Low level hard drive reading

2009-04-02 Thread Kushal Kumaran
On Thu, 02 Apr 2009 13:36:24 +0200 Gabriel wrote: > Hello, > I have to write linux application that will analyze disk/partition > (ext3 filesystem) on really low level. It has to find/analyze files > on the disk by reading disk blocks to analyze file's headers to find > out file type and then bl

Re: pygame and socket.recv

2009-04-02 Thread Aaron Brady
On Apr 2, 4:13 am, Tim Wintle wrote: > On Wed, 2009-04-01 at 18:45 -0700, Aaron Brady wrote: > > > My game loop looks like this: > > > poll events, get 1 at most > > send to server > > wait for server reply > > render entire frame > > The look I'm suggesting is: > > poll events > write to (non-blo

Re: complaints about no replies last week

2009-04-02 Thread Aaron Brady
On Mar 31, 4:34 pm, Arnaud Delobelle wrote: > [email protected] (Aahz) writes: > > Arnaud Delobelle   wrote: > > >>There are no comments - I don't have the time to add any, sorry! > > > The margin is too small to contain the proof? > > I wish I could come up with such a resilient conjecture! >

Re: Class methods read-only by default?

2009-04-02 Thread Steven D'Aprano
On Thu, 02 Apr 2009 06:07:20 -0700, Emanuele D'Arrigo wrote: > Hi Everybody! > > I just tried this: > class C(object): > ...def method(self): > ...pass > ... c = C() delattr(c, "method") > > Traceback (most recent call last): > File "", line 1, in > AttributeError:

Re: Any library to bind python with Yahoo mail service

2009-04-02 Thread Kushal Kumaran
On Thu, 2 Apr 2009 05:45:18 -0700 (PDT) guptha wrote: > Hi friends, > I came across libgmail library that can be used to bind python with > Google Gmail's service .Likewise is there any library available to > access the service of Yahoo mail from python code . > I like to send sms from my applic

Re: simple iterator question

2009-04-02 Thread Sion Arrowsmith
Neal Becker wrote: >How do I interleave 2 sequences into a single sequence? > >How do I interleave N sequences into a single sequence? itertools.chain(*itertools.izip(*Nsequences)) -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: simple iterator question

2009-04-02 Thread andrew cooke
Sion Arrowsmith wrote: > Neal Becker wrote: >>How do I interleave 2 sequences into a single sequence? >> >>How do I interleave N sequences into a single sequence? > > itertools.chain(*itertools.izip(*Nsequences)) aha! thanks. andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: A design problem I met again and again.

2009-04-02 Thread Steven D'Aprano
On Thu, 02 Apr 2009 07:45:46 -0400, andrew cooke wrote: > Lawrence D'Oliveiro wrote: >>> What are the average size of source files in your project? If it's >>> far lower than 15,000, don't feel it's a little unbalance? >> >> Why? > > one reason is that it becomes inefficient to find code. if

Re: Creating huge data in very less time.

2009-04-02 Thread Grant Edwards
On 2009-04-02, Tim Roberts wrote: > Grant Edwards wrote: > >>On 2009-03-31, Dave Angel wrote: >> >>> They were added in NTFS, in the Windows 2000 timeframe, to my >>> recollection. >> >>NTFS was added in NT 3.1 (which predates Win2K by 7-8 years). > > Although that's true, you didn't read his se

Re: simple iterator question

2009-04-02 Thread Arnaud Delobelle
Neal Becker writes: > How do I interleave 2 sequences into a single sequence? Here's a way: >>> a = [1,2,3,4] >>> b = [5,6,7,8] >>> [x for S in zip(a, b) for x in S] [1, 5, 2, 6, 3, 7, 4, 8] > How do I interleave N sequences into a single sequence? In the same way as above. -- Arnaud -- htt

Re: Low level hard drive reading

2009-04-02 Thread Grant Edwards
On 2009-04-02, Gabriel wrote: > For example can i open disk image file and read it block by > block? Sure. Just open the file, seek to where you want and read it. Or, it'll probably be simpler to just mmap the file and then grab blocks using slices as indexes. -- Grant Edwards

Re: pygame and socket.recv

2009-04-02 Thread Hendrik van Rooyen
"Aaron Brady" wrote: On Apr 2, 1:19 am, "Hendrik van Rooyen" wrote: >> "Aaron Brady" wrote: >> 8< stuff showing small packets and adequate bandwidth -- >> What does "some latency" mean? - barely visible jitter, or a half >> second freeze? > >I've got a rather amateur loop keepi

Re: Python3: to add, remove and change

2009-04-02 Thread MRAB
[email protected] wrote: Here an informal list in random order of things that I may like to add or to remove to/from Python3.x+. [snip] To add: Python3 is much more lazy-flavour than Python 2.x (see lazy range, lazy dict views, etc). So islice becomes even more useful and more commonly

Tab completion

2009-04-02 Thread Steven D'Aprano
Does anyone use the tab-completion recipe in the docs? http://docs.python.org/library/rlcompleter.html#module-rlcompleter suggests using this to enable tab-completion: try: import readline except ImportError: print "Module readline not available." else: import rlcompleter readlin

Re: A design problem I met again and again.

2009-04-02 Thread 一首诗
You get it. Sometimes I feel that my head is trained to work in a procedural way. I use a big class just as a container of functions. About the "data-based" approach, what if these functions all shares a little data, e.g. a socket, but nothing else? On Apr 2, 5:58 am, Carl Banks wrote: > On Ap

Re: pygame and socket.recv

2009-04-02 Thread Miguel Prada
I don't know if this might be causing your problem, but most socket implementations use quite a big buffer for incoming data by default. I had a lot of trouble with another real-time networked application until I realised this. Reducing this buffer to the minimum helped a lot in my case. Also, I wo

Re: Tab completion

2009-04-02 Thread Chris Rebert
On Thu, Apr 2, 2009 at 7:59 AM, Steven D'Aprano wrote: > Does anyone use the tab-completion recipe in the docs? > > http://docs.python.org/library/rlcompleter.html#module-rlcompleter > > suggests using this to enable tab-completion: > > try: >    import readline > except ImportError: >    print "M

PEP 382: Namespace Packages

2009-04-02 Thread Martin v. Löwis
I propose the following PEP for inclusion to Python 3.1. Please comment. Regards, Martin Abstract Namespace packages are a mechanism for splitting a single Python package across multiple directories on disk. In current Python versions, an algorithm to compute the packages __path__ must

Re: how to handle/generate pcap file

2009-04-02 Thread Jorgen Grahn
On Wed, 1 Apr 2009 18:59:12 -0700 (PDT), Evan wrote: > On Apr 2, 6:59 am, "Rhodri James" wrote: >> On Wed, 01 Apr 2009 14:53:34 +0100, Evan wrote: >> >> > Hello - >> >> > I'm trying to decode thepcapfilewhich is packet capture by tcpdump >> > or wireshark.   Is there a python module that I can u

Re: Introducing Python to others

2009-04-02 Thread David C. Ullrich
In article , "andrew cooke" wrote: > David C. Ullrich wrote: > > In article , > > Scott David Daniels wrote: [...] > >> > >> class Vector(list): > >> def __add__(self, other): > >> return type(self)(x + y for x, y in zip(self, other)) > > > > Question: I would have t

Re: Any library to bind python with Yahoo mail service

2009-04-02 Thread Mike Driscoll
On Apr 2, 7:45 am, guptha wrote: > Hi friends, > I came across libgmail library that can be used to bind python with > Google Gmail's service .Likewise is there any library available to > access the service of Yahoo mail  from python code . > I like to send sms from my application  via Yahoo mail

Re: A design problem I met again and again.

2009-04-02 Thread Jorgen Grahn
[top-posting fixed] On Thu, 2 Apr 2009 08:02:23 -0700 (PDT), =?GB2312?B?0rvK18qr?= wrote: > On Apr 2, 5:58 am, Carl Banks wrote: >> On Apr 1, 12:44 am, ?? wrote: >> >> > I got the same problem when writing C#/C++ when I have to provide a >> > lot of method to my code's user. So I create a

Re: python for loop

2009-04-02 Thread Lou Pecora
In article , Steven D'Aprano wrote: > So an ordinality of zero just means the number > of elements of something that doesn't exist. You do realize that will give most people headaches. :-) -- -- Lou Pecora -- http://mail.python.org/mailman/listinfo/python-list

Re: Tab completion

2009-04-02 Thread sjbrown
readline.parse_and_bind('\C-n: complete') Makes it Ctrl-n do the completion, like vim. On Apr 2, 7:59 am, Steven D'Aprano wrote: > Does anyone use the tab-completion recipe in the docs? > > http://docs.python.org/library/rlcompleter.html#module-rlcompleter > > suggests using this to enable tab-c

with open('com1', 'r') as f:

2009-04-02 Thread gert
from subprocess import * check_call(['mode', 'COM1:9600,N,8,1,P'],shell=True) while True: with open('com1', 'r') as f: for line in f: print('line') This works very well except for one thing. After a reboot I have to launch 1 time any windows serial exe application no mate

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-02 Thread P.J. Eby
At 10:32 AM 4/2/2009 -0500, Martin v. Löwis wrote: I propose the following PEP for inclusion to Python 3.1. Please comment. An excellent idea. One thing I am not 100% clear on, is how to get additions to sys.path to work correctly with this. Currently, when pkg_resources adds a new egg to s

RE: Introducing Python to others

2009-04-02 Thread Sells, Fred
When doing the same thing, I like Using a dictionary to return a function or a class definition based on a msg id and let that returned value "handle" the message that contained the id. Something like Class XYZ: ... MyHandlers = {42:XYZ, ... Message = read_from_somewhere_else() Handl

openNetcam open source project recruiting developers

2009-04-02 Thread bobicanprogram
A new open source project has been started with the aim of building an open Linux framework for TCP/IP enabled video camera systems. http://www.openNetcam.net The framework will be layered on the ultra lightweight SIMPL toolkit (http://www.icanprogram.com/simpl) and when the framework is complete

web application for scientific puposes

2009-04-02 Thread Saurabh Kabra
Dear Group, I am new to python and I mostly use basic python scripts for small mathematical/scientific/intrumentation applications. Now, I want to make these application available to others by converting them to web based applications (so that it can be used by several people on our internal netwo

Re: Tab completion

2009-04-02 Thread Chris Jones
On Thu, Apr 02, 2009 at 10:59:29AM EDT, Steven D'Aprano wrote: > Does anyone use the tab-completion recipe in the docs? > > http://docs.python.org/library/rlcompleter.html#module-rlcompleter > > suggests using this to enable tab-completion: > > try: > import readline > except ImportError: >

Re: python for loop

2009-04-02 Thread Tim Wintle
On Thu, 2009-04-02 at 06:28 +, Steven D'Aprano wrote: > In set theory, you start by defining the integers like this: > > 0 = len( {} ) > 1 = len( {{}} ) > 2 = len( {{}, {{}}} ) > 3 = len( {{}, {{}}, {{}, {{}}} ) > etc. not quite len() - surely you mean something like "any object along with an

Re: A design problem I met again and again.

2009-04-02 Thread Carl Banks
On Apr 2, 8:02 am, 一首诗 wrote: > You get it. Sometimes I feel that my head is trained to work in a > procedural way. I use a big class just as a container of functions. > > About the "data-based" approach, what if these functions all shares a > little data, e.g. a socket, but nothing else? Then

Re: Python Goes Mercurial

2009-04-02 Thread Kay Schluehr
On 2 Apr., 15:05, David Smith wrote: > Kay Schluehr wrote: > > On 1 Apr., 07:56, Lawrence D'Oliveiro > central.gen.new_zealand> wrote: > >> In message <35d429fa-5d13-4703- > > >> [email protected]>, John Yeung wrote: > >>> Here's one that clearly expresses strong antip

Re: Sending SMS using python script

2009-04-02 Thread Brent Bloxam
guptha wrote: hi group, my application needs to send SMS occasionally to all the clients .Is there any library in python that supports in sending SMS. I like to conform few information i gathered in this regard. I can send SMS by two ways 1. Sending SMS using Email clients 2. Using sms gateway

Re: league problem in python

2009-04-02 Thread Andrew Henshaw
"Ross" wrote in message news:d5cc0ec7-5223-4f6d-bab4-3801dee50...@r37g2000yqn.googlegroups.com... ... snip ... > I would like to create a simple program where the pro could enter in > how many people were in the league, the number of courts available, > and the number of weeks the schedule would

Re: PEP 382: Namespace Packages

2009-04-02 Thread Carl Banks
On Apr 2, 8:32 am, "Martin v. Löwis" wrote: > I propose the following PEP for inclusion to Python 3.1. > Please comment. > > Regards, > Martin > > Abstract > > > Namespace packages are a mechanism for splitting a single Python > package across multiple directories on disk. In current Pyth

Re: *args question

2009-04-02 Thread Aahz
In article <50d06eb9-2b87-43a0-a7e2-6b68e35fc...@y34g2000prb.googlegroups.com>, grocery_stocker wrote: > >Given the following code... > >import thread Here's your problem; subclass threading.Thread instead, much easier. -- Aahz ([email protected]) <*> http://www.pythoncraft

Re: with open('com1', 'r') as f:

2009-04-02 Thread Kushal Kumaran
On Thu, 2 Apr 2009 10:01:02 -0700 (PDT) gert wrote: > from subprocess import * > > check_call(['mode', 'COM1:9600,N,8,1,P'],shell=True) > while True: > with open('com1', 'r') as f: > for line in f: > print('line') > > This works very well except for one thing. After a r

Re: PEP 382: Namespace Packages

2009-04-02 Thread Kay Schluehr
On 2 Apr., 17:32, "Martin v. Löwis" wrote: > I propose the following PEP for inclusion to Python 3.1. > Please comment. > > Regards, > Martin > > Abstract > > > Namespace packages are a mechanism for splitting a single Python > package across multiple directories on disk. In current Pytho

Re: PEP 382: Namespace Packages

2009-04-02 Thread Chris Rebert
On Thu, Apr 2, 2009 at 11:38 AM, Carl Banks wrote: > On Apr 2, 8:32 am, "Martin v. Löwis" wrote: >> I propose the following PEP for inclusion to Python 3.1. >> Please comment. >> >> Regards, >> Martin >> >> Abstract >> >> >> Namespace packages are a mechanism for splitting a single Pytho

Re: Python3: to add, remove and change

2009-04-02 Thread Raymond Hettinger
On Apr 2, 12:39 am, [email protected] wrote: > To add again: tuple unpacking in function arguments: it's handy, hi- > level, de-clutters the code and shortens it too. +1 But you will have to talk to Brett about it. He's the one who led the effort to kill it. > To change: I'd like {:

Re: web application for scientific puposes

2009-04-02 Thread W. Martin Borgert
On 2009-04-02 11:30, Saurabh Kabra wrote: > Can you guys recommend packages or > combination of packages for such an application. Apache + mod_wsgi + Django + matplotlib. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Goes Mercurial

2009-04-02 Thread Echo
2009/4/2 Jeremiah Dodds > The one thing that makes me want to use git more than any other dvcs is > that you don't have to create a new directory for branches. This may be > possible in other dvcs's , but git is the only one I've seen advertise the > capability. > > -- > http://mail.python.org/ma

PIL Handbooks

2009-04-02 Thread W. eWatson
I'm very new to PIL, and don't see any handbooks for 1.1.6 or the forthcoming 1.1.7. In fact, this looks like the extent of them: * Python Imaging Library Handbook for 1.1.5 (online) * Python Imaging Library Handbook for 1.1.3 (PDF) Somewhere in my recent search I see that 1.1.6 has som

Re: Python Goes Mercurial

2009-04-02 Thread andrew cooke
Echo wrote: > 2009/4/2 Jeremiah Dodds > >> The one thing that makes me want to use git more than any other dvcs is >> that you don't have to create a new directory for branches. This may be >> possible in other dvcs's , but git is the only one I've seen advertise >> the >> capability. [...] > That

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-02 Thread Chris Withers
Martin v. Löwis wrote: I propose the following PEP for inclusion to Python 3.1. Please comment. Would this support the following case: I have a package called mortar, which defines useful stuff: from mortar import content, ... I now want to distribute large optional chunks separately, but id

  1   2   >