Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Mike Rovner
Paul Rubin wrote: If the compiler can do some type inference, it can optimize out those multiple calls pretty straightforwardly. It can be tipped like that: di = dict(int) di.setdefault(0) di[key] += 1 dl = dict(list) dl.setdefault([]) dl.append("word") dl.extend(mylist) But the point is that if me

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Paul Rubin
Mike Rovner <[EMAIL PROTECTED]> writes: > It can be tipped like that: > > di = dict(int) > di.setdefault(0) > di[key] += 1 ... > But the point is that if method not found in dict it delegated to > container type specified in constructor. > > It solves dict specialization without bloating dict cla

Re: Configure this group in email client

2005-03-20 Thread kiran
Try 62.181.3.13 (Global news server) Also, check this thread http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/df0f1bc9514bf353/3fe59b5daf26dc89?q=thunderbird#3fe59b5daf26dc89 -- http://mail.python.org/mailman/listinfo/python-list

Re: 1 + 2 = 3

2005-03-20 Thread Do Re Mi chel La Si Do
4 -- http://mail.python.org/mailman/listinfo/python-list

how can I put a 1Gb file in a zipfile??

2005-03-20 Thread Bennie
Hi, I have a problem with ZipFile. It works okay untily I come across a file that is greater then 1Gb. Then it exit with the error: OverflowError: long int too large to convert to int How can I fix this? souce: zip = zipfile.ZipFile(file, 'w') for all in os.

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Duncan Booth
Raymond Hettinger wrote: > The rationale is to replace the awkward and slow existing idioms for > dictionary based accumulation: > > d[key] = d.get(key, 0) + qty > d.setdefault(key, []).extend(values) > How about the alternative approach of allowing the user to override the action to b

Re: wxPython vs. pyQt

2005-03-20 Thread Andrew E
Hans-Peter Jansen wrote: .. While in PyQt world, I found these advantages: + conceptually vastly superior + powerful api/widgets/features + fast as hell due to the efficient binding of a quite efficient lib + cool tools, that are unicode/translation aware + very efficient programming environme

Re: sound processing - avarage amplitude?

2005-03-20 Thread TZOTZIOY
On Sat, 19 Mar 2005 17:18:42 +0200, rumours say that Niklas Paro <[EMAIL PROTECTED]> might have written: >Hello > >I would need way to check the amplitude (over time) for a sound file in >python. I'm sure this can be done, for example the audioop.rms function >seems to be able return amplitude va

Re: wxPython vs. pyQt

2005-03-20 Thread Duncan Booth
Swaroop C H wrote: > For those who don't know, Qt 4 on Windows will be available under GPL. > So, you can write a (GPLed) app using Qt 4 and run it on Windows, Mac, > Linux and even embedded! > Yes, but the FAQ implies to me that they really don't want to encourage people to use the GPL: > Q:

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Matteo Dell'Amico
Raymond Hettinger wrote: I would like to get everyone's thoughts on two new dictionary methods: def count(self, value, qty=1): try: self[key] += qty except KeyError: self[key] = qty def appendlist(self, key, *values):

Re: How two modules call functions defined in each other?

2005-03-20 Thread TZOTZIOY
On 19 Mar 2005 18:07:31 -0800, rumours say that "Tian" <[EMAIL PROTECTED]> might have written: >I am python beginner, I have a question about the interdependence of >modules. >For example, when I have two modules: > >module1.py >- >def plus(x): > return add(x,1) > > >module2.py >

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Reinhold Birkenfeld
Mike Rovner wrote: > Paul Rubin wrote: > >> If the compiler can do some type inference, it can optimize out those >> multiple calls pretty straightforwardly. > > It can be tipped like that: > > di = dict(int) > di.setdefault(0) > di[key] += 1 Interesting, but why do you need to give the int typ

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Reinhold Birkenfeld
John Machin wrote: > Reinhold Birkenfeld wrote: >> John Machin wrote: >> Are you kidding? If you know what "set" and "default" means, you will > be >> able to guess what "setdefault" means. Same goes for updateBy. >> > > No I'm not kidding -- people from some cultures have no difficulty at > all i

