Re: Why MyHDL?

2008-12-23 Thread Jan Decaluwe
Stef Mientki wrote: hello Jan, Jan Decaluwe wrote: Hello: MyHDL is a Python package for using Python as a Hardware Description Language. A new release is upcoming, and on this occasion we have prepared a page about why MyHDL may be useful to you: http://www.myhdl.org/doku.php/why Very

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-23 Thread Chris Rebert
On Tue, Dec 23, 2008 at 11:46 PM, Gabriel Genellina wrote: > > Yes; but isn't a dict comprehension more adequate? > > [key: (dict1[key], dict2[key]) for key in common_keys if > dict1[key]!=dict2[key]} That initial [ should be a { of course. Cheers, Chris -- Follow the path of the Iguana...

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-23 Thread Gabriel Genellina
En Wed, 24 Dec 2008 05:16:36 -0200, escribió: I'm looking for suggestions on the best ('Pythonic') way to determine the difference between 2 very large dictionaries containing simple key/value pairs. By difference, I mean a list of keys that are present in the first dictionary, but not the seco

Most efficient way to build very large dictionaries

2008-12-23 Thread python
I'm working with some very large dictionaries (about 25M items per dictionary) that get filled based on data parsed from text based log files. I'm using Python dictionaries to track the frequency of specific combinations of events, eg, I build a key and then add various timing info from the current

GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008

2008-12-23 Thread Shaguf
--- Great Indian Developer Summit 2009 - GIDS.Java 24 April 2009 J N Tata Auditorium, IISc, Bangalore http://www.developersummit.com --

Re: Strategy for determing difference between 2 very large dictionaries

2008-12-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 pyt...@bdurham.com wrote: > Feedback on my proposed strategies (or better strategies) would be > greatly appreciated. Both strategies will work but I'd recommend the second approach since it uses already tested code written by other people - the chanc

Re: no sign() function ?

2008-12-23 Thread Steven D'Aprano
On Tue, 23 Dec 2008 14:36:53 +0100, Pierre-Alain Dorange wrote: > Steven D'Aprano wrote: > >> But this is just duplicating what timeit already does. Trust me, learn >> to use it, you won't be sorry. Here's a trick that took me a long time >> to learn: instead of copying your functions into the s

Re: Python's popularity

2008-12-23 Thread Steven D'Aprano
On Tue, 23 Dec 2008 08:06:35 -0800, the anonymous troll known only as "r" replied to Thorsten Kampe and said: > Thats "Thurstan", thank you very much! :) I think Thorsten knows how to spell his own name. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Strategy for determing difference between 2 very large dictionaries

2008-12-23 Thread python
I'm looking for suggestions on the best ('Pythonic') way to determine the difference between 2 very large dictionaries containing simple key/value pairs. By difference, I mean a list of keys that are present in the first dictionary, but not the second. And vice versa. And a list of keys in common b

Re: socket send help

2008-12-23 Thread Gabriel Genellina
En Wed, 24 Dec 2008 03:59:42 -0200, greyw...@gmail.com escribió: New guy here. I'm trying to figure out sockets in order to one day do a multiplayer game. Here's my problem: even the simplest examples don't work on my computer: A simple server: from socket import * myHost = '' Try with

Re: socket send help

2008-12-23 Thread Chris Rebert
On Tue, Dec 23, 2008 at 9:59 PM, greyw...@gmail.com wrote: > Hi everyone, > > New guy here. I'm trying to figure out sockets in order to one day do > a multiplayer game. Here's my problem: even the simplest examples > don't work on my computer: > > A simple server: > > from socket import * > my

socket send help

2008-12-23 Thread greyw...@gmail.com
Hi everyone, New guy here. I'm trying to figure out sockets in order to one day do a multiplayer game. Here's my problem: even the simplest examples don't work on my computer: A simple server: from socket import * myHost = '' myPort = 21500 s = socket(AF_INET, SOCK_STREAM)# create a TCP

Re: Multi-dimension list

2008-12-23 Thread Carl Banks
On Dec 23, 10:29 pm, "Steven Woody" wrote: > Hi, > > In the book Python Essential Reference, Chapter 3, when talking about > extended slicing, it gives an example:  a = m[0:10, 3:20].  But I > don't understand how the 'm' was defined.  What should it looks like? I suspect what the book is saying

www.iofferkicks.com china cheap wholesale nike shoes,air jordan shoes,air force one shoes.

