Re: SCGIServer and unusal termination

2009-11-16 Thread Eden Kirin
Anyone? -- www.vikendi.net -/- www.supergrupa.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Get attribute this way

2009-11-16 Thread King
"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? Thanks Prashant Python 2.6.2 Win XP 32 -- http://mail.python.

Re: Get attribute this way

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 10:53 PM, King wrote: > Writing/Reading data to xml is not a problem. The problem is when I > have to write to attributes in xml, where a connections has been > established. > XML: > destattribute="node2.gradient.colors[1][2]"/> You did not include an example like this in

Re: Get attribute this way

2009-11-16 Thread King
Writing/Reading data to xml is not a problem. The problem is when I have to write to attributes in xml, where a connections has been established. XML: While reading back I have to convert both source and destination strings into object so that I can call connections function using source and targ

Re: Get attribute this way

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 10:04 PM, King wrote: > Python's getattr, setattr and __getattribute__ commands works fine > with python types. > For example: > print o.__getattribute__("name") > print getattr(o, "name") > This is the easiest way to get an attribute using a string. > > In my case the "Nod

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

2009-11-16 Thread Ben Finney
Psi writes: > as the subject says, > > any books? Any web search would lead you to http://wiki.python.org/moin/PythonBooks>, no? -- \ “There's no excuse to be bored. Sad, yes. Angry, yes. | `\Depressed, yes. Crazy, yes. But there's no excuse for boredom, | _o__)

Re: mySQL access speed

2009-11-16 Thread John Nagle
Hans Müller wrote: 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. If you're loading into an empty table, use the LOAD comm

Qt Python : QTreeWidget Child Problem

2009-11-16 Thread Threader Slash
Hello Everybody, I have a QTreewidget that works fine if I have just one level on my treelist. If I decide to add child sublevels, it gives me an error. Here is the code, that works nice only without the "childs" lines on it (see after "child 1" and "child 2"). def eqpt_centralwdg(self,MainWi

Re: overriding __getitem__ for a subclass of dict

2009-11-16 Thread Carl Banks
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 __getitem__ when new-style classes are > > > involved?  I

Get attribute this way

2009-11-16 Thread King
Python's getattr, setattr and __getattribute__ commands works fine with python types. For example: print o.__getattribute__("name") print getattr(o, "name") This is the easiest way to get an attribute using a string. In my case the "Node" class load/creates all the attributes from a xml file. Exam

Re: Redirect stdout to a buffer [Errno 9]

2009-11-16 Thread Gabriel Genellina
En Mon, 16 Nov 2009 18:04:21 -0300, Ecir Hana escribió: 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 re

Re: overriding __getitem__ for a subclass of dict

2009-11-16 Thread Steve Howell
On Nov 16, 4:06 pm, greg wrote: > Christian Heimes wrote: > > Most magic methods are implemented as descriptors. Descriptors only > > looked up on the type to increase the performance of the interpreter and > > to simply the C API. > > There's also a semantic problem. Since new-style > classes are

Re: overriding __getitem__ for a subclass of dict

2009-11-16 Thread Steve Howell
On Nov 16, 5:46 pm, Steven D'Aprano wrote: > On Mon, 16 Nov 2009 10:32:19 -0800, Steve Howell wrote: > > Actually, the __getitem__ workaround that I proposed earlier only works > > on subclasses of dict, not dict themselves.  So given a pure dictionary > > object, it is impossible to hook into att

Re: Newsgroup for beginners

2009-11-16 Thread Tim Chase
1) Start by complaining that your program doesn't work because of a bug in Python. 1b) Omit the fact that this is a homework problem, and you want c.l.p to do your homework for you 4) Once people start to get annoyed that you won't post any example code showing the problem you're h

Re: Command line arguments??

2009-11-16 Thread rantingrick
On Nov 16, 5:30 pm, "Rhodri James" wrote: > We've been living with this pain ever since windowed GUIs encouraged users   > to put spaces in their file names (Apple, I'm looking at you!).   > Fundamentally, if people want the pretty they have to live with the   > consequences. Thanks everyone , p

Re: Newsgroup for beginners

2009-11-16 Thread Ben Finney
Grant Edwards writes: > 2) State that your program "doesn't work", but don't explain > either what you expect it to do or what it actually does. A different flavour of this is also good for setting the seeds of grouchiness: 2a) Write a Subject field that doesn't say anything about what y

Re: Newsgroup for beginners

2009-11-16 Thread Grant Edwards
On 2009-11-17, Paul Rubin wrote: > mrholtsr writes: >> Is there a Python newsgroup for those who are strictly beginners at >> programming and python? > > This group has its grouchy moments You've really got to try pretty hard to create one. But if you want to, here's how to do it: 1) Start by

ReverseProxy

2009-11-16 Thread Fred C
I have to write a quick and dirty ReverseProxy with Twisted, for one of our internal project. I never used Twisted before, and I was wondering of someone have an handy example of a ReverseProxy with Twisted to help that I can use as bootstrap. Many thanks. Fred-- http://mail.python.org/m

Is pexpect unmaintained now?