generating audio signals

2005-03-20 Thread nicke
I'm running linux and would like to generate specific frequencies and play them(in OSS) or alternatively save them as wav files, how should I accomplish this? Using python to play and generate is not strictly necessary, as long as I can invoke the command from python. I know for example xmms can do

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Reinhold Birkenfeld
George Sakkis wrote: >> -1 form me. >> >> I'm not very glad with both of them ( not a naming issue ) because i >> think that the dict type should offer only methods that apply to each >> dict whatever it contains. count() specializes to dict values that are >> addable and appendlist to those that a

Re: How two modules call functions defined in each other?

2005-03-20 Thread Reinhold Birkenfeld
Tian wrote: > I am python beginner, I have a question about the interdependence of > modules. > > For example, when I have two modules: > > module1.py > - > def plus(x): > return add(x,1) > > > module2.py > - > def add(x,y): > return x+y > > def plus2(x): > return

Re: generating audio signals

2005-03-20 Thread Alia Khouri
http://www.python.org/moin/PythonInMusic -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Roose
> How about the alternative approach of allowing the user to override the > action to be taken when accessing a non-existent key? > >d.defaultValue(0) I like this a lot. It makes it more clear from the code what is going on, rather than having to figure out what the name appendlist, count, ta

simultaneous copy to multiple media

2005-03-20 Thread Claudio Grondi
I would like to save time copying the same file (>6 GByte) to various different target storage media connected to the system via USB. Is there a (Python or other) tool able to help me to do this, so that I don't need to copy the source file first to the first media, then to the second, etc.? Clau

Re: simultaneous copy to multiple media

2005-03-20 Thread Swaroop C H
On Sun, 20 Mar 2005 11:41:10 -, Claudio Grondi <[EMAIL PROTECTED]> wrote: > I would like to save time copying the same file > (>6 GByte) to various different target storage > media connected to the system via USB. > > Is there a (Python or other) tool able to help me > to do this, so that I do

Re: how can I put a 1Gb file in a zipfile??

2005-03-20 Thread TZOTZIOY
On Sun, 20 Mar 2005 10:44:06 +0100, rumours say that Bennie <[EMAIL PROTECTED]> might have written: >Hi, > >I have a problem with ZipFile. >It works okay untily I come across a file that is greater then 1Gb. >Then it exit with the error: > OverflowError: long int too large to convert to int

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Kay Schluehr
Duncan Booth wrote: > Raymond Hettinger wrote: > > > The rationale is to replace the awkward and slow existing idioms for > > dictionary based accumulation: > > > > d[key] = d.get(key, 0) + qty > > d.setdefault(key, []).extend(values) > > > > How about the alternative approach of allowing t

Re: simultaneous copy to multiple media

2005-03-20 Thread Jacek Trzmiel
Claudio Grondi wrote: > > I would like to save time copying the same file > (>6 GByte) to various different target storage > media connected to the system via USB. > > Is there a (Python or other) tool able to help me > to do this, so that I don't need to copy the > source file first to the fir

Re: survey of modules to be added to stdlib