2008-12-23 Thread www.iofferkicks.com
Get Nike Shoes at Super Cheap Prices Discount Nike air jordans (www.iofferkicks.com) Discount Nike Air Max 90 Sneakers (www.iofferkicks.com) Discount Nike Air Max 91 Supplier (www.iofferkicks.com) Discount Nike Air Max 95 Shoes Supplier (www.iofferkicks.com) Discount Nike Air Max 97 Trainers (

earn more then,15,989$/-

2008-12-23 Thread kela
THE REAL ONLINE JOB from,USA. earn more then,15,989$/- per month,if you want more detail,on No investment. http://onlinejob4ind.homestead.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Multi-dimension list

2008-12-23 Thread Steven Woody
Hi, In the book Python Essential Reference, Chapter 3, when talking about extended slicing, it gives an example: a = m[0:10, 3:20]. But I don't understand how the 'm' was defined. What should it looks like? Thanks. - narke -- http://mail.python.org/mailman/listinfo/python-list

Multi-dimension list

2008-12-23 Thread Steven Woody
Hi, In the book Python Essential Reference, Chapter 3, I see an example: -- http://mail.python.org/mailman/listinfo/python-list

Re: turtle ?

2008-12-23 Thread sai
On Tue, Dec 23, 2008 at 2:29 AM, Gerhard Häring wrote: > sai wrote: >> python newbie here :-) >> >> I am trying to get turtle to run but got stuck here: >> >> $ python >> Python 2.5.2 (r252:60911, Aug 5 2008, 16:17:28) >> [GCC 4.2.2 20071128 (prerelease) (4.2.2-3.1mdv2008.0)] on linux2 >> Type "

Re: On Whose Desktop

2008-12-23 Thread James Stroud
Steve Holden wrote: Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry: Note the thumb trackball. It's the shiznizzle. Give one two weeks of your patience and you'll seriously consider having it implanted in your thigh so you don't have to worry about missing it when you tr

Re: using subprocess module in Python CGI

2008-12-23 Thread Matt Nordhoff
ANURAG BAGARIA wrote: > Hello, > > I am a Python Newbie and would like to call a short python script via > browser using a CGI script, but initially I am trying to call the same > python script directly through python command line. The script intends > to perform a few command line in a pipe and I

Re: SuSE11.1 eclipse 64 pydev can't add python path

2008-12-23 Thread Benjamin Kaplan
On Tue, Dec 23, 2008 at 5:08 PM, Nikolas Tautenhahn wrote: > Hi, > > Reimar Bauer wrote: > > I can install pydev using the update manager in eclipse for 64 bit from > the > > SuSE 11.1 repo. But I can't configure pydev without crashing it. > > I can select the interpreter /usr/bin/python > > and

Re: no sign() function ?

2008-12-23 Thread ajaksu
On Dec 23, 2:45 pm, Mark Dickinson wrote: > On Dec 23, 4:27 pm, ajaksu wrote: > > > Is "x ** 0 > 0." instead of "atan2(x, -1.) > 0." unreliable across > > platforms? > > x**0 doesn't distinguish between x = -0.0 and x = 0.0. > > I suspect you're confusing -0.0**0.0 with (-0.0)**0.0. Yes, fooled

Re: 2to3 used in the Shootout

2008-12-23 Thread Isaac Gouy
On Dec 23, 11:51 am, bearophileh...@lycos.com wrote: > They have translated the Python benchmarks of the Shootout site from > Py2 to Py3 using 2to3: > > http://shootout.alioth.debian.org/u32/benchmark.php?test=all〈=pyt... So please re-write those programs to remove problems created by automatic t

Re: SuSE11.1 eclipse 64 pydev can't add python path

2008-12-23 Thread Nikolas Tautenhahn
Hi, Reimar Bauer wrote: > I can install pydev using the update manager in eclipse for 64 bit from the > SuSE 11.1 repo. But I can't configure pydev without crashing it. > I can select the interpreter /usr/bin/python > and I do see the System PYTHONPATH > Forced builtin libs also looks good. > > B

Re: 2to3 used in the Shootout

