Re: faster than list.extend()

2009-11-17 Thread Hyunchul Kim
Thank Tim, Raymond, and all. In my test, Tim's t1 was fastest and Raymond's triple3 is very near to Tim's t1. Anyway both of them took only 6~7% time of my original .extend() version. I think that following n_ple() is a good generalized function that was 1~3% slower than t1() and triple3() for "t

Re: Python & Go

2009-11-17 Thread Donn
On Saturday 14 November 2009 22:23:40 Paul Rubin wrote: > they'll have to call it Go2 Lol. Or we could fork it and call it Gosub ... and never return! \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Get attribute this way

2009-11-17 Thread Diez B. Roggisch
King schrieb: "eval" can solve this problem right away but I am concerned about security issues. If not "eval" could you suggest something more efficient way. It won't be a big deal to change the format as application is still at development stage? If you don't want to use eval (which is a good

Re: Get attribute this way

2009-11-17 Thread Carl Banks
On Nov 16, 11:37 pm, King wrote: > "eval" can solve this problem right away but I am concerned about > security issues. If not "eval" could you suggest something more > efficient way. It won't be a big deal to change the format as > application is still at development stage? You are stuck parsin

Re: ZipFile - file adding API incomplete?

2009-11-17 Thread Diez B. Roggisch
Glenn Maynard schrieb: I want to do something fairly simple: read files from one ZIP and add them to another, so I can remove and replace files. This led me to a couple things that seem to be missing from the API. The simple approach would be to open each file in the source ZIP, and hand it off

Accessing a Web server --- how?

2009-11-17 Thread Virgil Stokes
If one goes to the following URL: http://www.nordea.se/Privat/Spara%2boch%2bplacera/Strukturerade%2bprodukter/Aktieobligation%2bNr%2b99%2bEuropa%2bAlfa/973822.html it contains a link (click on "Current courses NBD AT99 3113A") to: http://service.nordea.com/nordea-openpages/six.action?target=/nord

TODO and FIXME tags

2009-11-17 Thread Yasser Almeida Hernández
Hi all.. Sorry if this question sound elemental. How is the sintaxis for set the TODO and FIXME tags...? Thanks -- Lic. Yasser Almeida Hernández Center of Molecular Inmunology (CIM) Nanobiology Group P.O.Box 16040, Havana, Cuba Phone: (537) 271-7933, ext. 221 ---

Re: A different take on finding primes

2009-11-17 Thread Tobiah
>> Let me >> be clear, given 2min, how many primes can you find, they need not be in >> order or consecutive. Do they have to go from low to high? :( ) -- http://mail.python.org/mailman/listinfo/python-list

Re: Logic operators with "in" statement

2009-11-17 Thread Richard Brodie
"Mr.SpOOn" wrote in message news:mailman.492.1258380560.2873.python-l...@python.org... > In [13]: ('b3' and '5') in l or ('3' and 'b3') in l > Out[13]: True For anything more than the simplest cases, you might want use sets. That might be the correct data type from the start, depending on whe

Please recommend the books that might be helpful to learn Python :)

2009-11-17 Thread Psi
as the subject says, any books? -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing a Web server --- how?

2009-11-17 Thread Chris Rebert
On Mon, Nov 16, 2009 at 2:14 AM, Virgil Stokes wrote: > If one goes to the following URL: > http://www.nordea.se/Privat/Spara%2boch%2bplacera/Strukturerade%2bprodukter/Aktieobligation%2bNr%2b99%2bEuropa%2bAlfa/973822.html > > it contains a link (click on "Current courses NBD AT99 3113A") to: > htt

Re: TODO and FIXME tags

2009-11-17 Thread Chris Rebert
2009/11/16 Yasser Almeida Hernández : > Hi all.. > Sorry if this question sound elemental. > How is the sintaxis for set the TODO and FIXME tags...? There is no special syntax for those. Some people use them in comments, but it's just a convention. Cheers, Chris -- http://blog.rebertia.com -- ht

Re: Create object from variable indirect reference?