2005-03-20 Thread Alia Khouri
It would be amazing if you could add the feature to do combo package installs like : - a scientific python combo (which would include scipy, numarray, Numpy, plotting libs, etc) - an AI python combo(orange, constraint programming modules, agent libs, etc) - a game development python combo (pygam

Re: Variable Variable

2005-03-20 Thread Kay Schluehr
> I'm going to make this explicit: the PHP idiom is a defect. > Yes, I know that's good style among top PHP practitioners, > but, from all I know, it's simply a bad habit. The advice to > use a dictionary is on target. I tried to like it the whole last hour ;-) I reconstructed the formal struct

Re: Variable Variable

2005-03-20 Thread Diez B. Roggisch
> > Personally I could live with that, but the diagram is a bit special > because of the restriction of the = operation. I do not know if PHP > supports this operational view by enabling iterations: $a, $$a, $$$a > ... ? It does. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/

Python scope is too complicated

2005-03-20 Thread Max
Yeah, I know. It's the price we pay for forsaking variable declarations. But for java programmers like me, Py's scoping is too complicated. Please explain what constitutes a block/namespace, and how to refer to variables outside of it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python scope is too complicated

2005-03-20 Thread TZOTZIOY
On Sun, 20 Mar 2005 13:53:34 +0200, rumours say that Max <[EMAIL PROTECTED]> might have written: >Yeah, I know. It's the price we pay for forsaking variable declarations. >But for java programmers like me, Py's scoping is too complicated. >Please explain what constitutes a block/namespace, and h

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Max
Paul Rubin wrote: Reinhold Birkenfeld <[EMAIL PROTECTED]> writes: Any takers for tally()? Well, as a non-native speaker, I had to look up this one in my dictionary. That said, it may be bad luck on my side, but it may be that this word is relatively uncommon and there are many others who would be h

Re: Python scope is too complicated

2005-03-20 Thread jfj
Max wrote: Yeah, I know. It's the price we pay for forsaking variable declarations. But for java programmers like me, Py's scoping is too complicated. Please explain what constitutes a block/namespace, and how to refer to variables outside of it. Some may disagree, but for me the easiest way to

Re: 2.4 crashes when try to exit app and mulitple threads active

2005-03-20 Thread Maxwell Hammer
On Sat, 19 Mar 2005 22:35:39 -0500, Peter Hansen wrote: > When you say "only one thread running", did you mean only > one monitor thread in addition to the main thread, or did > you really mean only the main thread was active at this time? I meant there was the main app and one thread. The proble

Re: importing two modules with the same name

2005-03-20 Thread Francisco Borges
El Pitonero wrote: > #- Main.py: your program > import imp > # load the third party module into sys.modules > imp.load_source('A', '', open('C:\\A.py')) > # load and execute your changes Thanks a bunch for the hint. The imp module did take care of the job, but just to mention load_source

Overloaded Constructors?!?

2005-03-20 Thread andrea_gavana
Hello NG, I am trying to port a useful class from wxWidgets (C++) to a pure Python/wxPython implementation. In the C++ source code, a unique class is initialized with 2 different methods (???). This is what it seems to me. I have this declarations: class wxFoldWindowItem { private: wxWi

(",) Do You Want To Know For Sure You Are Going To Heaven?

2005-03-20 Thread Ron038548
http://www.want-to-be-sure.blogspot.com << Click On Link -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Peter Hansen
Max wrote: Has anyone _not_ heard Jeff Probst say, "I'll go tally the votes"?! :) Who is Jeff Probst? -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.4 crashes when try to exit app and mulitple threads active

2005-03-20 Thread Peter Hansen
Maxwell Hammer wrote: On Sat, 19 Mar 2005 22:35:39 -0500, Peter Hansen wrote: When you say "only one thread running", did you mean only one monitor thread in addition to the main thread, or did you really mean only the main thread was active at this time? I meant there was the main app and one thre

Re: PyZeroConf Question

2005-03-20 Thread A.M. Kuchling
On Thu, 17 Mar 2005 14:48:03 -0800, djw <[EMAIL PROTECTED]> wrote: > The list of printers is returned, but every call to getServiceInfo() in > the Listener objectresults in a timeout and None being returned. I suggest compiling Apple's mDNSMonitor and looking at the sequence of packets.

Re: raise takes a long time

2005-03-20 Thread TZOTZIOY
On Fri, 18 Mar 2005 12:04:02 +, rumours say that Robin Becker <[EMAIL PROTECTED]> might have written: >I'm trying to get a handle on a real world problem related to raising an >exception. This is in the reportlab SimpleDoctemplate class. > >The following code takes a very long time (>60 secon

[ann] fdups 0.15

2005-03-20 Thread Patrick Useldinger
I am happy to announce version 0.15 of fdups. Changes in this version: - ability to limit the number of file handles used Download = To download, go to: http://www.homepages.lu/pu/fdups.html What is fdups? == fdups is a Python program to detect duplicate

what is \s+ and \S+ means in re.compile?

2005-03-20 Thread sam
Hi, I was confused by \s+ and \S+ in python. The second one (\S+) is stand for matching all alphabets except for digit and space? How about the first one? Thanks Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Matteo Dell'Amico
Kay Schluehr wrote: Why do You set d.defaultValue(0) d.defaultValue(function=list) but not d.defaultValue(0) d.defaultValue([]) ? I think that's because you have to instantiate a different object for each different key. Otherwise, you would instantiate just one list as a default value for *all* d

Re: what is \s+ and \S+ means in re.compile?

2005-03-20 Thread Ed Leafe
On Mar 20, 2005, at 9:59 AM, sam wrote: I was confused by \s+ and \S+ in python. The second one (\S+) is stand for matching all alphabets except for digit and space? How about the first one? From the docs: \s Matches any whitespace character; this is equivalent to the set [ \t\n\r\f\v]. \S Matc

Re: simultaneous copy to multiple media

2005-03-20 Thread Claudio Grondi
I am on a Widows 2000 box using the NTFS file system. Both up to now suggested approaches as - tee.exe (where I used the http://david.tribble.com/dos/tee.exe DOS-port with redirecting stdout to NULL) and - parallel copy (hoping caching does the job) are by far slower than the consecutive copy: si

Re: Simple account program

2005-03-20 Thread Igorati
I was looking at both the programs and I got Dennis Lee Bieber's code to work, then I tried the imporvements from Chris Reberts code but was unable to get it to run. It said EOL error. I took out got and tried to move it around but it didn't take. I took the else code at the end so that other keys

Re: inline comparison

2005-03-20 Thread sam
Tim Roberts wrote: sam <[EMAIL PROTECTED]> wrote: Hi, I got the the following syntax error in comparison: File "/usr/local/work/myparser.py", line 85 if ( (m=self.macro_parser.match (d)) != None ): ^ SyntaxError: invalid syntax How can I get around wtih this? I don't want to break do

Re: inline comparison

2005-03-20 Thread Diez B. Roggisch
> This is very bad to me, I will need to write some cumbersome syntax as > follow: > for d in self.data: > m = self.macro_parser.match (d)) != None ): > if (m == None): > m_nat = self.a_parser.match (d) > if (m_a == None): >

[OT] Re: Hi Guys. First Time Poster

2005-03-20 Thread Jeff Schwab
sheldon279 wrote: Hi guys. First time poster long time reader. Just wanted to say "Hi" ;) On a side note my Hubby is REAL excited about this new IPO stock GRDX. They just started trading this one like 2 days ago. It's already almost doubled in just 2 days! My Husband is really excited about this st

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Magnus Lie Hetland
In article <[EMAIL PROTECTED]>, Raymond Hettinger wrote: >I would like to get everyone's thoughts on two new dictionary methods: > >def count(self, value, qty=1): >try: >self[key] += qty >except KeyError: >self[key] = qty Yes, yes, YE

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread BJörn Lindqvist
I like count() and appendlist() or whatever they will be named. But I have one question/idea: Why does the methods have to be put in dict? Can't their be a subtype of dict that includes those two methods? I.e.: .histogram = counting_dict() .for ch in text: .histogram.count(ch) Then maybe som