2008-12-23 Thread Terry Reedy
bearophileh...@lycos.com wrote: They have translated the Python benchmarks of the Shootout site from Py2 to Py3 using 2to3: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=python3 It shows some "performance bugs" of Python3 itself (especially regarding the binary-trees benchma

Re: [ANN] Python 2.5.4 (final)

2008-12-23 Thread Terry Reedy
Martin v. Löwis wrote: For more information on Python 2.5.4, including download links for various platforms, release notes, and known issues, please see: http://www.python.org/2.5.4 http://www.python.org/download/releases/2.5.4/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 urlopen(...).read() returns bytes

2008-12-23 Thread ajaksu
On Dec 23, 12:51 pm, Christian Heimes wrote: > If you want to do it right ... It should be a clean patch against the > py3k svn branch including documentation and a unit test. Got all three at http://bugs.python.org/issue4733 . Probably got all three wrong too, so any feedback is very welcome :)

Re: iterating initalizations

2008-12-23 Thread Rhodri James
On Tue, 23 Dec 2008 15:39:52 -, Aaron Stepp wrote: import random from rtcmix import * from chimes_source import * # Chime.play() from rhythmblock import * # rhythmBlock.rhythmTwist() and rhythmBlock.printStuff() from pitchblock import * # pitchBlock.pitchTwist() and pitchBlock.printSt

Re: [Haskell-cafe] Initializing GHC from Python

2008-12-23 Thread Jason Dusek
I upmodded this on Reddit. Thank you for your work. -- Jason Dusek -- http://mail.python.org/mailman/listinfo/python-list

Re: Beep

2008-12-23 Thread Ivan Illarionov
On Dec 22, 3:16 am, Jeffrey Barish wrote: > I use sys.stdout.write('\a') to beep.  It works fine on Kubuntu, but not on > two other platforms (one of which is Ubuntu).  I presume that the problem > is due to a system configuration issue.  Can someone point me in the right > direction?  Thanks. > -

Re: Get applications to open a given file (Mac and, or Windows)

2008-12-23 Thread Tommy Nordgren
On Dec 23, 2008, at 5:29 PM, riklau...@gmail.com wrote: Under Linux/Unix I use GIO (pygobject) or gnome-vfs-python to get a list of installed applications that can open given file (for example image in graphics software). Is there something that can be used for MS Windows or Mac OS X? -- http:/

Re: pseudo terminal usage from Python?

2008-12-23 Thread Grant Edwards
On 2008-12-23, s...@pobox.com wrote: > Grant> Are you sure it's not Python buffering its input? Have you tried > Grant> "python -u mympstat.py"? > > >> Nope. -u unbuffers stdout and stderr, not stdin. It really must be > >> mpstat being uncooperative. > > Grant> That's not w

Re: PIL - font kerning

2008-12-23 Thread Ivan Illarionov
On Dec 23, 11:22 pm, Ivan Illarionov wrote: > On 23 дек, 16:44, carsn wrote: > > > Hey all, > > > anybody know, if there´s a way to specify the kerning of a font, when > > you draw text with PIL? > > > I´d like to achieve the same effect that you get, when you set a > > negative kerning in Gimp/P

Re: Are python objects thread-safe?

2008-12-23 Thread Aaron Brady
On Dec 23, 7:30 am, Duncan Booth wrote: > Aaron Brady wrote: > > Th.1   Th.2 > > a=X > >        a=Y > > a=Z > > > You are saying that if 'a=Z' interrupts 'a=Y' at the wrong time, the > > destructor for 'X' or 'Y' might not get called.  Correct?  In serial > > flow, the destructor for X is called,

Re: PIL - font kerning

2008-12-23 Thread Ivan Illarionov
On 23 дек, 16:44, carsn wrote: > Hey all, > > anybody know, if there´s a way to specify the kerning of a font, when > you draw text with PIL? > > I´d like to achieve the same effect that you get, when you set a > negative kerning in Gimp/Photshop - ie. reduce the spacing between > glyphs. > > Can

[ANN] Python 2.5.4 (final)

2008-12-23 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.5.4 (final). Python 2.5.3 unfortunately contained an incorrect patch that could cause interpreter crashes; the only change in Python 2.5.4 relative to 2.5.4 is the reversal of this patc

Re: pseudo terminal usage from Python?

2008-12-23 Thread skip
Grant> Are you sure it's not Python buffering its input? Have you tried Grant> "python -u mympstat.py"? >> Nope. -u unbuffers stdout and stderr, not stdin. It really must be >> mpstat being uncooperative. Grant> That's not what my python man page says: Grant>-u

2to3 used in the Shootout

2008-12-23 Thread bearophileHUGS
They have translated the Python benchmarks of the Shootout site from Py2 to Py3 using 2to3: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=python3 It shows some "performance bugs" of Python3 itself (especially regarding the binary-trees benchmark, that was unexpected by me), an

Re: pseudo terminal usage from Python?

2008-12-23 Thread Grant Edwards
On 2008-12-23, s...@pobox.com wrote: > > Grant> Are you sure it's not Python buffering its input? Have you tried > Grant> "python -u mympstat.py"? > > Nope. -u unbuffers stdout and stderr, not stdin. It really must be mpstat > being uncooperative. That's not what my python man page say

Symposium “Visualization and Human-Computer” wit hin the IRF’2009 Conference – Announce & Call for Papers

2008-12-23 Thread tava...@fe.up.pt
(Apologies for cross-posting) Symposium on “Visualization and Human-Computer” 3rd International Conference on Integrity, Reliability & Failure (IRF’2009) Facult

Re: python3 urlopen(...).read() returns bytes

2008-12-23 Thread ajaksu
On Dec 23, 12:51 pm, Christian Heimes wrote: > If you want to do it right ... It should be a clean patch against the > py3k svn branch Done > including documentation This thread is a good start :) > and a unit test. Doing this now. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Are python objects thread-safe?

