Re: python simply not scaleable enough for google?

2009-11-16 Thread sturlamolden
On 14 Nov, 02:42, Robert Brown wrote: > If you want to know why Python *the language* is slow, look at the Lisp code > CLPython generates and at the code implementing the run time.  Simple > operations end up being very expensive. You can also see this by looking at the C that Cython or Pyrex ge

The ol' [[]] * 500 bug...

2009-11-16 Thread kj
...just bit me in the "fuzzy posterior". The best I can come up with is the hideous lol = [[] for _ in xrange(500)] Is there something better? What did one do before comprehensions were available? I suppose in that case one would have to go all the way with lol = [None] * 500 for i i

Re: The ol' [[]] * 500 bug...

2009-11-16 Thread kj
In <6e20a31b-2218-49c5-a32c-5f0147db3...@k19g2000yqc.googlegroups.com> Jon Clements writes: lol =3D map(lambda L: [], xrange(5)) [id(i) for i in lol] >[167614956, 167605004, 167738060, 167737996, 167613036] Oh yeah, map! I'd forgotten all about it. Thanks! kynn -- http://mail.pyth

Re: A "terminators' club" for clp

2009-11-16 Thread kj
In <7x3a4i56u7@ruckus.brouhaha.com> Paul Rubin writes: >kj writes: >> frequent* clp posters the ability to *easily* delete spam from the >> comp.lang.python server? >Um, this is usenet; there is no comp.lang.python server. Are you >saying you want a moderate

Re: Python & Go

2009-11-16 Thread Terry Reedy
Simon Forman wrote: On Sat, Nov 14, 2009 at 5:10 PM, Terry Reedy wrote: Paul Rubin wrote: Mark Chu-Carroll has a new post about Go: http://scienceblogs.com/goodmath/2009/11/the_go_i_forgot_concurrency_an.php In a couple of minutes, I wrote his toy prime filter example in Python, mostly fr

Re: IDE for python

2009-11-16 Thread Jonathan Hartley
On Nov 16, 5:09 am, sturlamolden wrote: > On 15 Nov, 18:09, Peng Yu wrote: > > > There had been some discussion on IDE. But I'm not sure what pros and > > cons of each choice. Current, I'm using vim and ctags. > > > Could somebody give some advices on choosing the best IDE for me? > > There is a

Re: Python & Go

2009-11-16 Thread Terry Reedy
sturlamolden wrote: On 14 Nov, 23:10, Terry Reedy wrote: It would be much better, for instance, to tweak Python, which it has had great success with, to better run on multiple cores." Python run well on multiple cores, you just have to use processes instead of threads. But not so trivially

C api question and determining PyObject type

2009-11-16 Thread lallous
Hello I have an a class defined as: class __object(object): pass Now, I call a C function that takes a PyObject* and checks its type: if (PyString_Check(obj)) ... if (PySequence_Check(obj)) Before doing the check, I print the passed object with PyObject_Str() and get: passed

python gui builders

2009-11-16 Thread me
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 acceptable. So looking at wxGlade, Bo

Re: IDE for python

2009-11-16 Thread sturlamolden
On 16 Nov, 10:05, Jonathan Hartley wrote: > As far as I can make out, TextPad has only two features, syntax > highlighting and the ability to define a 'make' command, and a regex > that is used to extract filenames and line-numbers from the resulting > output of that make command. These are, it t

Re: overriding __getitem__ for a subclass of dict

2009-11-16 Thread Carl Banks
On Nov 15, 2:52 pm, Steve Howell wrote: > Does anybody have any links that points to the rationale for ignoring > instance definitions of __getitem__ when new-style classes are > involved?  I assume it has something to do with performance or > protecting us from our own mistakes? "Not important

Re: python gui builders