Re: [perl-python] a program to delete duplicate files

2005-03-20 Thread Claudio Grondi
>> I'll post my version in a few days. Have I missed something? Where can I see your version? Claudio "Xah Lee" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > here's a large exercise that uses what we built before. > > suppose you have tens of thousands of files in various d

How to pass parameter when importing a module?

2005-03-20 Thread Bo Peng
Dear list, What I would like to do is something like: In myModule.py ( a wrapper module for different versions of the module), if lib == 'standard': from myModule_std import * elsif lib == 'optimized' from myModule_op import * but I do not know how to pass variable lib to myModule.py to

Re: Variable Variable

2005-03-20 Thread Mike Gould
Premshree Pillai wrote: On Sat, 19 Mar 2005 04:35:47 -0500, Leif K-Brooks <[EMAIL PROTECTED]> wrote: Tanteauguri wrote: Hi List, is there in python a variable variable like in PHP ($$var)? What I want to do is something like that: pc=["a","b","c"] for i in pc: i = anyclass() a.shutdown() b.updat

Re: Variable Variable

2005-03-20 Thread MikeyG
Premshree Pillai wrote: On Sat, 19 Mar 2005 04:35:47 -0500, Leif K-Brooks <[EMAIL PROTECTED]> wrote: Tanteauguri wrote: Hi List, is there in python a variable variable like in PHP ($$var)? What I want to do is something like that: pc=["a","b","c"] for i in pc: i = anyclass() a.shutdown() b.updat

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Duncan Booth
Roose wrote: > I think someone mentioned that it might be a problem to add another > piece of state to all dicts though. I don't know enough about the > internals to say anything about this. > > setdefault gets around this by having you pass in the value every > time, so it doesn't have to store