2009-11-17 Thread jhermann
On 10 Nov., 17:03, NickC wrote: > Many thanks for the replies.  getattr() works great: You can get a little more versatile and even specify the location of the name (i.e. the module / package name) without pre-importing it, like this... def importName(modulename, name=None): """ Import ident

Re: TODO and FIXME tags

2009-11-17 Thread Ben Finney
Chris Rebert writes: > 2009/11/16 Yasser Almeida Hernández : > > How is the sintaxis for set the TODO and FIXME tags...? > > There is no special syntax for those. Some people use them in > comments, but it's just a convention. This is true. However, the convention is fairly well established, and

Re: Get attribute this way

2009-11-17 Thread Bruno Desthuilliers
King a écrit : Python's getattr, setattr and __getattribute__ commands s/commands/functions/ works fine with python types. For example: print o.__getattribute__("name") A very few corner cases set aside - the main one being inside a custom __getattribute__ method -, you should not directly

Re: overriding __getitem__ for a subclass of dict

2009-11-17 Thread Steve Howell
On Nov 16, 10:11 pm, Carl Banks wrote: > On Nov 16, 10:32 am, Steve Howell wrote: > > > > > On Nov 16, 2:35 am, Carl Banks wrote: > > > > On Nov 15, 2:52 pm, Steve Howell wrote: > > > > > Does anybody have any links that points to the rationale for ignoring > > > > instance definitions of __get

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-17 Thread Mark Dickinson
On Nov 16, 4:54 pm, Steve Ferg wrote: > I've often thought that a language with this kind of block-free syntax > would be nice and intuitive: > >     if then >         do stuff >     elif then >         do stuff >     else >         do stuff >     endif > > Note that you do not need block delimi

Re: faster than list.extend()

2009-11-17 Thread Peter Otten
Gabriel Genellina wrote: > En Mon, 16 Nov 2009 19:30:27 -0300, Hyunchul Kim > escribió: > >> I want to improve speed of following simple function. >> Any suggestion? >> >> ** >> def triple(inputlist): >> results = [] >> for x in inputlist: >> results.extend([x,x,x]) >> return r

YIELD_VALUE Byte Code

2009-11-17 Thread Andreas Löscher
Hi, I am not sure if this is the right newsgroup, so if not don't hesitate to tell me. I am developed a Python to C compiler, so that Byte Code files automatically can be translated into C Extension Modules. (And it works pretty well --> http://www.coremountains.com/products/bytecoat/) While deve

Re: Unexpected python exception

2009-11-17 Thread Andreas Löscher
Hi, unfortunatley I cannot reproduce your error. Which Python Version do you use? The expected case in this scenario is that the exception is thrown, as you import os in A() where it is stored in the local namespace of the function. I tested it with Python 2.4, 2.5 and 2.6 and in both cases an ex

Re: Unexpected python exception

2009-11-17 Thread Andreas Löscher
Python searches for Variables not only in local or global scoop but also in __builtins__. If you do something like __builtins__.os = os, than this variable should be accessible global. If you then write something like: def B(): os.stat("/") import os Python recognises on compile

Re: TODO and FIXME tags

2009-11-17 Thread Martin P. Hellwig
Ben Finney wrote: Chris Rebert writes: 2009/11/16 Yasser Almeida Hernández : How is the sintaxis for set the TODO and FIXME tags...? There is no special syntax for those. Some people use them in comments, but it's just a convention. This is true. However, the convention is fairly well esta

Re: Calling Python functions from Excel

2009-11-17 Thread Chris Withers
Cannonbiker wrote: Hi, unfortunately is my question about server COM (win32com) http://groups.google.com/group/comp.lang.python/browse_thread/thread/ee804cec7f58c6a7# without answer. Please I need Calling Python functions from Excel and receive result back in Excel. Can me somebody advise simple

Re: Logic operators with "in" statement

2009-11-17 Thread Mr.SpOOn
Thanks everybody for all the answers and explanations. In the end maybe it is simpler if I use sets for these tests. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Code for finding the 1000th prime

2009-11-17 Thread Stefan Behnel
Robert P. J. Day, 15.11.2009 15:44: > On Sun, 15 Nov 2009, mrholtsr wrote: > >> I am absolutely new to python and barely past beginner in programming. >> Also I am not a mathematician. Can some one give me pointers for >> finding the 1000th. prime for a course I am taking over the internet >> on I

Re: python simply not scaleable enough for google?

2009-11-17 Thread Aaron Watters
> I don't think Python and Go address the same set of programmer > desires.  For example, Go has a static type system.  Some programmers > find static type systems to be useless or undesirable.  Others find > them extremely helpful and want to use them them.  If you're a > programmer who wants a s

Re: python gui builders

2009-11-17 Thread me
Read the OP. No, read it again. sturlamolden wrote: On 16 Nov, 11:39, sturlamolden wrote: If you are fine with Microsoft only, you can use Windows Forms with MS Visual Studio and IronPython. I also forgot to mention: If you can restrict yourself to Windows, you can always use Visual Basic

XML root node attributes

2009-11-17 Thread Slafs
Hi I'm little confused about adding attributes to the root node when creating an XML document. Can I do this using minidom or something else. I can't find anything that would fit my needs. i would like to have something like this: Please help. Regards. -- http://mail.python.or

Re: python simply not scaleable enough for google?

2009-11-17 Thread David Cournapeau
On Tue, Nov 17, 2009 at 10:48 PM, Aaron Watters wrote: > >> I don't think Python and Go address the same set of programmer >> desires.  For example, Go has a static type system.  Some programmers >> find static type systems to be useless or undesirable.  Others find >> them extremely helpful and w

Re: ZipFile - file adding API incomplete?

2009-11-17 Thread Dave Angel
Diez B. Roggisch wrote: Glenn Maynard schrieb: I want to do something fairly simple: read files from one ZIP and add them to another, so I can remove and replace files. This led me to a couple things that seem to be missing from the API. The correct approach is to copy the data directly, s

Re: Code for finding the 1000th prime

2009-11-17 Thread Carsten Haese
Stefan Behnel wrote: > Robert P. J. Day, 15.11.2009 15:44: >> On Sun, 15 Nov 2009, mrholtsr wrote: >> >>> I am absolutely new to python and barely past beginner in programming. >>> Also I am not a mathematician. Can some one give me pointers for >>> finding the 1000th. prime for a course I am takin

Re: XML root node attributes

2009-11-17 Thread Stefan Behnel
Slafs, 17.11.2009 15:19: > I'm little confused about adding attributes to the root node when > creating an XML document. > Can I do this using minidom or something else. Yes, you /can/, but you /should/ use something else. > I can't find anything that would fit my needs. > > i would like to hav

RE: XML root node attributes

2009-11-17 Thread Matt Mitchell
--- The information contained in this electronic message and any attached document(s) is intended only for the personal and confidential use of the designated recipients named above. This message may be confidential. If the reader of this message is not the i

Re: Please recommend the books that might be helpful to learn Python :)

2009-11-17 Thread silvercl
On Nov 17, 7:18 am, Psi wrote: > as the subject says, > > any books? This is one of the good books available on the internet... http://diveintopython.org/ I myself liked this book very much (to start with). Also, on the website, on the right-hand-side it mentions about other books. -- Silver, C

ast manipulation

2009-11-17 Thread Tsize
Hello, I am hoping for a little help. I have been playing with the python ast module and have run into an issue that I need a little push on. I would like to be able to change a specific element in a specific node in an ast then compile the resulting ast. Consider the simplified example below w

Re: overriding __getitem__ for a subclass of dict

2009-11-17 Thread Scott David Daniels
Steve Howell wrote: ... Eventually, I realized that it was easier to just monkeypatch Django while I was in test mode to get a more direct hook into the behavior I was trying to monitor, and then I didn't need to bother with overriding __getitem__ or creating complicated wrapper objects Sin

Re: Accessing a Web server --- how?

2009-11-17 Thread Dave Angel
Virgil Stokes wrote: If one goes to the following URL: http://www.nordea.se/Privat/Spara%2boch%2bplacera/Strukturerade%2bprodukter/Aktieobligation%2bNr%2b99%2bEuropa%2bAlfa/973822.html it contains a link (click on "Current courses NBD AT99 3113A") to: http://service.nordea.com/nordea-openpa

Re: python gui builders

2009-11-17 Thread Scott David Daniels
me wrote: I have looked at the Tk stuff that is built into Python -> not acceptable. Such insightful analysis, and it is _so_ helpful in stating your needs. [a lot of guff about unacceptable things] What Python gui builder is well supported, does not require me to learn another framework/

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-17 Thread sjm
On Nov 16, 12:54 pm, Steve Ferg wrote: > Does anybody know a language with this kind of syntax for > ifThenElseEndif? Modern-day COBOL: IF some-condition do-something ELSE do-something-else END-IF. The period is also meaningful as a statement terminator in COBOL, so it

RE: New syntax for blocks

2009-11-17 Thread Jonathan Saxton
On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote: >> Congratulations, you just reinvented one of the most infamous source of >> bugs in C, C++, Java, PHP, javascript and quite a few other languages. >> Believe it or not, but not allowing this in Python was a very deliberate >> design

Time travel

2009-11-17 Thread Lee Merrill
I'm seeing an anomaly in the python time function on March 9, 2008 (the "spring foward" time): >>> time.mktime((2008, 3, 9, 2, 59, 59, 0, 0, -1)) 1205049599.0 >>> time.mktime((2008, 3, 9, 3, 0, 0, 0, 0, -1)) 1205046000.0 Does anyone have an idea as to what might cause a 4000 seconds backwards jum

Re: Code for finding the 1000th prime

2009-11-17 Thread Himanshu
2009/11/15 mrholtsr : > I am absolutely new to python and barely past beginner in programming. > Also I am not a mathematician. Can some one give me pointers for > finding the 1000th. prime for a course I am taking over the internet > on Introduction to Computer Science and Programming. Thanks, Ray

Re: ZipFile - file adding API incomplete?

2009-11-17 Thread Scott David Daniels
Glenn Maynard wrote: I want to do something fairly simple: read files from one ZIP and add them to another, so I can remove and replace files. This led me to a couple things that seem to be missing from the API. zip.write() only takes the filename and compression method, not a ZipInfo; wri

Re: Time travel

2009-11-17 Thread Lee Merrill
And I can't do arithmetic, it is actually about 3600--never mind! On Nov 17, 10:37 am, Lee Merrill wrote: > I'm seeing an anomaly in the python time function on March 9, 2008 > (the "spring foward" time): > > >>> time.mktime((2008, 3, 9, 2, 59, 59, 0, 0, -1)) > 1205049599.0 > >>> time.mktime((20

Re: python simply not scaleable enough for google?

2009-11-17 Thread Paul Boddie
On 17 Nov, 14:48, Aaron Watters wrote: > > ... and I still have an issue with the whole "Python is slow" > meme.  The reason NASA doesn't build a faster Python is because > Python *when augmented with FORTRAN libraries that have been > tested and optimized for decades and are worth billions of dol

Re: SCGIServer and unusal termination

2009-11-17 Thread Diez B. Roggisch
Eden Kirin wrote: > Hi there, > > I'm playing with SCGIServer > (http://vmlinux.org/cgi-bin/dwww/usr/share/doc/python-scgi/guide.html), > everything works just fine, but one thing bothers me. All prints after > try-except block are executed twice after the Ctrl+C is pressed! > > test.py: > #

Re: overriding __getitem__ for a subclass of dict

2009-11-17 Thread Steve Howell
On Nov 17, 7:11 am, Scott David Daniels wrote: > Steve Howell wrote: > > ... > > > Eventually, I realized that it was easier to just monkeypatch Django > > while I was in test mode to get a more direct hook into the behavior I > > was trying to monitor, and then I didn't need to bother with > > ov

Re: Calling Python functions from Excel

2009-11-17 Thread Mark Tolonen
"Chris Withers" wrote in message news:4b028ac1.8020...@simplistix.co.uk... Cannonbiker wrote: Hi, unfortunately is my question about server COM (win32com) http://groups.google.com/group/comp.lang.python/browse_thread/thread/ee804cec7f58c6a7# without answer. Please I need Calling Python funct

Re: Code for finding the 1000th prime

2009-11-17 Thread Peter Otten
mrholtsr wrote: > I am absolutely new to python and barely past beginner in programming. > Also I am not a mathematician. Can some one give me pointers for > finding the 1000th. prime for a course I am taking over the internet > on Introduction to Computer Science and Programming. Thanks, Ray Whe

Re: SCGIServer and unusal termination

2009-11-17 Thread Eden Kirin
Diez B. Roggisch wrote: Is there some reasonable explanation for this behaviour? Thanks in advance. I can only guess that SCGIServer does something to stdout. Your code isn't executed twice, so the doubling seems to come from writing it twice. Yes I know that code isn't executed twice since

Vim breaks after Python upgrade

2009-11-17 Thread NickC
Perhaps OT, but I figure here is where people have seen this commonly. I upgraded Python from my distro's default of 2.5.2 to 2.6.2. Vim is now complaining every startup about missing libraries, presumably as some plugins run some python code on initialisation. I'm guessing vim is complaini

Re: TODO and FIXME tags

2009-11-17 Thread Falcolas
On Nov 17, 4:27 am, "Martin P. Hellwig" wrote: > Ben Finney wrote: > > Chris Rebert writes: > > >> 2009/11/16 Yasser Almeida Hernández : > >>> How is the sintaxis for set the TODO and FIXME tags...? > >> There is no special syntax for those. Some people use them in > >> comments, but it's just a

Re: Calling Python functions from Excel

2009-11-17 Thread Chris Withers
Mark Tolonen wrote: Please I need Calling Python functions from Excel and receive result back in Excel. Can me somebody advise simplest solution please? I am more VBA programmer than Python. Try http://code.google.com/p/pyinex/ The book Python: Programming on Win32 has a whole chapter on CO

Re: Choosing GUI Module for Python

2009-11-17 Thread Dietmar Schwertberger
sturlamolden schrieb: On 14 Nov, 15:35, Dietmar Schwertberger wrote: self.m_toolBar1 = self.CreateToolBar( wx.TB_HORIZONTAL, wx.ID_ANY ) self.m_button1 = wx.Button( self.m_toolBar1, wx.ID_ANY, u"MyButton", wx.DefaultPosition, wx.DefaultSize, 0 ) m_toolBar1.AddControl( m_button1 ) I

Re: python simply not scaleable enough for google?

2009-11-17 Thread Rustom Mody
"Language L is (in)efficient. No! Only implementations are (in)efficient" I am reminded of a personal anecdote. It happened about 20 years ago but is still fresh and this thread reminds me of it. I was attending some workshop on theoretical computer science. I gave a talk on Haskell. I showed o

Re: python simply not scaleable enough for google?

2009-11-17 Thread J Kenneth King
David Cournapeau writes: > On Tue, Nov 17, 2009 at 10:48 PM, Aaron Watters > wrote: >> >>> I don't think Python and Go address the same set of programmer >>> desires.  For example, Go has a static type system.  Some programmers >>> find static type systems to be useless or undesirable.  Others

Re: Easy way to play single musical notes in Python

2009-11-17 Thread James Harris
On 15 Nov, 05:41, r wrote: > On Nov 14, 6:21 pm, James Harris > wrote: > > > Is there a simple way to play musical notes in Python? Something like > >   voice.play("c4") > > Uhh, tksnack is pretty easy to use IMO, see this link... > http://www.daniweb.com/code/snippet216655.html > > No python do

FYI: ConfigParser, ordered options, PEP 372 and OrderedDict + big thank you

2009-11-17 Thread Jonathan Fine
Hi A big thanks to Armin Ronacher and Raymond Hettinger for PEP 372: Adding an ordered dictionary to collections I'm using ConfigParser and I just assumed that the options in a section were returned in the order they were given. In fact, I relied on this fact. http://docs.python.org/li

CTypes problem.

2009-11-17 Thread Martijn Arts
I wanted to use PyWiiUse, but, well, it sucks Then I thought; it can't be THAT hard, can it? So I began porting WiiUse to Python using ctypes, but apparently, I did something wrong. poll() gives back an event, *but* (there's always a but) the event doesn't register. Or... Well... See for yoursel

Re: Code for finding the 1000th prime

2009-11-17 Thread Diez B. Roggisch
Stefan Behnel wrote: > Robert P. J. Day, 15.11.2009 15:44: >> On Sun, 15 Nov 2009, mrholtsr wrote: >> >>> I am absolutely new to python and barely past beginner in programming. >>> Also I am not a mathematician. Can some one give me pointers for >>> finding the 1000th. prime for a course I am tak

Re: New syntax for blocks

2009-11-17 Thread MRAB
Jonathan Saxton wrote: On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote: Congratulations, you just reinvented one of the most infamous source of bugs in C, C++, Java, PHP, javascript and quite a few other languages. Believe it or not, but not allowing this in Python was a very deli

Re: SCGIServer and unusal termination

2009-11-17 Thread Diez B. Roggisch
Eden Kirin wrote: > Diez B. Roggisch wrote: > >>> Is there some reasonable explanation for this behaviour? Thanks in >>> advance. >> >> I can only guess that SCGIServer does something to stdout. Your code >> isn't executed twice, so the doubling seems to come from writing it >> twice. > > Yes I

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-17 Thread nn
On Nov 16, 11:54 am, Steve Ferg wrote: > This is a question for the language mavens that I know hang out here. > It is not Python related, except that recent comparisons of Python to > Google's new Go language brought it to mind. > > NOTE that this is *not* a suggestion to change Python.  I like P

Re: Code for finding the 1000th prime

2009-11-17 Thread Chris Rebert
On Tue, Nov 17, 2009 at 9:27 AM, Diez B. Roggisch wrote: > Stefan Behnel wrote: >> Robert P. J. Day, 15.11.2009 15:44: >> Now, all that's left to do is write a prime number generator (a random >> number generator will do, too, but writing a good one isn't easy), run it >> repeatedly in a loop, and

Re: Vim breaks after Python upgrade

2009-11-17 Thread Nick Stinemates
At least with Gentoo, there's a command to recompile all of the plugins you have installed when upgrading python versions. Your issue is probably related to that. I don't think VIM uses hardcoded locations for scripts at the core. If you have any specific questions about the errors you're receivi

_winreg error on open key (64bit) - proper usage of _winreg.DisableReflectionKey

2009-11-17 Thread Randall Walls
Greetings, I'm writing a python script to automate creating ODBC connections on a Windows2008 Server (64bit) platform. I created an ODBC manually (using the GUI), for the purposes of fleshing out the 'check for existing' section of the script. Problem: though I can see the key in regedit (HKEY_LO

Re: _winreg error on open key (64bit) - proper usage of _winreg.DisableReflectionKey

2009-11-17 Thread Nick Stinemates
>From _winreg.c: "Disables registry reflection for 32-bit processes running on a 64-bit OperatingSystem. Will generally raise NotImplemented if executed on a 32-bit Operating System. If the key is not on the reflection list, the function succeeds but has noeffect. Disabling reflection for a key

Re: YIELD_VALUE Byte Code

2009-11-17 Thread Terry Reedy
Andreas Löscher wrote: Hi, I am not sure if this is the right newsgroup, so if not don't hesitate to tell me. Since there is no CPython internals list, this is the right place to start, even though you might end up having to post a slightly off-topic query to python-devel just to get the atte

ANN: Urwid 0.9.9 - Console UI Library

2009-11-17 Thread Ian Ward
Announcing Urwid 0.9.9 -- Urwid home page: http://excess.org/urwid/ Updated screen shots: http://excess.org/urwid/examples.html Tarball: http://excess.org/urwid/urwid-0.9.9.tar.gz RSS: http://excess.org/feeds/tag/urwid/ About this release: === This

Is there a way to load multiple wxhtmlwindow at the same time?

2009-11-17 Thread Abe
All - I'm working on a program that loads a series of web pages so the user can view them quickly one after another. I'm using python and wxhtmlwindow, and the page loading is really slow. Is there a simple way to load up the next few pages in the queue while the user is looking at the current

Re: New syntax for blocks

2009-11-17 Thread r
On Nov 17, 9:28 am, Jonathan Saxton wrote: > And if I ever find the genius who had the brilliant idea of using = to mean > assignment then I have a particularly nasty dungeon reserved just for him.   > Also a foul-smelling leech-infested swamp for those language designers and > compiler writers

Re: python gui builders

2009-11-17 Thread Simon Hibbs
On 16 Nov, 10:06, me wrote: > What Python gui builder is well supported, does not require me > to learn another framework/library, and can crank out stuff for > multiple platforms ? You're looking for a framework/library that doesn't require you to learn it. OK I've had this problem for a f

Re: 2.6.4 Mac x86_64 ?

2009-11-17 Thread chris grebeldinger
On Nov 14, 12:53 am, Zvezdan Petkovic wrote: > On Nov 13, 2009, at 3:58 PM, chris grebeldinger wrote: > > > Hi All, > > I've been having some trouble getting ax86_64/i386 universal > > readline.so to build against libedit, on MacOS 10.5.6 as Apple does. > > Does anyone have any pointers about what

Re: python gui builders

2009-11-17 Thread r
On Nov 17, 12:20 pm, Simon Hibbs wrote: > I wouldn't completely dismiss Tkinter. It's too simple for complex > GUIs but I still think it has it's place for basic utilities. Agreed! Tkinter (besides myself) seems to be the whipping boy of c.l.py. Tkinter has it's place in Python because of the sa

Re: python gui builders

2009-11-17 Thread CM
On Nov 16, 5:06 am, me wrote: > Good People > > I do not write stuff for humans, as it has been my job to remove > humans from the loop. But I have to make a front end to a > component database where everything was built in Python. > > I have looked at the Tk stuff that is built into Python -> not

Re: New syntax for blocks

2009-11-17 Thread Nobody
On Tue, 17 Nov 2009 17:31:18 +, MRAB wrote: >> And if I ever find the genius who had the brilliant idea of using = >> to mean assignment then I have a particularly nasty dungeon reserved >> just for him. Also a foul-smelling leech-infested swamp for those >> language designers and compiler wr

Re: directory wildcard

2009-11-17 Thread Nobody
On Mon, 16 Nov 2009 14:19:16 -0800, hong zhang wrote: >>         print >>f, mcs > > This assigns decimal value, how can I assign Hex here to mcs? print >>f, "%x" % mcs -- http://mail.python.org/mailman/listinfo/python-list

Re: _winreg error on open key (64bit) - proper usage of _winreg.DisableReflectionKey

2009-11-17 Thread Randall Walls
I don't believe so, but it seems like I'm in a catch 22, where I need to _winreg.OpenKey the key first before I can pass it to _winreg.DisableReflectionKey, but it doesn't exist, so I can't open it. I did find out that I can open the key using: hKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"

Re: Command line arguments??

2009-11-17 Thread Nobody
On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote: > Quote the filenames or escape the spaces: > > C:\Python26\Python.exe C:\echo.py "C:\New Folder\text.txt" > > We've been living with this pain ever since windowed GUIs encouraged users > to put spaces in their file names (Apple, I'm look

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-17 Thread steven.oldner
Along the COBOl line is ABAP, the 4gl language from SAP. If today = 'Mon'. message 'oh boy'. elseif today = 'Wed'. message 'Hump day'. elseif today = 'Fri'. message 'TGIF'. else. message 'get to work'. endif. The period is the statement teminator. Indentation and separte lines are just to

Re: New syntax for blocks

2009-11-17 Thread Russ P.
On Nov 17, 7:28 am, Jonathan Saxton wrote: > On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote: > >> Congratulations, you just reinvented one of the most infamous source of > >> bugs in C, C++, Java, PHP, javascript and quite a few other languages. > >> Believe it or not, but not allow

Re: Command line arguments??

2009-11-17 Thread Gerry
On Nov 17, 2:26 pm, Nobody wrote: > On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote: > > Quote the filenames or escape the spaces: > > > C:\Python26\Python.exe C:\echo.py "C:\New Folder\text.txt" > > > We've been living with this pain ever since windowed GUIs encouraged users   > > to put s

Re: Code for finding the 1000th prime

2009-11-17 Thread Edward A. Falk
In article , mrholtsr wrote: >I am absolutely new to python and barely past beginner in programming. >Also I am not a mathematician. Can some one give me pointers for >finding the 1000th. prime for a course I am taking over the internet >on Introduction to Computer Science and Programming. Thanks

ANN: Urwid 0.9.9 - Console UI Library

2009-11-17 Thread Ian Ward
Announcing Urwid 0.9.9 -- Urwid home page: http://excess.org/urwid/ Updated screen shots: http://excess.org/urwid/examples.html Tarball: http://excess.org/urwid/urwid-0.9.9.tar.gz RSS: http://excess.org/feeds/tag/urwid/ About this release: === Thi

ANN: Urwid 0.9.9 - Console UI Library

2009-11-17 Thread Ian Ward
Announcing Urwid 0.9.9 -- Urwid home page: http://excess.org/urwid/ Updated screen shots: http://excess.org/urwid/examples.html Tarball: http://excess.org/urwid/urwid-0.9.9.tar.gz RSS: http://excess.org/feeds/tag/urwid/ About this release: === Thi

Re: New syntax for blocks

2009-11-17 Thread Stephen Hansen
On Tue, Nov 17, 2009 at 10:15 AM, r wrote: > On Nov 17, 9:28 am, Jonathan Saxton wrote: > > > And if I ever find the genius who had the brilliant idea of using = to > mean assignment then I have a particularly nasty dungeon reserved just for > him. Also a foul-smelling leech-infested swamp for

Sample CGI for use with Unit Tests

2009-11-17 Thread Kee Nethery
I've been looking for examples of how to run unit tests on a CGI. Didn't find any so I came up with this pared down sample. Don't know where to post example code so I figured I'd just email it to this list. Perhaps it will be findable by others in the future. This CGI with unit test example

Re: Code for finding the 1000th prime

2009-11-17 Thread Terry Reedy
On Sun, 15 Nov 2009, mrholtsr wrote: I am absolutely new to python and barely past beginner in programming. Also I am not a mathematician. Can some one give me pointers for finding the 1000th. prime for a course I am taking over the internet on Introduction to Computer Science and Programming.

Re: QuerySets in Dictionaries

2009-11-17 Thread scoopseven
On Nov 14, 11:55 pm, Steven D'Aprano wrote: > On Fri, 13 Nov 2009 14:10:10 -0800, scoopseven wrote: > > I actually had a queryset that was dynamically generated, so I ended up > > having to use the eval function, like this... > > > d = {} > > for thing in things: > >         query_name = 'thing_'

Re: python simply not scaleable enough for google?

2009-11-17 Thread Paul Rubin
Aaron Watters writes: > ... and I still have an issue with the whole "Python is slow" > meme. The reason NASA doesn't build a faster Python is because > Python when augmented with FORTRAN libraries... Do you think that numerics is the only area of programming where users care about speed? > And

Anything equivalent to cassert in C++?

2009-11-17 Thread Peng Yu
There are some assertion code (testing if a condition is false, if it is false, raise an Error object) in my python, which is useful when I test my package. But such case would never occur when in the produce code. If I keep them in if statement, it will take some runtime. I'm wondering what is th

Re: python gui builders

2009-11-17 Thread Joel Davis
On Nov 16, 5:06 am, me wrote: > Good People > > I do not write stuff for humans, as it has been my job to remove > humans from the loop. But I have to make a front end to a > component database where everything was built in Python. > > I have looked at the Tk stuff that is built into Python -> not

Re: python gui builders

2009-11-17 Thread Ben Finney
Scott David Daniels writes: > Well, let's see. You want to do gui work without learning things. Good > luck with that. If you discover how, I'd like to learn tensor analysis > without using symbols or operations more complex than addition and > subtraction. Maybe your groundwork can help me out w

Re: python gui builders

2009-11-17 Thread Tim Daneliuk
Simon Hibbs wrote: > On 16 Nov, 10:06, me wrote: > >> What Python gui builder is well supported, does not require me >> to learn another framework/library, and can crank out stuff for >> multiple platforms ? > > You're looking for a framework/library that doesn't require you to > learn it. OK...

Re: Anything equivalent to cassert in C++?

2009-11-17 Thread Simon Forman
On Tue, Nov 17, 2009 at 4:19 PM, Peng Yu wrote: > There are some assertion code (testing if a condition is false, if it > is false, raise an Error object) in my python, which is useful when I > test my package.  But such case would never occur when in the produce > code. If I keep them in if state

Re: Command line arguments??

2009-11-17 Thread Nobody
On Tue, 17 Nov 2009 11:47:46 -0800, Gerry wrote: > How about this: > > lastarg = " ".join(sys.argv[2:]) What about it? IOW, why would you want to do that? -- http://mail.python.org/mailman/listinfo/python-list

Beautifulsoup code that is not running

2009-11-17 Thread Zeynel
Hello, Please help with this code suggested in the beautifulsoup group http://groups.google.com/group/beautifulsoup/browse_frm/thread/d288555c6992ceaa >>> from BeautifulSoup import BeautifulSoup >>> soup = BeautifulSoup (file("test.html").read()) >>> title = soup.find('title') >>> titleString =

Re: python simply not scaleable enough for google?

2009-11-17 Thread David Cournapeau
On Wed, Nov 18, 2009 at 5:48 AM, Paul Rubin wrote: > > What about Git?  Some people prefer it. Git is an interesting example, because it both really pushes performance into its core structure and reasonably complete implementations exist in other languages. In parti

Re: ast manipulation

2009-11-17 Thread Terry Reedy
Tsize wrote: Hello, I am hoping for a little help. I have been playing with the python ast module and have run into an issue that I need a little push on. I would like to be able to change a specific element in a specific node in an ast then compile the resulting ast. If you can identify the

Re: Vim breaks after Python upgrade

2009-11-17 Thread Terry Reedy
NickC wrote: Perhaps OT, but I figure here is where people have seen this commonly. I upgraded Python from my distro's default of 2.5.2 to 2.6.2. Vim is now complaining every startup about missing libraries, presumably as some plugins run some python code on initialisation. I'm guessing vim

  1   2   >