2008-12-23 Thread Gabriel Genellina
En Tue, 23 Dec 2008 11:30:25 -0200, Duncan Booth escribió: Aaron Brady wrote: Th.1 Th.2 a=X a=Y a=Z You are saying that if 'a=Z' interrupts 'a=Y' at the wrong time, the destructor for 'X' or 'Y' might not get called. Correct? In serial flow, the destructor for X is called, then

Re: pseudo terminal usage from Python?

2008-12-23 Thread skip
Grant> Are you sure it's not Python buffering its input? Have you tried Grant> "python -u mympstat.py"? Nope. -u unbuffers stdout and stderr, not stdin. It really must be mpstat being uncooperative. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: pseudo terminal usage from Python?

2008-12-23 Thread Grant Edwards
On 2008-12-23, s...@pobox.com wrote: > Grant> Are you sure it's not Python buffering its input? Have you tried > Grant> "python -u mympstat.py"? > > Hmmm... No, I hadn't considered that. I'll check it out. Thanks... > > Grant> I had a Linux pty example running once upon a time. If

[Offtopic] Re: I always wonder ...

2008-12-23 Thread Pierre-Alain Dorange
r wrote: > [...] > Well that shows that even lads with tiny nads can be brave, any of the > other trolls want to expose them selfs? This thread is offtopic, please just keep silent and let it be closed... -- Pierre-Alain Dorange Ce message est sous li

Re: Python's popularity

2008-12-23 Thread Pierre-Alain Dorange
r wrote: > > I've already stated, and you've already proven, that it's pretty trivial > > to ascertain my true identity, if one actually cares. OTOH, that's > > *not* the case with you. Who is hiding now? > > I told you, my name is Thurstan Howell III. Do you want to know my > favorite color t

Re: wxPython.button.disabled still catching clicks

2008-12-23 Thread Mike Driscoll
On Dec 23, 7:27 am, mynthon wrote: > On Dec 23, 11:58 am, Aaron Brady wrote: > > > > > On Dec 23, 4:50 am, mynthon wrote: > > > > Hello! (sorry for my english) > > > > I have a problem with buttons in wxPython. When button is disabled > > > (by .Disable() or .Enable(False)) it is grayed out but

Re: String Format Error.

2008-12-23 Thread Paulo Repreza
Thank You! On Tue, Dec 23, 2008 at 3:49 AM, Steve Holden wrote: > Chris Rebert wrote: > > On Mon, Dec 22, 2008 at 10:19 PM, Paulo Repreza > wrote: > >> Hi, > >> > >> I'm a newbie with python and I recently bought Beginning with Python > (Which > >> is a book I recommend) but the problem that I

Re: On Whose Desktop

2008-12-23 Thread Arnaud Delobelle
Aaron Brady writes: > +1 whose (posessive) -1 posessive :) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: On Whose Desktop

2008-12-23 Thread Aaron Brady
On Dec 23, 8:19 am, Steve Holden wrote: > Fuzzyman wrote: > > On Dec 23, 12:06 pm, Steve Holden wrote: > >> Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry: > > >>  http://onyourdesktop.blogspot.com/ > > >> Who would you like to see profiled next? > > > Guido (of course), Br

Re: no sign() function ?