Re: [OT] Re: Hi Guys. First Time Poster

2005-03-20 Thread Gerrit Holl
Jeff Schwab wrote: > sheldon279 wrote: > Wow, you sold me. > > Does this kinda scam really still work? This kind of replies works to confuse spambayes. Gerrit. -- Weather in Twenthe, Netherlands 20/03 16:55: 9.0ÂC wind 4.0 m/s ENE (57 m above NAP) -- In the councils of government,

Re: How to pass parameter when importing a module?

2005-03-20 Thread Swaroop C H
On Sun, 20 Mar 2005 10:18:14 -0600, Bo Peng <[EMAIL PROTECTED]> wrote: > What I would like to do is something like: > In myModule.py ( a wrapper module for different versions of the module), >if lib == 'standard': > from myModule_std import * >elsif lib == 'optimized' > from myMod

Re: ANN: 2005 International Obfuscated Ruby Code Contest (IORCC)

2005-03-20 Thread Gerrit Holl
[EMAIL PROTECTED] wrote: > IMMEDIATE RELEASE: Fri Mar 18 16:34:52 CST 2005 > LOCATION: http://iorcc.dyndns.org/2005/press/031805.html > ANNOUNCEMENT: International Obfuscated Ruby Code Contest (IORCC) >Entry Deadline, Midnight on March 31st, 2005 > > > Dear Rubyi

Re: simultaneous copy to multiple media

2005-03-20 Thread Grant Edwards
On 2005-03-20, Claudio Grondi <[EMAIL PROTECTED]> wrote: > Is there maybe a way to use a direct DMA > transfer to multiple target destinations > (I copy to drives connected via USB ports) ? Sure, but you'll have to throw away your OS, and write a program that runs on the bare metal. > Can someon

beeping portably

2005-03-20 Thread Jim
Hello, I'd like to emit beeps. The twists are that (1) I hope to have control over the frequency of the beeps and their duration and (2) I'd like the solution to be portable across Linux, Windows, and OS X. I've done some searching of this group and the solutions that people have offered in the

Re: How to pass parameter when importing a module?

2005-03-20 Thread André Roberge
Bo Peng wrote: Dear list, What I would like to do is something like: In myModule.py ( a wrapper module for different versions of the module), if lib == 'standard': from myModule_std import * elsif lib == 'optimized' from myModule_op import * but I do not know how to pass variable lib to

Re: wxPython vs. pyQt

2005-03-20 Thread John J. Lee
Andrew E <[EMAIL PROTECTED]> writes: > Hans-Peter Jansen wrote: > > .. > > While in PyQt world, I found these advantages: > > + conceptually vastly superior > > + powerful api/widgets/features > > + fast as hell due to the efficient binding of a quite efficient lib > > + cool tools, that are u

Re: beeping portably