2009-11-16 Thread yuzhichang
Pexpect 2.4 is only available at Pypi. Both the homepage of pexpect(http://www.noah.org/wiki/Pexpect) and download page (http://sourceforge.net/projects/pexpect/files/) are outdated. The repository on Github (http://github.com/noahspurrier/pexpect/) has been removed. I ever contacted the author(n.

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

2009-11-16 Thread alex23
Steve Ferg wrote: > Does anybody know a language with this kind of syntax for > ifThenElseEndif? VBScript. > Is there any particular reason why this might be a *bad* language- > design idea? VBScript. -- http://mail.python.org/mailman/listinfo/python-list

Solved: QtPython QtreeWidget - sortingEnabled Problem

2009-11-16 Thread Threader Slash
> -- -- > From: Threader Slash > To: python-list@python.org > Date: Tue, 17 Nov 2009 10:34:34 +1100 > Subject: QtPython QtreeWidget - sortingEnabled Problem > Hello Everybody, > > I trying to do a Qtreewidget to attend a customer design suggestion. I am > coding it on QtPython. I

Re: faster than list.extend()

2009-11-16 Thread Jason Sewall
On Mon, Nov 16, 2009 at 6:28 PM, Raymond Hettinger wrote: > On Nov 16, 2:41 pm, Chris Rebert wrote: >> 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(in

Re: Newsgroup for beginners

2009-11-16 Thread Paul Rubin
mrholtsr writes: > Is there a Python newsgroup for those who are strictly beginners at > programming and python? This group has its grouchy moments but for the most part it's reasonably friendly to beginners. The worst thing that usually happens is that if you ask a simple question, a bunch of e

Re: python simply not scaleable enough for google?

2009-11-16 Thread Paul Rubin
sturlamolden writes: > >       Python is a very clean language held back from widespread use by slow > > implementations.  If Python ran faster, Go would be unnecessary. > > Google is a multi-billion dollar business. They are using Python > extensively. Yes I know about Unladen Swallow, but why c

Re: Python & Go

2009-11-16 Thread Paul Rubin
sturlamolden writes: > A decorator function like @go could just call os.fork and run the > function in the child. We already have a between-process Queue in > multiprocessing to use as channels. Unlike with interthread queues, you have to serialize the values sent through those multiprocessing ch

Re: basic class question..

2009-11-16 Thread Steven D'Aprano
On Sun, 15 Nov 2009 16:26:59 -0800, Pyrot wrote: > On 11월15일, 오후9시52분, "Diez B. Roggisch" wrote: >> Pyrot schrieb: >> >> > class rawDNA: >> >    import string [...] > (Tthe core reason that I'm bothering with this at all is because I heard > imports are costly(in time, space, processing power). I

Re: faster than list.extend()

2009-11-16 Thread Gabriel Genellina
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 results ** These are my best attempts: def tri

Re: overriding __getitem__ for a subclass of dict

2009-11-16 Thread Steven D'Aprano
On Mon, 16 Nov 2009 10:32:19 -0800, Steve Howell wrote: > Actually, the __getitem__ workaround that I proposed earlier only works > on subclasses of dict, not dict themselves. So given a pure dictionary > object, it is impossible to hook into attribute lookups after > instantiation in debugging/t

Re: Logic operators with "in" statement

2009-11-16 Thread Xavier Ho
On Tue, Nov 17, 2009 at 12:46 AM, Chris Rebert wrote: > On Mon, Nov 16, 2009 at 6:23 AM, Xavier Ho wrote: > > 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. >

ZipFile - file adding API incomplete?

2009-11-16 Thread Glenn Maynard
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 to newzip.write(). Ther

Re: overriding __getitem__ for a subclass of dict

2009-11-16 Thread greg
Christian Heimes wrote: Most magic methods are implemented as descriptors. Descriptors only looked up on the type to increase the performance of the interpreter and to simply the C API. There's also a semantic problem. Since new-style classes are also instances (of class 'type') and you can cr

QtPython QtreeWidget - sortingEnabled Problem

2009-11-16 Thread Threader Slash
Hello Everybody, I trying to do a Qtreewidget to attend a customer design suggestion. I am coding it on QtPython. I did a first try using Qt Designer, then generated the code. But when I try to run it, an error comes out: self.centralwidget.setSortingEnabled(__sortingEnabled) AttributeError: setS

Re: Command line arguments??

2009-11-16 Thread Rhodri James
On Mon, 16 Nov 2009 23:18:23 -, rantingrick wrote: I am currently having "fun" with command line arguments in a windows environment. If i get a path that has spaces anywhere in it my script gets the wrong arguments from sys.argv. You guy's probably know what i am talking about. Heres and

Re: faster than list.extend()

2009-11-16 Thread Raymond Hettinger
On Nov 16, 2:41 pm, Chris Rebert wrote: > 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.

Re: Command line arguments??

2009-11-16 Thread Benjamin Kaplan
On Mon, Nov 16, 2009 at 6:18 PM, rantingrick wrote: > I am currently having "fun" with command line arguments in a windows > environment. If i get a path that has spaces anywhere in it my script > gets the wrong arguments from sys.argv. You guy's probably know what i > am talking about. Heres and

Command line arguments??

2009-11-16 Thread rantingrick
I am currently having "fun" with command line arguments in a windows environment. If i get a path that has spaces anywhere in it my script gets the wrong arguments from sys.argv. You guy's probably know what i am talking about. Heres and example. 'C:\\Python26\\Python.exe C:\\echo.py C:\\New Folde

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

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 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: 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: 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

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: 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

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: 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

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: 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

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: 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: 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: 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: 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: 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: 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", "

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: 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

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: 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: 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 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 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, 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: 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: 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

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: 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,

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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 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

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: 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

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: 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: (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

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: 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

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: (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: >>

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: 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: 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: 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 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: 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 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: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: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]:

  1   2   >