2008-12-23 Thread Mark Dickinson
On Dec 23, 4:27 pm, ajaksu wrote: > Is "x ** 0 > 0." instead of "atan2(x, -1.) > 0." unreliable across > platforms? x**0 doesn't distinguish between x = -0.0 and x = 0.0. I suspect you're confusing -0.0**0.0 with (-0.0)**0.0. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's popularity

2008-12-23 Thread r
Benjamin Kaplin wrote: You're the one who keeps bringing up the need to spread python. For most people, this is a forum to ask questions and have experts respond to them. Most people who post here aren't looking for your opinion, they want answers. If you know the answer to a question, answer it. I

Get applications to open a given file (Mac and, or Windows)

2008-12-23 Thread riklau...@gmail.com
Under Linux/Unix I use GIO (pygobject) or gnome-vfs-python to get a list of installed applications that can open given file (for example image in graphics software). Is there something that can be used for MS Windows or Mac OS X? -- http://mail.python.org/mailman/listinfo/python-list

Re: no sign() function ?

2008-12-23 Thread ajaksu
On Dec 22, 9:18 am, Christian Heimes wrote: > Sure? :) Are you aware that the IEEE 754 standard makes a difference > between the floats +0.0 and -0.0? > > from math import atan2 > def sign(x): >     if x > 0 or (x == 0 and atan2(x, -1.) > 0.): >         return 1 >     else: >         return -1 Is

Re: no sign() function ?

2008-12-23 Thread Mark Dickinson
On Dec 23, 2:59 pm, Christian Heimes wrote: > All algorithm including my own suffer from one mistake. Nobody accounts > for NaN (not a number). You have to check for NaNs, too. NaNs have no > sign at all. I think that's not quite true: NaNs have a sign; it's just not accorded any particular mea

Re: Python's popularity

2008-12-23 Thread r
On Dec 23, 8:21 am, Thorsten Kampe wrote: > You don't have a single clue about neither Python nor Ruby: > 'According to the Ruby FAQ, "If you like Perl, you will like Ruby and be > right at home with its syntax. [...] If you like Python, you may or may > not be put off by the huge difference in de

Re: Python's popularity

2008-12-23 Thread r
On Dec 23, 10:12 am, je.s.t...@hehxduhmp.org wrote: > r wrote: > > You are the epitimy of an internet troll. A troll tries to hide his > > identity. Why are you so concerned about your TRUE identity. Are the > > I've already stated, and you've already proven, that it's pretty trivial > to ascertai

Re: pseudo terminal usage from Python?

2008-12-23 Thread skip
Grant> Are you sure it's not Python buffering its input? Have you tried Grant> "python -u mympstat.py"? Hmmm... No, I hadn't considered that. I'll check it out. Thanks... Grant> I had a Linux pty example running once upon a time. If "python Grant> -u" doesn't work post again,

Re: iterating initalizations

2008-12-23 Thread Steve Holden
D'Arcy J.M. Cain wrote: > On Tue, 23 Dec 2008 10:20:59 -0500 > Steve Holden wrote: >> D'Arcy J.M. Cain wrote: >>> Well, if all you want is a loop: >>> >>> for v in vars: >>> locals()[v] = [] >>> >> Note that this isn't guaranteed to work. While locals() will return a >> dict containing

Re: Python's popularity

2008-12-23 Thread r
On Dec 23, 8:21 am, Thorsten Kampe wrote: > * r (Mon, 22 Dec 2008 10:44:32 -0800 (PST))> > > > Steve Holden > > > What makes you assume this is a zero-sum game, and that Python won't > > > survive if any other language becomes popular. Every language borrows > > > from those that came before it. T

Re: pseudo terminal usage from Python?

2008-12-23 Thread Grant Edwards
On 2008-12-23, s...@pobox.com wrote: > > I ran into an interesting problem yesterday. The mpstat(1) command on > Solaris formats its output like so: > > CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl > 0 42 1 1184 812 265 227 12 44 370 1131

Re: I always wonder ...

2008-12-23 Thread r
On Dec 22, 11:12 pm, ajaksu wrote: > On Dec 22, 9:24 pm, r wrote: > > > You know what i hate more than a troll, a spineless jellyfish who goes > > around rating peoples post with one star. You are the lowest form of > > life. You are the same type of person who would key someones car in > > the p

Re: iterating initalizations