2005-03-20 Thread John J. Lee
"Jim" <[EMAIL PROTECTED]> writes: > I'd like to emit beeps. The twists are that (1) I hope to have control > over the frequency of the beeps and their duration and (2) I'd like the > solution to be portable across Linux, Windows, and OS X. [...] PyGame? If it's too big for you, you could always

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Kay Schluehr
Matteo Dell'Amico wrote: > Kay Schluehr wrote: > > > Why do You set > > > > d.defaultValue(0) > > d.defaultValue(function=list) > > > > but not > > > > d.defaultValue(0) > > d.defaultValue([]) > > > > ? > > I think that's because you have to instantiate a different object for > each different key.

For loop extended syntax

2005-03-20 Thread George Sakkis
I'm sure there must have been a past thread about this topic but I don't know how to find it: How about extending the "for in" syntax so that X can include default arguments ? This would be very useful for list/generator comprehensions, for example being able to write something like: [x*y-z fo

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Colin J. Williams
Paul Rubin wrote: "El Pitonero" <[EMAIL PROTECTED]> writes: What about no name at all for the scalar case: a['hello'] += 1 a['bye'] -= 2 I like this despite the minor surprise that it works even when a['hello'] is uninitialized. +1 and if the value is a list: a['hello']= [1, 2, 3] a['hello']+= [4]

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Roose
> Another option with no storage overhead which goes part way to reducing > the awkwardness would be to provide a decorator class accessible through > dict. The decorator class would take a value or function to be used as > the default, but apart from __getitem__ would simply forward all other > me

Re: For loop extended syntax

2005-03-20 Thread Kay Schluehr
George Sakkis wrote: > This would be very > useful for list/generator comprehensions, for example being able to write something like: > > [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)] > Looks very appealing, but what to do with [x*y-z for (x=0,y,z) in (1,2,3), (4,5), (6,7,8)] ? Should it rai

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Jeremy Bowers
On Sat, 19 Mar 2005 20:07:40 -0800, Kay Schluehr wrote: > It is bad OO design, George. I want to be a bit more become more > specific on this and provide an example: Having thought about this for a bit, I agree it is a powerful counter-argument and in many other languages I'd consider this a total

Re: Building Time Based Bins

2005-03-20 Thread MCD
John Machin wrote: > Are you (extremely) new to computer programming? Is this school > homework? Lol, yes, I am relatively new to programming... and very new to python. I have experience working with loops, if thens, and boolean operations, but I haven't worked with lists or array's as of yet... s

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Matteo Dell'Amico
Kay Schluehr wrote: I think that's because you have to instantiate a different object for each different key. Otherwise, you would instantiate just one list as a default value for *all* default values. Or the default value will be copied, which is not very hard either or type(self._default)() will

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Alexander Schmolck
Beni Cherniavsky <[EMAIL PROTECTED]> writes: >> The relatively recent "improvement" of the dict constructor signature >> (``dict(foo=bar,...)``) obviously makes it impossible to just extend the >> constructor to ``dict(default=...)`` (or anything else for that matter) which >> would seem much less

Re: For loop extended syntax

2005-03-20 Thread Matteo Dell'Amico
George Sakkis wrote: I'm sure there must have been a past thread about this topic but I don't know how to find it: How about extending the "for in" syntax so that X can include default arguments ? This would be very useful for list/generator comprehensions, for example being able to write somet

Re: simultaneous copy to multiple media

2005-03-20 Thread Claudio Grondi
means your message, that you think, that the consecutive copy is the fastest possible method if using Windows 2000? Claudio "Grant Edwards" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > On 2005-03-20, Claudio Grondi <[EMAIL PROTECTED]> wrote: > > > Is there maybe a way to u

Changing the Keyboard output

2005-03-20 Thread Abdul Hafiz al-Muslim
Hi, I am new to Python and still learning. I am looking for a way to change the keyboard output within Tkinter - for example, say I press "p" and I want to come out as "t". Could anyone point me in the right direction? AHaM -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop extended syntax