2009-11-16 Thread sturlamolden
On 16 Nov, 11: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 ? I use wxFormBuilder. The 3.1 beta can even create wxPython code, but it still has some minor issues (e.g. not alwa

Re: IDE for python

2009-11-16 Thread Dietmar Schwertberger
sturlamolden schrieb: On 15 Nov, 18:09, Peng Yu wrote: There had been some discussion on IDE. But I'm not sure what pros and cons of each choice. Current, I'm using vim and ctags. Could somebody give some advices on choosing the best IDE for me? There is a plug-in to develop (amd debug) Pyth

Re: IDE for python

2009-11-16 Thread Carl Banks
On Nov 16, 1:05 am, Jonathan Hartley wrote: > Then, after about a year, a curious thing happened. One by one, in > entirely independent decisions, almost all developers decided to > migrate to either Emacs or Vi.* > > Each person decided that the fancy features of their IDE wasn't as > useful to t

Re: python gui builders

2009-11-16 Thread sturlamolden
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 or Borland Delphi with pywin32. Either expose your GU

Re: C api question and determining PyObject type

2009-11-16 Thread lallous
Actually, the object class is defined as: class __object(object): def __getitem__(self, idx): return getattr(self, idx) Anyway, now I check like this: bool PyIsSequenceType(PyObject *obj) { if (!PySequence_Check(obj)) return false; Py_ssize_t sz = PySequence_Size(obj);

Re: Python & Go

2009-11-16 Thread sturlamolden
On 16 Nov, 10:06, Terry Reedy wrote: > > Python run well on multiple cores, you just have to use processes > > instead of threads. > > But not so trivially as to add one word to an existing function. > Hence by tweak, I meant, as explained in another post, to add a keyword > or just a decorator t

SCGIServer and unusal termination

2009-11-16 Thread Eden Kirin
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: #- from scgi.

import subprocess in python

2009-11-16 Thread Kuhl
I am a Linux user beginning to learn Python now. Below is the first Python script that I copied from the text book. It works, so it confirmed that there is python installed in my system: #!/usr/bin/env python for a in [1, 2]: for b in ['a', 'b']: print a, b But when I co

Re: import subprocess in python

2009-11-16 Thread sturlamolden
On 16 Nov, 13:50, Kuhl wrote: > Python 2.2.3 (#1, Feb  2 2005, 12:22:48) > What's the mistake that I am making? How to solve it? Your Python version is too old. -- http://mail.python.org/mailman/listinfo/python-list

Re: import subprocess in python

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 4:50 AM, Kuhl wrote: > found in my system, so I have to use python instead. However, "import > subprocess" still failed, see below. > > # which python > /usr/bin/python > # which ipython > ipython: Command not found. > # python > Python 2.2.3 (#1, Feb  2 2005, 12:22:48) >

Let python call a C function pointer passed from the C Python API

2009-11-16 Thread hvictor
I have C++ a void function pointer stored in a variable call. The pointed function takes an int and a char* as arguments. I have a python module containing this function: def yeah(x): x(int(0),"text argument") return "pointer called" As you can see I'm trying to use the argument

Re: Psyco on 64-bit machines

2009-11-16 Thread Robin Becker
Russ P. wrote: I just stumbled across "unladen swallow," a "faster implementation of Python." Is it ready for operational usage? How does it compare to Psyco? I poked around their website a bit, but I don't see answers to those questions. Thanks. I've tried a few things with it. It mos

Re: Let python call a C function pointer passed from the C Python API

2009-11-16 Thread Carl Banks
On Nov 16, 5:04 am, hvictor wrote: > I have C++ a void function pointer stored in a variable call. The > pointed function takes an int and a char* as arguments. > > I have a python module containing this function: > > def yeah(x): >         x(int(0),"text argument") >         return "pointer calle

Re: Let python call a C function pointer passed from the C Python API

2009-11-16 Thread sturlamolden
On 16 Nov, 14:25, Carl Banks wrote: > Python can't call C function pointers.   Yes it can, use ctypes... -- http://mail.python.org/mailman/listinfo/python-list

Re: object serialization as python scripts

2009-11-16 Thread J Kenneth King
King writes: >> Why is it easier than the above mentioned - they are *there* (except the >> custom xml), and just can be used. What don't they do you want to do? >> >> Other than that, and even security issues put aside, I don't see much >> difference between pickle and python code, except the la

Re: Calling Python functions from Excel

2009-11-16 Thread Darcy Mason
On Nov 15, 2:20 am, Cannonbiker 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. A couple of years ago I used MSScriptControl for this. Couldn't find a great ref

Logic operators with "in" statement

2009-11-16 Thread Mr.SpOOn
Hi, I'm trying to use logical operators (or, and) with the "in" statement, but I'm having some problems to understand their behavior. In [1]: l = ['3', 'no3', 'b3'] In [2]: '3' in l Out[2]: True In [3]: '3' and '4' in l Out[3]: False In [4]: '3' and 'no3' in l Out[4]: True This seems to work a

Re: Code for finding the 1000th prime

2009-11-16 Thread mrholtsr
On Nov 15, 10:02 am, "Diez B. Roggisch" wrote: > mrholtsr schrieb: > > > 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 Intro

Re: Psyco on 64-bit machines

2009-11-16 Thread Jeremy Sanders
Russ P. wrote: > Would it make sense to compile Python in the 32-bit compatibility mode > so I can use Psyco? What would I lose in that mode, if anything? > Thanks. You won't be able to access large amounts of memory in 32 bit mode. Also, the x86-64 mode has more CPU registers than x86 mode, so

Newsgroup for beginners

2009-11-16 Thread mrholtsr
Is there a Python newsgroup for those who are strictly beginners at programming and python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Logic operators with "in" statement

2009-11-16 Thread Mr.SpOOn
Sorry for replying to myself, but I think I understood why I was wrong. The correct statement should be something like this: In [13]: ('b3' and '5') in l or ('3' and 'b3') in l Out[13]: True -- http://mail.python.org/mailman/listinfo/python-list

Re: Code for finding the 1000th prime

2009-11-16 Thread sturlamolden
On 15 Nov, 15:30, 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 Programmin

Re: Newsgroup for beginners

2009-11-16 Thread Diez B. Roggisch
mrholtsr wrote: > Is there a Python newsgroup for those who are strictly beginners at > programming and python? Yes, the tutor-list. http://mail.python.org/mailman/listinfo/tutor Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Logic operators with "in" statement

2009-11-16 Thread exarkun
On 02:02 pm, mr.spoo...@gmail.com wrote: Hi, I'm trying to use logical operators (or, and) with the "in" statement, but I'm having some problems to understand their behavior. "and" and "or" have no particular interaction with "in". In [1]: l = ['3', 'no3', 'b3'] In [2]: '3' in l Out[2]: True

Re: Newsgroup for beginners

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 6:01 AM, mrholtsr wrote: > Is there a Python newsgroup for those who are strictly beginners at > programming and python? python-tutor: http://mail.python.org/mailman/listinfo/tutor Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/pytho

Re: Logic operators with "in" statement

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 6:02 AM, Mr.SpOOn wrote: > Hi, > I'm trying to use logical operators (or, and) with the "in" statement, > but I'm having some problems to understand their behavior. > > In [1]: l = ['3', 'no3', 'b3'] > > In [2]: '3' in l > Out[2]: True > > In [3]: '3' and '4' in l > Out[3]:

Re: Logic operators with "in" statement

2009-11-16 Thread Xavier Ho
On Tue, Nov 17, 2009 at 12:02 AM, Mr.SpOOn wrote: > Hi, > I'm trying to use logical operators (or, and) with the "in" statement, > but I'm having some problems to understand their behavior. > Hey Carlo, I think your issue here is mistaking 'in' as a statement. It's just another logic operator, m

Re: Logic operators with "in" statement

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 6:08 AM, Mr.SpOOn wrote: > Sorry for replying to myself, but I think I understood why I was wrong. > > The correct statement should be something like this: > > In [13]: ('b3' and '5') in l or ('3' and 'b3') in l > Out[13]: True No, you've just run into another misunderstan

Re: Logic operators with "in" statement

2009-11-16 Thread Xavier Ho
On Tue, Nov 17, 2009 at 12:08 AM, Mr.SpOOn wrote: > Sorry for replying to myself, but I think I understood why I was wrong. > > The correct statement should be something like this: > > In [13]: ('b3' and '5') in l or ('3' and 'b3') in l > Out[13]: True > > Carlo, I'm not sure what that achieves.

Re: Logic operators with "in" statement

2009-11-16 Thread Tim Chase
Here I expected to get True in the second case too, so clearly I don't really get how they work. You're seeing short-circuit evaluation: >>> "3" or "4" # true '3' >>> '4' or '3' # true '4' >>> '4' in l# false False >>> '3' or False # true '3' >>> '4' or '42' in l # tru

Re: Newsgroup for beginners

2009-11-16 Thread Tim Chase
mrholtsr wrote: Is there a Python newsgroup for those who are strictly beginners at programming and python? http://mail.python.org/mailman/listinfo/tutor -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Logic operators with "in" statement

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 6:23 AM, Xavier Ho wrote: '3' in l and 'no3' in l > True > > AND operator has a higher precedence, so you don't need any brackets here, I > think. But anyway, you have to use it like that. So that's something you'll > have to fix first. Er, you mean lower precedence.

Re: Python & Go

2009-11-16 Thread Graham Breed
Terry Reedy wrote: It seems to me that generators are already 'channels' that connect the calling code to the __next__ method, a semi-coroutine based on the body of the generator function. At present, the next method waits until an object is requested. Then it goes into action, yields an objec

Re: python simply not scaleable enough for google?

2009-11-16 Thread Paul Boddie
On 16 Nov, 05:51, sturlamolden wrote: > > NASA can find money to build a space telescope and put it in orbit. > They don't find money to create a faster Python, which they use for > analyzing the data. Is the analysis in Python really what slows it all down? > Google is a multi-billion dollar bu

Re: (unknown)

2009-11-16 Thread Tommy Grav
On Nov 15, 2009, at 11:08 AM, Gabriel Genellina wrote: > En Fri, 13 Nov 2009 16:05:26 -0300, Ronn Ross escribió: > >> I'm attempting to convert latitude and longitude coordinates from degrees >> minutes and second to decimal form. I would like to go from: >>N39 42 36.3 W77 42 51.5 >> to: >>

Image to SVG conversion with Python

2009-11-16 Thread Carlo DiCelico
I need to convert JPEG and PNG files to SVG. I'm currently using PIL to generate the JPEG/PNG files to begin with. However, I need to be able to scale the generated images up in size without a loss of image quality. Using SVG seems to be the best way to do this, other than generating the images in

Re: C api question and determining PyObject type

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 07:44:34 -0300, lallous escribió: Actually, the object class is defined as: class __object(object): def __getitem__(self, idx): return getattr(self, idx) Anyway, now I check like this: bool PyIsSequenceType(PyObject *obj) { if (!PySequence_Check(o

Re: C api question and determining PyObject type

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 07:44:34 -0300, lallous escribió: Actually, the object class is defined as: class __object(object): def __getitem__(self, idx): return getattr(self, idx) Anyway, now I check like this: bool PyIsSequenceType(PyObject *obj) { if (!PySequence_Check(o

Python-URL! - weekly Python news and links (Nov 16)

2009-11-16 Thread Gabriel Genellina
QOTW: "The promise is 'batteries included.' Nobody promised you a nickel metal hydride battery that you can use as a replacement in your Prius." - Stephen J. Turnbull http://mail.python.org/pipermail/python-dev/2009-November/094014.html Google's new language, Go, has similarities to

Re: (unknown)

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 11:11:20 -0300, Tommy Grav escribió: On Nov 15, 2009, at 11:08 AM, Gabriel Genellina wrote: En Fri, 13 Nov 2009 16:05:26 -0300, Ronn Ross escribió: I'm attempting to convert latitude and longitude coordinates from degrees minutes and second to decimal form. I would

Re: A "terminators' club" for clp

2009-11-16 Thread Terry Reedy
kj wrote: In <7x3a4i56u7@ruckus.brouhaha.com> Paul Rubin writes: kj writes: frequent* clp posters the ability to *easily* delete spam from the comp.lang.python server? Um, this is usenet; there is no comp.lang.python server. Are you saying you want a mo

Re: Newsgroup for beginners

2009-11-16 Thread Terry Reedy
mrholtsr wrote: Is there a Python newsgroup for those who are strictly beginners at programming and python? gmane.comp.python.tutor, which I believe mirrors the tutor-list -- http://mail.python.org/mailman/listinfo/python-list

Re: Image to SVG conversion with Python

2009-11-16 Thread Dave Angel
Carlo DiCelico wrote: I need to convert JPEG and PNG files to SVG. I'm currently using PIL to generate the JPEG/PNG files to begin with. However, I need to be able to scale the generated images up in size without a loss of image quality. Using SVG seems to be the best way to do this, other than g

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

2009-11-16 Thread Steve Ferg
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 Python just the way it is. I'm just curious about

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

2009-11-16 Thread Robin Becker
Steve Ferg wrote: . if then do stuff elif then do stuff else do stuff endif Note that you do not need block delimiters. Obviously, you could make a more Pythonesque syntax by using a colon rather then "then" for the condition terminator. You c

Re: Image to SVG conversion with Python

2009-11-16 Thread Carlo DiCelico
On Nov 16, 11:48 am, Dave Angel wrote: > Carlo DiCelico wrote: > > I need to convert JPEG and PNG files to SVG. I'm currently using PIL > > to generate the JPEG/PNG files to begin with. However, I need to be > > able to scale the generated images up in size without a loss of image > > quality. Usi

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

2009-11-16 Thread James Harris
On 16 Nov, 16:54, 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 Pyth

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

2009-11-16 Thread Adrian Cherry
Steve Ferg wrote in news:ff92db5b-9cb0-4a72-b339-2c5ac02fb...@p36g2000vbn.googlegro ups.com: > 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

Re: Redirect stdout to a buffer [Errno 9]

2009-11-16 Thread Ecir Hana
On Nov 15, 5:28 pm, Ecir Hana wrote: > Hello, > > I'm trying to write a simple Win32 app, which may run some Python > scripts. Since it is a Windows GUI app, I would like to redirect all > output (Python print, C printf, fprinf stderr, ...) to a text area > inside the app. In other words, I'm tryi

Re: Newsgroup for beginners

2009-11-16 Thread George Oliver
On Nov 16, 8:35 am, Terry Reedy wrote: > mrholtsr wrote: > > Is there a Python newsgroup for those who are strictly beginners at > > programming and python? > > gmane.comp.python.tutor, which I believe mirrors the tutor-list There also is a beginner's forum at python-forum.org: http://www.python

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

2009-11-16 Thread MRAB
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 Python just the way it is. I'

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

2009-11-16 Thread Robin Becker
Robin Becker wrote: ... modern sh seems to use this with "fi" as endif eg ~: $ if true; then > echo true > elif false; then > echo false > else > echo hostile logic > fi true ~: $ I meant to say that since sh uses this construct it cannot be too bad as a language construct since th

Re: import subprocess in python

2009-11-16 Thread Nobody
On Mon, 16 Nov 2009 04:58:00 -0800, sturlamolden wrote: > On 16 Nov, 13:50, Kuhl wrote: > >> Python 2.2.3 (#1, Feb  2 2005, 12:22:48) > >> What's the mistake that I am making? How to solve it? > > Your Python version is too old. Your Python version is *way* too old. If you're lucky, people w

Re: Image to SVG conversion with Python

2009-11-16 Thread Nobody
On Mon, 16 Nov 2009 07:19:49 -0800, Carlo DiCelico wrote: > I need to convert JPEG and PNG files to SVG. I'm currently using PIL > to generate the JPEG/PNG files to begin with. However, I need to be > able to scale the generated images up in size without a loss of image > quality. Using SVG seems

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

2009-11-16 Thread Nobody
On Mon, 16 Nov 2009 08:54:28 -0800, Steve Ferg wrote: > For a long time I've wondered why languages still use blocks > (delimited by do/end, begin/end, { } , etc.) in ifThenElse statements. > > I've often thought that a language with this kind of block-free syntax > would be nice and intuitive: >

Re: Redirect stdout to a buffer [Errno 9]

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 14:17:52 -0300, Ecir Hana escribió: I'm trying to write a simple Win32 app, which may run some Python scripts. Since it is a Windows GUI app, I would like to redirect all output (Python print, C printf, fprinf stderr, ...) to a text area inside the app. In other words, I'm

RE: tkFileDialog question

2009-11-16 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: overriding __getitem__ for a subclass of dict

2009-11-16 Thread Steve Howell
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 __getitem__ when new-style classes are > > involved?  I assume it has something to do with performance or > > pro

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

2009-11-16 Thread MRAB
Nobody wrote: On Mon, 16 Nov 2009 08:54:28 -0800, Steve Ferg wrote: For a long time I've wondered why languages still use blocks (delimited by do/end, begin/end, { } , etc.) in ifThenElse statements. I've often thought that a language with this kind of block-free syntax would be nice and intui

Re: A "terminators' club" for clp

2009-11-16 Thread gil_johnson
On Nov 14, 12:08 pm, r wrote: > On Nov 14, 7:28 am, gil_johnson wrote: > Actually there is a "rank this post" (gotta be careful with that > verbage!) AND a "report this post as spam". Of course it only exists > in GG's and not Usenet. I *do* know that the star system is used quite > frequently,

Web servers

2009-11-16 Thread Virgil Stokes
Any suggestions on using Python to connect to Web servers (e.g. to access financial time series data)? --V. Stokes -- http://mail.python.org/mailman/listinfo/python-list

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

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 8: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 Pytho

Re: Web servers

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 11:17 AM, Virgil Stokes wrote: > Any suggestions on using Python to connect to Web servers (e.g. to access > financial time series data)? In what format? Using what protocol? (*Insert other basic questions that need answering in order to answer your question here*) Cheers

Re: Changing the current directory (full post)

2009-11-16 Thread vsoler
On Nov 16, 2:35 am, "Gabriel Genellina" wrote: > En Sun, 15 Nov 2009 09:04:06 -0300, vsoler > escribió: > > > Ever since I installed my Python 2.6 interpreter (I use IDLE), I've > > been saving my > > *.py files in the C:\Program Files\Python26 directory, which is the > > default directory for su

Re: Changing the current directory (full post)

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 11:36 AM, vsoler wrote: > On Nov 16, 2:35 am, "Gabriel Genellina" > wrote: >> En Sun, 15 Nov 2009 09:04:06 -0300, vsoler >> escribió: >> >> > Ever since I installed my Python 2.6 interpreter (I use IDLE), I've >> > been saving my >> > *.py files in the C:\Program Files\Py

Re: Changing the current directory (full post)

2009-11-16 Thread vsoler
On Nov 16, 8:45 pm, Chris Rebert wrote: > On Mon, Nov 16, 2009 at 11:36 AM, vsoler wrote: > > On Nov 16, 2:35 am, "Gabriel Genellina" > > wrote: > >> En Sun, 15 Nov 2009 09:04:06 -0300, vsoler > >> escribió: > > >> > Ever since I installed my Python 2.6 interpreter (I use IDLE), I've > >> > bee

Re: Changing the current directory (full post)

2009-11-16 Thread Rami Chowdhury
On Mon, 16 Nov 2009 11:56:49 -0800, vsoler wrote: On Nov 16, 8:45 pm, Chris Rebert wrote: On Mon, Nov 16, 2009 at 11:36 AM, vsoler wrote: > On Nov 16, 2:35 am, "Gabriel Genellina" > wrote: >> En Sun, 15 Nov 2009 09:04:06 -0300, vsoler >> escribió: >> > Ever since I installed my Python 2

Re: Changing the current directory (full post)

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 11:56 AM, vsoler wrote: > On Nov 16, 8:45 pm, Chris Rebert wrote: >> On Mon, Nov 16, 2009 at 11:36 AM, vsoler wrote: >> > On Nov 16, 2:35 am, "Gabriel Genellina" >> > wrote: >> >> En Sun, 15 Nov 2009 09:04:06 -0300, vsoler >> >> escribió: >> >> >> > Ever since I install

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

2009-11-16 Thread r
On Nov 16, 10:54 am, 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 WHY? Python's syntax is by far the most

Re: Web servers

2009-11-16 Thread Dave Angel
Virgil Stokes wrote: Any suggestions on using Python to connect to Web servers (e.g. to access financial time series data)? --V. Stokes You can open a web page for reading with urllib2 module. You can parse html with beautiful soup, or if it's clean xhtml, with the xml module. But pa

directory wildcard

2009-11-16 Thread hong zhang
List, I try to assign value to force_mcs sitting in a wildcard subdirectory /sys/kernel/debug/ieee80211/phy*, but python does not work for that such as: os.system("echo %i > /sys/kernel/debug/ieee80211/phy*/iwlagn/data/force_mcs" % mcs) Any right way to do it? Thanks. --henry --

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

2009-11-16 Thread Edward A. Falk
In article , 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 delimiters. "then", "

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

2009-11-16 Thread Robert Kern
On 2009-11-16 14:40 PM, Edward A. Falk wrote: In article, 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 no

Re: directory wildcard

2009-11-16 Thread Diez B. Roggisch
hong zhang schrieb: List, I try to assign value to force_mcs sitting in a wildcard subdirectory /sys/kernel/debug/ieee80211/phy*, but python does not work for that such as: os.system("echo %i > /sys/kernel/debug/ieee80211/phy*/iwlagn/data/force_mcs" % mcs) Any right way to do it? Don't use

Re: directory wildcard

2009-11-16 Thread Jeff McNeil
On Nov 16, 3:33 pm, hong zhang wrote: > List, > > I try to assign value to force_mcs sitting in a wildcard subdirectory > /sys/kernel/debug/ieee80211/phy*, but python does not work for that such as: > > os.system("echo %i > /sys/kernel/debug/ieee80211/phy*/iwlagn/data/force_mcs" > % mcs) > > Any

Re: Redirect stdout to a buffer [Errno 9]

2009-11-16 Thread Ecir Hana
On Nov 16, 7:21 pm, "Gabriel Genellina" wrote: > En Mon, 16 Nov 2009 14:17:52 -0300, Ecir Hana   > escribió: > > >> I'm trying to write a simple Win32 app, which may run some Python > >> scripts. Since it is a Windows GUI app, I would like to redirect all > >> output (Python print, C printf, fpri

Re: Changing the current directory (full post)

2009-11-16 Thread Dave Angel
Chris Rebert wrote: On Mon, Nov 16, 2009 at 11:56 AM, vsoler wrote: On Nov 16, 8:45 pm, Chris Rebert wrote: On Mon, Nov 16, 2009 at 11:36 AM, vsoler wrote: On Nov 16, 2:35 am, "Gabriel Genellina" wrote: En Sun, 15 Nov 2009 09:04:06 -0300, vsoler escribió:

Re: IDE for python

2009-11-16 Thread Ben Finney
Jonathan Hartley writes: > I'd like to offer the group the anecdote of the great Resolver IDE > migration. […] It's great to see something refreshing and new — data beyond a single person's subjective experience! — come out of a topic that looked like it was just going to re-hash the same tired

Re: directory wildcard

2009-11-16 Thread Tim Chase
I try to assign value to force_mcs sitting in a wildcard subdirectory /sys/kernel/debug/ieee80211/phy*, but python does not work for that such as: os.system("echo %i > /sys/kernel/debug/ieee80211/phy*/iwlagn/data/force_mcs" % mcs) Any right way to do it? I'm not sure your code works if there's

mySQL access speed

2009-11-16 Thread Hans Müller
Hello, I have some programs doing a lot sql IO in some mySQL databases. This works very fine and the DBAPI is quite simple to understand. Now I came to the point where I had to insert millions of lines into a table. My first aproach was to insert the data using executemany(). That's not bad and f

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

2009-11-16 Thread Barry W Brown
On Nov 16, 10: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: directory wildcard

2009-11-16 Thread hong zhang
--- On Mon, 11/16/09, Jeff McNeil wrote: > From: Jeff McNeil > Subject: Re: directory wildcard > To: python-list@python.org > Date: Monday, November 16, 2009, 3:01 PM > On Nov 16, 3:33 pm, hong zhang > > wrote: > > List, > > > > I try to assign value to force_mcs sitting in a > wildcard subdi

Re: mySQL access speed

2009-11-16 Thread Dikkie Dik
> ... But it isn't very fast. > For executemany I have some hundred thousend lines in a list of tuples. > I joined() these lines to form an insert into table values () statement > and > blew it into the mysql cmdline client via os.popen(). > This was 60(!) times faster and loaded my table in s

faster than list.extend()

2009-11-16 Thread Hyunchul Kim
Hi, all. 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 results ** Thank you in advance, Hyunchul -- http://mail.python.org/mailman/listinfo/python-list

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

2009-11-16 Thread Erik Max Francis
r wrote: On Nov 16, 10:54 am, 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 WHY? Python's syntax is by far the most elega

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

2009-11-16 Thread Erik Max Francis
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 delimiters. Obviously, you could make a more P

Re: faster than list.extend()

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 2:30 PM, Hyunchul Kim wrote: > Hi, all. > > 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 results > ** You'd probably

Re: Changing the current directory (full post)

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 18:10:51 -0300, Dave Angel escribió: Chris Rebert wrote: On Mon, Nov 16, 2009 at 11:56 AM, vsoler wrote: When I enter IDLE, I'd like to say at the prompt: "my current directory is... ...test" and then be able to run a module in that directory. This is what my problem i

Re: faster than list.extend()

2009-11-16 Thread Tim Chase
Hyunchul Kim wrote: Hi, all. 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 results ** Several ways occur to me: def t1(i): for x in i: yield

  1   2   >