2008-12-23 Thread D'Arcy J.M. Cain
On Tue, 23 Dec 2008 10:20:59 -0500 Steve Holden wrote: > D'Arcy J.M. Cain wrote: > > Well, if all you want is a loop: > > > > for v in vars: > > locals()[v] = [] > > > Note that this isn't guaranteed to work. While locals() will return a > dict containing the names and values from th

Re: Python's popularity

2008-12-23 Thread Adrian Cherry
r wrote in news:ae1bb365-7755-4c5f-8166-e704c51a7...@i20g2000prf.googlegro ups.com: > > Oh Steve... Listen, my words are ment as a wake-up-call to > all who still love Python, and i believe you are one of > them. Maybe old age has slowed your hand, that's OK, Us > "youngsters" will take the hel

Re: iterating initalizations

2008-12-23 Thread Aaron Stepp
import random from rtcmix import * from chimes_source import * # Chime.play() from rhythmblock import * # rhythmBlock.rhythmTwist() and rhythmBlock.printStuff() from pitchblock import * # pitchBlock.pitchTwist() and pitchBlock.printStuff() from lenEval import * #greaterThan.sovler() indexra

Re: pseudo terminal usage from Python?

2008-12-23 Thread skip
Steve> Look at the pexpect module - you can run interactive tasks Steve> through that. Thanks. Worked like a charm. -- Skip Montanaro - s...@pobox.com - http://smontanaro.dyndns.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: iterating initalizations

2008-12-23 Thread Steve Holden
D'Arcy J.M. Cain wrote: > On Mon, 22 Dec 2008 22:32:17 -0500 > Aaron Stepp wrote: >> Instead of writing a long list of initializations like so: >> >> A = [ ] >> B = [ ] >> ... >> Y = [ ] >> Z = [ ] >> >> I'd like to save space by more elegantly turning this into a loop. If > > Well, if all you

Re: print to console without a line break

2008-12-23 Thread Qian Xu
Lie Ryan wrote: > If you don't mind an extra space, you can use this: > > print 'Testing something ...', > # note the trailing comma Thanks. However, the contents will be saved in buffer and will not be shown until print "(last piece)" sys.stdout.flush() can solve this problem :-) -- http://ma

Re: print to console without a line break

2008-12-23 Thread Qian Xu
Albert Hopkins wrote: > On Tue, 2008-12-23 at 13:18 +, Lie Ryan wrote: > > Probably because your stdout is line-buffered. Try: > > sys.stdout.write("Testing something...") > sys.stout.flush() # flush the stdout buffer Thanks. This works for me ^^) -- http://mail.python.org/mailman/listinfo/

Re: no sign() function ?

2008-12-23 Thread Christian Heimes
All algorithm including my own suffer from one mistake. Nobody accounts for NaN (not a number). You have to check for NaNs, too. NaNs have no sign at all. You could also try to do some fancy bit mask operation like >>> ord(struct.pack("d", 0.)[7]) & 0x80 0 >>> ord(struct.pack("d", -0.)[7]) & 0x80

Re: python3 urlopen(...).read() returns bytes

2008-12-23 Thread Christian Heimes
ajaksu wrote: > On Dec 22, 9:05 pm, Christian Heimes wrote: >> ajaksu schrieb: >> >>> That said, a "decode to declared HTTP header encoding" version of >>> urlopen could be useful to give some users the output they want (text >>> from network io) or to make it clear why bytes is the safe way. >> Y

Re: print to console without a line break

2008-12-23 Thread Albert Hopkins
On Tue, 2008-12-23 at 13:18 +, Lie Ryan wrote: > On Tue, 23 Dec 2008 11:50:59 +0100, Qian Xu wrote: > > > Hello All, > > > > Is it possible to print something to console without a line break? > > > > I tried: > > sys.stdout.write("Testing something ...") // nothing will be printed > > ti

Re: pseudo terminal usage from Python?

2008-12-23 Thread Steve Holden
s...@pobox.com wrote: > I ran into an interesting problem yesterday. The mpstat(1) command on > Solaris formats its output like so: > > CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl > 0 42 1 1184 812 265 227 12 44 370 11316 2 0 93 >

Re: Python's popularity

2008-12-23 Thread Benjamin Kaplan
On Tue, Dec 23, 2008 at 12:05 AM, r wrote: > On Dec 22, 10:09 pm, Ben Kaplan wrote: > > That's just because most of us don't say anything unless we have > > something useful to say. We prefer to let the experts answer the > > questions, but we read the threads so we can benefit from them. > > OK

Re: iterating initalizations