2005-03-20 Thread George Sakkis
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > > This would be very > > useful for list/generator comprehensions, for example being able to > write something like: > > > > [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)] > > > > Looks very appealing, but what to do with > > [

Re: how can I put a 1Gb file in a zipfile??

2005-03-20 Thread bennie
Christos TZOTZIOY Georgiou wrote: On Sun, 20 Mar 2005 10:44:06 +0100, rumours say that Bennie <[EMAIL PROTECTED]> might have written: Hi, I have a problem with ZipFile. It works okay untily I come across a file that is greater then 1Gb. Then it exit with the error: OverflowError: long int

getting text from WinXP console

2005-03-20 Thread Chris Maloof
Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via pywin32, I haven't been able to do anything with it. I'd really just like to get the window text into a

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Francis Girard
Hi, I really do not like it. So -1 for me. Your two methods are very specialized whereas the dict type is very generic. Usually, when I see something like this in code, I can smell it's a patch to overcome some shortcomings on a previous design, thereby making the economy of re-designing. Simpl

Re: How to pass parameter when importing a module?

2005-03-20 Thread Serge Orlov
Bo Peng wrote: > Dear list, > > What I would like to do is something like: > > In myModule.py ( a wrapper module for different versions of the > module), > if lib == 'standard': > from myModule_std import * > elsif lib == 'optimized' > from myModule_op import * > > but I do not know how

Re: wxPython vs. pyQt

2005-03-20 Thread Andrew E
John J. Lee wrote: The key question from my point of view is: can I write commercial sell-if-I-want-to applications using Qt? If it is GPL, then I guess the answer is 'no'? Yes, you can write commercial apps. It's multi-licensed (commercial, GPL, etc.): you get to pick the license(s) you want to

Re: For loop extended syntax

2005-03-20 Thread George Sakkis
"Matteo Dell'Amico" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > I'm sure there must have been a past thread about this topic but I don't > > know how to find it: How > > about extending the "for in" syntax so that X can include default > > arguments ? This would be very > > useful for

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Mike Rovner
Reinhold Birkenfeld wrote: I don't quite understand that. Which dict item are you extending? Don't you need something like dl[key].append("word") Rigth. It was just a typo on my part. Thanks for fixing. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop extended syntax

2005-03-20 Thread Heiko Wundram
On Sunday 20 March 2005 20:47, George Sakkis wrote: > Not always. Say for example that you're doing some 2D geometry stuff, and > later you have to extend it to 3D. In this case you may have to deal with > both 2D and 3D objects, and map the former to the latter when necessary. But this rather sou

Re: simultaneous copy to multiple media

2005-03-20 Thread Heiko Wundram
On Sunday 20 March 2005 17:16, Claudio Grondi wrote: > Is there maybe a way to use a direct DMA > transfer to multiple target destinations > (I copy to drives connected via USB ports) ? Think about what USB stands for. Then reconsider whether you'll ever have the chance of writing truly simultane

Re: How to pass parameter when importing a module?

2005-03-20 Thread Bo Peng
Take a look at wxPython versioning: http://wiki.wxpython.org/index.cgi/MultiVersionInstalls The most simple usage looks like import wxversion wxversion.select("2.4") import wx Serge. This is essentially my second method: using another module to set parameter for myModule. Si

Re: Building Time Based Bins

2005-03-20 Thread MCD
Never mind about the summing... I learned that you can do this: sumhi = 0 sumhi += hi Cool! Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I put a 1Gb file in a zipfile??

2005-03-20 Thread Jeff Epler
The limits of ZIP files according to the folks who make info-zip: http://www.info-zip.org/pub/infozip/FAQ.html#limits statistic limit number of files65,536 uncompressed size of a single file 4 GB compressed size of a single file 4

Re: Changing the Keyboard output

2005-03-20 Thread Jeremy Bowers
On Sun, 20 Mar 2005 19:30:05 +, Abdul Hafiz al-Muslim wrote: > Hi, > I am new to Python and still learning. > > I am looking for a way to change the keyboard output within Tkinter - for > example, say I press "p" and I want to come out as "t". > > Could anyone point me in the right direction

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Michele Simionato <[EMAIL PROTECTED]> wrote: > >I am surprised nobody suggested we put those two methods into a >separate module (say dictutils or even UserDict) as functions: > >from dictutils import tally, listappend > >tally(mydict, key) >listappend(mydict, key, v

Re: simultaneous copy to multiple media

2005-03-20 Thread Rolf Zwart
Swaroop C H wrote: [...] If you are using *nix, maybe you can use the `tee` command[1] and redirect the file to different places. For example, cat | tee file1 | tee file2 > file3 On Unixes I know, only 1 process is needed: /dev/null It does work! ** Rolf I haven't tried it out but it should work.

Software for Poets (Was: Re: Text-to-speech)

2005-03-20 Thread Francis Girard
Hello M. Hartman, It's a very big opportunity for me to find someone that both is a poet and knows something about programming. First, please excuse my bad english ; I'm a french canadian. I am dreaming to write a software to help french poets to write strict rigourous classical poetry. Since

Re: simultaneous copy to multiple media

2005-03-20 Thread Claudio Grondi
I don't know any deep details about USB, except that I _know_ that it is a serial bus, but considering following: 1) I can read/write 45 MByte/s from harddrive to harddrive on the E-IDE bus (theoretically 100 MByte/s), so the speed of the harddrive I read/write from/to is probably the bottleneck.

Re: Text-to-speech

2005-03-20 Thread Steve Holden
Tim Churches wrote: Charles Hartman wrote: Does anyone know of a cross-platform (OSX and Windows at least) library for text-to-speech? I know there's an OSX API, and probably also for Windows. I know PyTTS exists, but it seems to talk only to the Windows engine. I'd like to write a single Python m

Re: For loop extended syntax

2005-03-20 Thread George Sakkis
"Heiko Wundram" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Sunday 20 March 2005 20:47, George Sakkis wrote: > > Not always. Say for example that you're doing some 2D geometry stuff, and > > later you have to extend it to 3D. In this case you may have to deal with > > both 2D

Re: Text-to-speech

2005-03-20 Thread jamesthiele . usenet
On some flavors of Windows you can use: import pyTTS tts = pyTTS.Create() tts.Speak('This is the sound of my voice.') On Mac OS X you can use: import os os.system("say 'This is the sound of my voice.'") You could write a wrapper that takes a string and checks to see which OS you are on and exec

Limerick (was: Re: Text-to-speech)

2005-03-20 Thread Jeremy Bowers
On Sun, 20 Mar 2005 16:18:14 -0500, Steve Holden wrote: > Since it's PyCon week, I will offer a prize of $100 to the best (in my > opinion) limerick about Python posted to this list (with a Cc: to > [EMAIL PROTECTED]) before midday on Friday. The prize money will be my > own, so there are no oth

Re: For loop extended syntax

2005-03-20 Thread Heiko Wundram
Am Sonntag, 20. März 2005 22:22 schrieb George Sakkis: > Once more, the 2D/3D example was just that, an example; my point was not to > find a specific solution to a specific problem. And my point being: it's simple enough to give a general recipe (which my example was) without extending Python's

Re: Text-to-speech

2005-03-20 Thread Charles Hartman
-- or ". . . a guru named Guido / (Who monitors everything we do) /" and ending with something about "looking max in a Speedo," but fortunately it's not coming to me at the moment. The closest I have an answer to your questions about Python and poetry (aside from the Scandroid) is a book cal

Re: simultaneous copy to multiple media

2005-03-20 Thread Diez B. Roggisch
> 2) if I understand it right, an USB controller is connected to > to the PCI bus and there can be many separate USB > controller on one PC True. > 3) the theoreticall speed of USB (430 MByte/s?) is much > higher as the experienced 15 MByte/s, probably due to slow > controller on the side of the

Re: Python scope is too complicated

2005-03-20 Thread Dan Bishop
jfj wrote: > Max wrote: > > Yeah, I know. It's the price we pay for forsaking variable declarations. > > But for java programmers like me, Py's scoping is too complicated. > > Please explain what constitutes a block/namespace, and how to refer to > > variables outside of it. > > > Some may disagree

  1   2   >