2008-12-23 Thread D'Arcy J.M. Cain
On Mon, 22 Dec 2008 22:32:17 -0500 Aaron Stepp wrote: > Instead of writing a long list of initializations like so: > > A = [ ] > B = [ ] > ... > Y = [ ] > Z = [ ] > > I'd like to save space by more elegantly turning this into a loop. If Well, if all you want is a loop: for v in vars:

Re: Python's popularity

2008-12-23 Thread Thorsten Kampe
* r (Mon, 22 Dec 2008 10:44:32 -0800 (PST))> > Steve Holden > > What makes you assume this is a zero-sum game, and that Python won't > > survive if any other language becomes popular. Every language borrows > > from those that came before it. Terms like "outright plagiarism" don't > > encourage ra

Re: On Whose Desktop

2008-12-23 Thread Steve Holden
Fuzzyman wrote: > On Dec 23, 12:06 pm, Steve Holden wrote: >> Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry: >> >> http://onyourdesktop.blogspot.com/ >> >> Who would you like to see profiled next? > > Guido (of course), Brett Cannon, Martin v Loewis, Jim Hugunin, Ted > Leu

Re: Python's popularity

2008-12-23 Thread Lie Ryan
On Mon, 22 Dec 2008 21:05:22 -0800, r wrote: > On Dec 22, 10:09 pm, Ben Kaplan wrote: >> That's just because most of us don't say anything unless we have >> something useful to say. We prefer to let the experts answer the >> questions, but we read the threads so we can benefit from them. > > OK

PIL - font kerning

2008-12-23 Thread carsn
Hey all, anybody know, if there´s a way to specify the kerning of a font, when you draw text with PIL? I´d like to achieve the same effect that you get, when you set a negative kerning in Gimp/Photshop - ie. reduce the spacing between glyphs. Can PIL do that or do I use another lib for that? Th

Re: SuSE11.1 eclipse 64 pydev can't add python path

2008-12-23 Thread Benjamin Kaplan
On Tue, Dec 23, 2008 at 7:49 AM, Reimar Bauer wrote: > Hi > > I can install pydev using the update manager in eclipse for 64 bit from the > SuSE 11.1 repo. But I can't configure pydev without crashing it. > I can select the interpreter /usr/bin/python > and I do see the System PYTHONPATH > Forced

pseudo terminal usage from Python?

2008-12-23 Thread skip
I ran into an interesting problem yesterday. The mpstat(1) command on Solaris formats its output like so: CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 42 1 1184 812 265 227 12 44 370 11316 2 0 93 1 25 1 933 4472

Re: no sign() function ?

2008-12-23 Thread Pierre-Alain Dorange
Steven D'Aprano wrote: > But this is just duplicating what timeit already does. Trust me, learn to > use it, you won't be sorry. Here's a trick that took me a long time to > learn: instead of copying your functions into the setup code of timeit, > you can just import them. Thanks for the advise,

Re: Are python objects thread-safe?

2008-12-23 Thread Duncan Booth
Aaron Brady wrote: > Th.1 Th.2 > a=X >a=Y > a=Z > > You are saying that if 'a=Z' interrupts 'a=Y' at the wrong time, the > destructor for 'X' or 'Y' might not get called. Correct? In serial > flow, the destructor for X is called, then Y. No, the destructors will be called, but the d

Re: wxPython.button.disabled still catching clicks

2008-12-23 Thread mynthon
On Dec 23, 11:58 am, Aaron Brady wrote: > On Dec 23, 4:50 am, mynthon wrote: > > > > > Hello! (sorry for my english) > > > I have a problem with buttons in wxPython. When button is disabled > > (by .Disable() or .Enable(False)) it is grayed out but still receive > > clicks. > > > Eg. i have butto

Re: print to console without a line break

2008-12-23 Thread Lie Ryan
On Tue, 23 Dec 2008 11:50:59 +0100, Qian Xu wrote: > Hello All, > > Is it possible to print something to console without a line break? > > I tried: > sys.stdout.write("Testing something ...") // nothing will be printed > time.sleep(1) > sys.stdout.write("done\n") // now, the whole string w

SuSE11.1 eclipse 64 pydev can't add python path

2008-12-23 Thread Reimar Bauer
Hi I can install pydev using the update manager in eclipse for 64 bit from the SuSE 11.1 repo. But I can't configure pydev without crashing it. I can select the interpreter /usr/bin/python and I do see the System PYTHONPATH Forced builtin libs also looks good. But Apply gives me # # An unexpected

Re: Why MyHDL?

2008-12-23 Thread Stef Mientki
hello Jan, Jan Decaluwe wrote: Hello: MyHDL is a Python package for using Python as a Hardware Description Language. A new release is upcoming, and on this occasion we have prepared a page about why MyHDL may be useful to you: http://www.myhdl.org/doku.php/why Very Interesting, I'm no e

Re: On Whose Desktop

2008-12-23 Thread Bruno Desthuilliers
Steve Holden a écrit : Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry: http://onyourdesktop.blogspot.com/ Who would you like to see profiled next? The effbot ? regards Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: On Whose Desktop

2008-12-23 Thread Fuzzyman
On Dec 23, 12:06 pm, Steve Holden wrote: > Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry: > >  http://onyourdesktop.blogspot.com/ > > Who would you like to see profiled next? > > regards >  Steve > -- > Steve Holden        +1 571 484 6266   +1 800 494 3119 > Holden Web LLC

On Whose Desktop

2008-12-23 Thread Steve Holden
Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry: http://onyourdesktop.blogspot.com/ Who would you like to see profiled next? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.pyth

Re: Very basic question

2008-12-23 Thread Sengly
Thank you very much everyone. Regards, -- Sengly -- http://mail.python.org/mailman/listinfo/python-list

Why MyHDL?

2008-12-23 Thread Jan Decaluwe
Hello: MyHDL is a Python package for using Python as a Hardware Description Language. A new release is upcoming, and on this occasion we have prepared a page about why MyHDL may be useful to you: http://www.myhdl.org/doku.php/why Regards, Jan -- Jan Decaluwe - Resources bvba - http://www

Re: String Format Error.

2008-12-23 Thread Steve Holden
Chris Rebert wrote: > On Mon, Dec 22, 2008 at 10:19 PM, Paulo Repreza wrote: >> Hi, >> >> I'm a newbie with python and I recently bought Beginning with Python (Which >> is a book I recommend) but the problem that I'm facing it's the following: >> >> This is the code: >> >> #!/usr/bin/python2.5 >>

Re: Very basic question

2008-12-23 Thread Bryan Olson
Sengly wrote: I can hack it by doing eval('1.0*12/5') but is there any better method? Where did you get the string? If you generated it, you might as well make one or both the operands float to begin with. If you got it as input, calling eval() on it is a world of security hurt. The right w

Re: Very basic question

2008-12-23 Thread Sion Arrowsmith
Sengly wrote: >I would like to calculate a string expression to a float. For example, >I have ('12/5') and I want 2.4 as a result. I tried to use eval but it >only gives me 2 instead of 2.5 py> from __future__ import division py> print eval('12/5') 2.4 py> print eval('12//5') 2 Or switch to 3.0

Re: Very basic question

2008-12-23 Thread John Machin
On Dec 23, 9:49 pm, Sengly wrote: > I can hack it by doing eval('1.0*12/5') but is there any better method? from __future__ import division -- http://mail.python.org/mailman/listinfo/python-list

Re: print to console without a line break

2008-12-23 Thread Qian Xu
Qian Xu wrote: > Hello All, > > Is it possible to print something to console without a line break? > > I tried: > sys.stdout.write("Testing something ...") // nothing will be printed > time.sleep(1) > sys.stdout.write("done\n") // now, the whole string will be printed > > What I want, is

print to console without a line break

2008-12-23 Thread Qian Xu
Hello All, Is it possible to print something to console without a line break? I tried: sys.stdout.write("Testing something ...") // nothing will be printed time.sleep(1) sys.stdout.write("done\n") // now, the whole string will be printed What I want, is to see "Testing something ..." first

Re: wxPython.button.disabled still catching clicks

2008-12-23 Thread Aaron Brady
On Dec 23, 4:50 am, mynthon wrote: > Hello! (sorry for my english) > > I have a problem with buttons in wxPython. When button is disabled > (by .Disable() or .Enable(False)) it is grayed out but still receive > clicks. > > Eg. i have button that disable itself, runs long action and enable > itself

wxPython.button.disabled still catching clicks

2008-12-23 Thread mynthon
Hello! (sorry for my english) I have a problem with buttons in wxPython. When button is disabled (by .Disable() or .Enable(False)) it is grayed out but still receive clicks. Eg. i have button that disable itself, runs long action and enable itself: def onClick(self, evt): self.btn.Enable(Fal

  1   2   >