Re: Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-07-20 Thread Erik Max Francis
John Ladasky wrote: Why not do genetic programming directly on Python code? Maybe my code tree data structure is redundant to something which already exists? But apparently Python's "_ast" module offers only one-way access -- it will generate an AST from a piece of code, but you can't modify an

Re: Question on Joining of list

2008-07-20 Thread SUBHABRATA
Thanx Terry it worked, I was thinking if input_string could be searched from given_string and replaced in the input_string but your one is smarter. And Peter, thanx for trying to teach conventions. But if I write explicit comments, and carry on using my own variables( I can use anything as they are

Re: Python Written in C?

2008-07-20 Thread Krishnakant Mane
On 21/07/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? > Are you a PH.d

ANNOUNCE: wxPython 2.8.8.1

2008-07-20 Thread Robin Dunn
Announcing -- The 2.8.8.1 release of wxPython is now available for download at http://wxpython.org/download.php. This is a minor bugfix release with several fixes for problems discovered in the 2.8.8.0 release. Source code is available, as well as binaries for Python 2.3, 2.4 and 2.5, f

Re: Python Written in C?

2008-07-20 Thread Yu-Xi Lim
Grant Edwards wrote: On 2008-07-21, Dan Upton <[EMAIL PROTECTED]> wrote: REAL WORLD programmers who want to be generally useful go and learn C#. No: Real programmers first eat a quiche and then return to their Pascal programming. Bah, new-fangled languages like Pascal... Real programmers writ

Re: Python Written in C?

2008-07-20 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >I'm just learning about Python now and it sounds interesting. But I >just read (on the Wiki page) that mainstream Python was written in C. >That's what I was searching for: Python was written in what other >language? > >See, my concern was something like: OK, if Python i

Re: Python Written in C?

2008-07-20 Thread Mensanator
On Jul 20, 11:08 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > On Sun, Jul 20, 2008 at 11:51 PM, Mensanator <[EMAIL PROTECTED]> wrote: > > On Jul 20, 10:05�pm, Stephen Johnson <[EMAIL PROTECTED]> wrote: > >> > Carry bits? Who worries about carry bits when you have > >> > unlimited precision arithmet

Re: Python Written in C?

2008-07-20 Thread Manuel Vazquez Acosta
I think your mixing things up. Even modern C compiler are mostly written in some other high level language. See GCC, for instance: it's mostly written in C. Many languages are made for build other major systems: * C was made in order to ease the build of Unix * Ada was made in order to ease the bu

Re: Python Written in C?

2008-07-20 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > I'm not dissing Python, here. Just noting that, if it is written in C, > that throws a curve at me in trying to balance the value of learning > Python vs. some other major language. Definitely one of the most non-sequitor statements I have ever heard. Actually your entir

Re: Python Written in C?

2008-07-20 Thread Michael Torrie
Mensanator wrote: > On Jul 20, 7:37�pm, Roy Smith <[EMAIL PROTECTED]> wrote: >> In article >> <[EMAIL PROTECTED]>, >> >> �Mensanator <[EMAIL PROTECTED]> wrote: >>> C isn't a high level language, that's part of its problem. >> C is the highest level assembler language > > Isn't that like bragging a

Re: Python Written in C?

2008-07-20 Thread Dan Upton
On Sun, Jul 20, 2008 at 11:51 PM, Mensanator <[EMAIL PROTECTED]> wrote: > On Jul 20, 10:05�pm, Stephen Johnson <[EMAIL PROTECTED]> wrote: >> > Carry bits? Who worries about carry bits when you have >> > unlimited precision arithmetic? You want cool? >> > THIS is cool: >> >> > j = ((invert(xyz[1]-xy

Re: Any Game Developers here?

2008-07-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Python Nutter <[EMAIL PROTECTED]> wrote: > >There are two books I know of currently in print on game programming, >both use PyGame as it was out first. One book is horrible and only >worth for cleaning yourself up after you use the bathroom. The second >is really wel

Re: Python Written in C?

2008-07-20 Thread Mensanator
On Jul 20, 10:05�pm, Stephen Johnson <[EMAIL PROTECTED]> wrote: > > Carry bits? Who worries about carry bits when you have > > unlimited precision arithmetic? You want cool? > > THIS is cool: > > > j = ((invert(xyz[1]-xyz[0],xyz[1]**(k-1))*(xyz[1]**(k-1)-prev_gen[2])) > > % xyz[1]**(k-1))/xyz[1]**(

Re: % sign in python?

2008-07-20 Thread Tim Roberts
Terry Reedy <[EMAIL PROTECTED]> wrote: > >Tim Roberts wrote: >> Steven Howe <[EMAIL PROTECTED]> wrote: >> >>> Terry Reedy wrote: korean_dave wrote: > What does this operator do? Specifically in this context > > test.log( "[[Log level %d: %s]]" % ( level, msg ), description ) >>> >

Re: Python Written in C?

2008-07-20 Thread Casey McGinty
On Sun, Jul 20, 2008 at 5:06 PM, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-07-21, Dan Upton <[EMAIL PROTECTED]> wrote: > > Using punch-cards and paper-tape. Real programmers can edit > their programs with a pointy stick and some home-made > sticky-tape. > > Doesn't everyone know that REA

Re: Python Written in C?

2008-07-20 Thread Grant Edwards
On 2008-07-21, Dan Upton <[EMAIL PROTECTED]> wrote: >>> REAL WORLD programmers who want to be generally useful go and >>> learn C#. >> >> No: Real programmers first eat a quiche and then return to >> their Pascal programming. > > Bah, new-fangled languages like Pascal... Real programmers > write F

Re: Python Written in C?

2008-07-20 Thread Stephen Johnson
Carry bits? Who worries about carry bits when you have unlimited precision arithmetic? You want cool? THIS is cool: j = ((invert(xyz[1]-xyz[0],xyz[1]**(k-1))*(xyz[1]**(k-1)-prev_gen[2])) % xyz[1]**(k-1))/xyz[1]**(k-2) You call that "cool." I call it "unreadable." -Steve Johnson -- http://mail.

Solutions Fast Track - Monitoring and Intrusion

2008-07-20 Thread [EMAIL PROTECTED]
Dear Reader, Designing for Detection - Get the right equipment from the start. Make sure all of the features you need, or will need, are available from the start. - Know your environment. Identify potential physical barriers and possible sources of interference. -

Re: Python Written in C?

2008-07-20 Thread Mensanator
On Jul 20, 7:37�pm, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > > �Mensanator <[EMAIL PROTECTED]> wrote: > > C isn't a high level language, that's part of its problem. > > C is the highest level assembler language Isn't that like bragging about being the smartest kid

db question

2008-07-20 Thread bruce
update... in using the mysql_query log function, i get the following query being registered: select * from foo where dog like "%'small'%" so.. if i can figure out how to get rid of the "'" inside the "%" the query should/will work... thanks Hi... simple test mysql cmd - select * from foo

Re: Python Written in C?

2008-07-20 Thread Dan Upton
On Sun, Jul 20, 2008 at 9:18 PM, Michiel Overtoom <[EMAIL PROTECTED]> wrote: > Giveitawhril wrote... > >> REAL WORLD programmers who want to be generally useful go >> and learn C#. > > No: Real programmers first eat a quiche and then return to their Pascal > programming. Bah, new-fangled languages

Re: Python Written in C?

2008-07-20 Thread Mike
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? C is the universal

db question

2008-07-20 Thread bruce
Hi... simple test mysql cmd - select * from foo where dog like "%small%"; sql ="""select * from foo where dog like "%%%s%%" """ c.execute(sql, (var,)) the above doesn't work, and I can't seem to figure out how to display/print out the sql as i't actually been excuted, so I can see where the is

Re: Python Written in C?

2008-07-20 Thread Michiel Overtoom
Giveitawhril wrote... > REAL WORLD programmers who want to be generally useful go > and learn C#. No: Real programmers first eat a quiche and then return to their Pascal programming. > But the SOURCE is some old, high level language which no one wants to > use anymore! C is alive and kickin

Re: Python Written in C?

2008-07-20 Thread Teiresias
[EMAIL PROTECTED] writes: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? Well, yes, the interpreter and a handful of the c

Re: Python Written in C?

2008-07-20 Thread Carl Banks
On Jul 20, 6:50 pm, [EMAIL PROTECTED] wrote: > I'm not dissing Python, here. Just noting that, if it is written in C, > that throws a curve at me in trying to balance the value of learning > Python vs. some other major language. I somehow doubt the Python community will feel much of a loss if you

Re: Python Written in C?

2008-07-20 Thread John Machin
On Jul 21, 8:50 am, [EMAIL PROTECTED] wrote: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? > > See, my concern was somethin

Re: Python Written in C?

2008-07-20 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Mensanator <[EMAIL PROTECTED]> wrote: > C isn't a high level language, that's part of its problem. C is the highest level assembler language I've ever used. And I've used a few. It really is cool that you can add two 32-bit integers and not have to worry abou

Re: Python Written in C?

2008-07-20 Thread Mensanator
On Jul 20, 5:50�pm, [EMAIL PROTECTED] wrote: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? > > See, my concern was somethin

Re: Python Written in C?

2008-07-20 Thread alex23
On Jul 21, 8:50 am, [EMAIL PROTECTED] wrote: > I'm not dissing Python, here. Just noting that, if it is written in C, > that throws a curve at me in trying to balance the value of learning > Python vs. some other major language. The advantage of Python over C - to me - is in the higher order abstr

Re: Python Written in C?

2008-07-20 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: I'm just learning about Python now and it sounds interesting. But I just read (on the Wiki page) that mainstream Python was written in C. That's what I was searching for: Python was written in what other language? See, my concern was something like: OK, if Python is so

Python Written in C?

2008-07-20 Thread giveitawhril2008
I'm just learning about Python now and it sounds interesting. But I just read (on the Wiki page) that mainstream Python was written in C. That's what I was searching for: Python was written in what other language? See, my concern was something like: OK, if Python is so hot, then, hopefully someone

Re: The Importance of Terminology's Quality

2008-07-20 Thread John W Kennedy
Robert Maas, http://tinyurl.com/uh3t wrote: ... the "thunks" were necessary at the machine-language level to /implement/ ALGOL 60, but they could not be expressed /in/ ALGOL. Ah, thanks for the clarification. Is that info in the appropriate WikiPedia page? If not, maybe you would edit it in? Fr

Re: checking if an object IS in a list

2008-07-20 Thread nicolas . pourcelot
On 20 juil, 23:18, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 21, 4:33 am, [EMAIL PROTECTED] wrote: > > > > (1) You are searching through lists to find float objects by identity, > > > not by value > > > > > You wrote """ > I used short lists (a list of 20 floats) and the element > checke

Re: examples of pipe usage?

2008-07-20 Thread arsyed
On Sun, Jul 20, 2008 at 5:27 PM, Sean McIlroy <[EMAIL PROTECTED]> wrote: > hola > > i'd like to control another interpreter from idle. i don't have any > experience using unix but i think a "pipe" is what i need. am i right > about this? can anybody point me to a simple example of using a pipe > (

Re: regex doubts

2008-07-20 Thread MRAB
On Jul 19, 10:44 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 20, 6:35 am, MRAB <[EMAIL PROTECTED]> wrote: > > > > > On Jul 19, 9:12 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > On Jul 20, 5:04 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > > > Mr SZ wrote: > > > > > I am taking a

Re: Web Server

2008-07-20 Thread James Tanis
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > there's also apache, of course, and a bunch of others, including several > Python solutions (more or less pre-packaged). but the "open up" part > still sounds a bit risky. maybe you could turn things around, and let > the application "push" data to

Re: Question on Joining of list

2008-07-20 Thread MRAB
On Jul 19, 6:34 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Fri, 18 Jul 2008 16:43:35 -0700 (PDT), John Machin > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > The only language I remember that had implicit typing was FORTRAN (GOD > > is real, but JESUS is an i

Re: round function error???

2008-07-20 Thread John Machin
On Jul 21, 12:56 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Jul 19, 12:20 am, John Machin <[EMAIL PROTECTED]> wrote: > > > On Jul 19, 8:05 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > > > for more information. But I'm guessing that you're > > > questioning the fact that a value that's a

examples of pipe usage?

2008-07-20 Thread Sean McIlroy
hola i'd like to control another interpreter from idle. i don't have any experience using unix but i think a "pipe" is what i need. am i right about this? can anybody point me to a simple example of using a pipe (if that's the right thing) for this kind of task? thanks if you can help. peace stm

Re: checking if an object IS in a list

2008-07-20 Thread John Machin
On Jul 21, 4:33 am, [EMAIL PROTECTED] wrote: > > (1) You are searching through lists to find float objects by identity, > > not by value > > You wrote """ I used short lists (a list of 20 floats) and the element checked was not in the list. (That was the case I usually deals with in my code.)

Re: regex doubts

2008-07-20 Thread John Machin
On Jul 21, 12:30 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > John Machin wrote: > >> try "[LRM]+$" (an L or an R or an M, one or more times, all the way to > >> the end of the string). > > > Ummm ... with the default flag settings, shouldn't that be \Z instead > > of $ ? > > Why? The OP was rea

Testing out Newsproxy.

2008-07-20 Thread David M Lemcoe Jr.
Going to see if Newsproxy actually blocks google groups. -=___=- David M Lemcoe Jr. Roswell, Georgia http://www.davidlemcoe.com/ [EMAIL PROTECTED] QRZ: KI4YJL AIM: lemcoe9 YIM: lemcoe9 GTalk: [EMAIL PROTECTED] MSN: [EMAIL PROTECTED] Xfire: shawtylo1 ICQ: 359114839 Alternate

Testing out NewsProxy

2008-07-20 Thread WDC
Please excuse this post, but I am seeing if NewsProxy actually filters out Google Groups or not. -- http://mail.python.org/mailman/listinfo/python-list

Re: matplotlib: Plotting a graph against time

2008-07-20 Thread arsyed
On Sun, Jul 20, 2008 at 9:57 AM, Durand <[EMAIL PROTECTED]> wrote: > Oooh, this is almost what I want but I'm not really sure how I'd > incorporate this into real dates... > If I have a list of dates like ['2008-07-18 14:36:53.494013', > '2008-07-20 14:37:01.508990', '2008-07-28 14:49:26.183256'],

Re: re: question

2008-07-20 Thread Marc 'BlackJack' Rintsch
On Sun, 20 Jul 2008 18:39:52 +0100, Perl_Wizard wrote: > Nobody any sensible answers. Too complicated I suppose! I've often been asked that, i'd be able to buy me a mars bar! Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: question

2008-07-20 Thread Michael Mabin
I think the question was: why does anyone still use perl when Python is clearly the better language? On Sun, Jul 20, 2008 at 2:17 PM, Paddy <[EMAIL PROTECTED]> wrote: > On Jul 20, 6:39 pm, <[EMAIL PROTECTED]> wrote: > > Nobody any sensible answers. Too complicated I suppose! > > The sensible ques

Re: question

2008-07-20 Thread Paddy
On Jul 20, 6:39 pm, <[EMAIL PROTECTED]> wrote: > Nobody any sensible answers. Too complicated I suppose! The sensible question was? -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if an object IS in a list

2008-07-20 Thread nicolas . pourcelot
> (1) You are searching through lists to find float objects by identity, > not by value -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Server

2008-07-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Thanks, Fredrik - that definitely works. Now to get a little greedy - is there something along those lines that is a bit more secure (i.e. allows HTTPS, possibly with authentication)? Basically something that you would feel more comfortable opening up to the Internet..

Re: Web Server

2008-07-20 Thread James Tanis
[EMAIL PROTECTED] wrote: > Thanks, Fredrik - that definitely works. Now to get a little greedy - > is there something along those lines that is a bit more secure (i.e. > allows HTTPS, possibly with authentication)? Basically something that > you would feel more comfortable opening up to the Inter

Re: Run as Service

2008-07-20 Thread jay graves
On Jul 20, 10:48 am, [EMAIL PROTECTED] wrote: > I have, in the past, used SRVANY to run a Python app as a Windows > service.  However, now I am interested in distributing my scripts and > want to make it as painless for the end user as possible (hands-off is > best :).  How can you go about running

Re: The Importance of Terminology's Quality

2008-07-20 Thread Robert Maas, http://tinyurl.com/uh3t
> >> ... the "thunks" were necessary at the machine-language level to > >> /implement/ ALGOL 60, but they could not be expressed /in/ ALGOL. > > Ah, thanks for the clarification. Is that info in the appropriate > > WikiPedia page? If not, maybe you would edit it in? > From: John W Kennedy <[EMAIL P

re: question

2008-07-20 Thread Perl_Wizard
Nobody any sensible answers. Too complicated I suppose! -- http://mail.python.org/mailman/listinfo/python-list

Re: getting with statement to deal with various exceptions

2008-07-20 Thread mk
from __future__ import with_statement class ExceptionManager(object): def __enter__(self): pass def __exit__(self,exc_type,exc_value,tb): if exc_type == IOError: print 'IOError',exc_value[1] return True # suppress it wi

Re: trying to match a string

2008-07-20 Thread Andrew Freeman
John Machin wrote: On Jul 20, 11:14 am, Andrew Freeman <[EMAIL PROTECTED]> wrote: John Machin wrote: (4) I highly doubt that this code was actually to be used in an interactive session, The offending code is a nonsense wherever it is used. the False/True output was trun

Re: singletons

2008-07-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Craig Allen <[EMAIL PROTECTED]> wrote: > >(option 2) >Therefore option two is a family of options where class level members >can be used to share whatever needs to be shared, though strictly the >class is not a singleton since multiple instances are created which >m

Re: getting with statement to deal with various exceptions

2008-07-20 Thread Mark Tolonen
"mk" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello, I'm trying to learn how with statement can be used to avoid writing: prepare() try: something_that_can_raise_SomeException() except SomeException, err: deal_with_SomeException finally: tear_it_down() Verbose, not very re

Re: Web Server

2008-07-20 Thread misceverything
Thanks, Fredrik - that definitely works. Now to get a little greedy - is there something along those lines that is a bit more secure (i.e. allows HTTPS, possibly with authentication)? Basically something that you would feel more comfortable opening up to the Internet.. -- http://mail.python.org/

Run as Service

2008-07-20 Thread misceverything
I have, in the past, used SRVANY to run a Python app as a Windows service. However, now I am interested in distributing my scripts and want to make it as painless for the end user as possible (hands-off is best :). How can you go about running a Python app as a Windows service without SRVANY? --

Re: Passing keywords

2008-07-20 Thread Fredrik Lundh
Kless wrote: I could use the next but I don't think... --- def __check(self, **keywords): --- don't think what? if you keep using the same variables in all submethods you call from a method inside the class, why not make them attributes? otherwise, using the **

Re: Web Server

2008-07-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: As part of a Python app I wrote recently (for Windows), I would like to give the option of an HTTP (HTTPS if possible, but not necessary) front end, which would then call some existing python scripts. My question is - I know I can write a simple HTTP server in Python, b

Re: Missing sqlite3.h Error when Building Debug Python -- Windows Vista

2008-07-20 Thread Tim Golden
Bev in TX wrote: I am a complete newbie at building Python. I am trying to build it under MS Windows Vista (64-bit AMD) with MS VS2005. I'm doing that because I need debug libraries, which I did not see in the standard distribution. I'll leave others to comment on whether or not it's expected

Web Server

2008-07-20 Thread misceverything
As part of a Python app I wrote recently (for Windows), I would like to give the option of an HTTP (HTTPS if possible, but not necessary) front end, which would then call some existing python scripts. My question is - I know I can write a simple HTTP server in Python, but if there's something simp

Passing keywords

2008-07-20 Thread Kless
I've a constructor with several values that must be used by any functions: --- class foo: def __init__(self, foo1, foo2, foon): self.__check(foo1=foo1, foo2=foo2, foon=foon) self.__check2(foo1=foo1, foo2=foo2, foon=foon) def __check(self, foo1, foo2, foon): ...

Re: round function error???

2008-07-20 Thread Mark Dickinson
On Jul 19, 12:20 am, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 19, 8:05 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > > for more information.  But I'm guessing that you're > > questioning the fact that a value that's apparently > > *less* than 3499.35 is rounded up to 3499.4, rather > > tha

Re: regex doubts

2008-07-20 Thread Fredrik Lundh
John Machin wrote: try "[LRM]+$" (an L or an R or an M, one or more times, all the way to the end of the string). Ummm ... with the default flag settings, shouldn't that be \Z instead of $ ? Why? The OP was reading input from a user; whether he gets a trailing newline or not depends on the

Re: Rotating a cube

2008-07-20 Thread Stef Mientki
Fredrik Lundh wrote: David Lyon wrote: But is the question about display graphics ? ie rotating a cube using a python framework ? With something like python and OpenGL ? or Python and PovRay... or perphaps python and imagemagick ? can you name one graphics framework that represents a cube

scanf equivalent in python

2008-07-20 Thread André Michel Descombes
Hello, I often need to parse strings which contain a mix of characters, integers and floats, the C-language scanf function is very practical for this purpose. I've been looking for such a feature and I have been quite surprised to find that it has been discussed as far back as 2001 but never imple

Re: a question that can accelerate learning python?

2008-07-20 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simple. dir(object) [EMAIL PROTECTED] wrote: > I am new to python .But interest in it . > I think if python could provide a method that show every method of an > object or an module.it will be great! We can save a lot of time to > find the document >

Re: matplotlib: Plotting a graph against time

2008-07-20 Thread Durand
On Jul 20, 8:55 am, arsyed <[EMAIL PROTECTED]> wrote: > On Jul 19, 3:09 pm, Durand <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm trying to plot a simple graph against date or time using matplotlib. > > I've read about date_plot but I'm not really sure how to use it. At the > > moment, I have som

running a script with an input file

2008-07-20 Thread David Bikard
I'd like to run a program so that it reads the input() or raw_input() statements from an input file instead of reading from keyboard. I'd also like it to write the print statements in an output file rather than on the screen. I'm on windows XP and when I run: prog_name.py input_file output_file

Re: Unusual Exception Behaviour

2008-07-20 Thread Vinay Sajip
On Jul 18, 5:12 pm, "Robert Rawlins" <[EMAIL PROTECTED]> wrote: > > This is really quite frustrating as I'd much rather use a conf file than > work this programmatically. I get the feeling that it's because in the > config file I was not attaching any handlers to the root logger, but I don't > know

a question that can accelerate learning python?

2008-07-20 Thread wangziqing1984
I am new to python .But interest in it . I think if python could provide a method that show every method of an object or an module.it will be great! We can save a lot of time to find the document take win32com as an example: if code like this "win32com.query"(or some other name that means query) it

Re: Not entirely serious: recursive lambda?

2008-07-20 Thread Fredrik Lundh
Michael Tobis wrote: I realize that lambda is something of an orphan and was arguably a bad idea for anything besides obfuscation, but obfuscation is exactly my purpose here. Can a lambda call itself without giving itself a name? Google was not my friend on this one, and I suspect there is no an

Re: Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-07-20 Thread kib2
David Boddie a écrit : On Sunday 20 July 2008 09:52, John Ladasky wrote: Is there a way to interface Lisp to Python, so that I can do all the interface programming in the language I already know best -- and just do the genetic parts in Lisp? I haven't seen exception handling in Lisp, a feature

Re: Rotating a cube

2008-07-20 Thread Fredrik Lundh
David Lyon wrote: But is the question about display graphics ? ie rotating a cube using a python framework ? With something like python and OpenGL ? or Python and PovRay... or perphaps python and imagemagick ? can you name one graphics framework that represents a cube as "x + 4*y + 16*z" ?

getting with statement to deal with various exceptions

2008-07-20 Thread mk
Hello, I'm trying to learn how with statement can be used to avoid writing: prepare() try: something_that_can_raise_SomeException() except SomeException, err: deal_with_SomeException finally: tear_it_down() Verbose, not very readable. OK, "with" to the rescue? Let's tak

Re: Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-07-20 Thread David Boddie
On Sunday 20 July 2008 09:52, John Ladasky wrote: > Is there a way to interface Lisp to Python, so that I can do all the > interface programming in the language I already know best -- and just > do the genetic parts in Lisp? I haven't seen exception handling in > Lisp, a feature I've come to love

Re: Not entirely serious: recursive lambda?

2008-07-20 Thread Kay Schluehr
On 20 Jul., 13:08, [EMAIL PROTECTED] wrote: > Kay Schluehr: > > > Sure, use a fixed point combinator. I've just added this recipe: > >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/576366 > > Does it work? > > Bye, > bearophile There are lots of informal derivations of the Y combinator on

RE: __del__ methods

2008-07-20 Thread Robert Rawlins
> Are you talking about the __new__ method ? Or about metaclasses ? Sorry Bruno, I should have made that a little clearer. I was talking about the __new__ method. Cheers mate, Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Tracing urllib2 Error, Please?

2008-07-20 Thread Rob Wolfe
Larry Hale <[EMAIL PROTECTED]> writes: > Since it seems I have a "unique" problem, I wonder if anyone could > point me in the general/right direction for tracking down the issue > and resolving it myself. > > See my prior post @ > http://groups.google.com/group/comp.lang.python/browse_thread/thre

Re: Writing a program under GNU/Linux for MS Windows.

2008-07-20 Thread Nicol van der Merwe
On 7/18/08, Levi Campbell <[EMAIL PROTECTED]> wrote: > Hi, I'm trying to write a program for a friend of mine who uses > windows but I use GNU/Linux. I know you can use mingw and link to the > python dll, but is there a way to create a win32 service under Linux? > -- > http://mail.python.org/mailma

Re: __del__ methods

2008-07-20 Thread Bruno Desthuilliers
Robert Rawlins a écrit : Time to fix that, then, with some documentation http://www.python.org/doc/>, and by working through the Python tutorial http://www.python.org/doc/tut/>. Thanks Ben, I'll be sure to read through these. I also read through this http://www.geocities.com/foetsch/python/ne

Re: Not entirely serious: recursive lambda?

2008-07-20 Thread bearophileHUGS
Kay Schluehr: > Sure, use a fixed point combinator. I've just added this recipe: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/576366 Does it work? Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

RE: __del__ methods

2008-07-20 Thread Robert Rawlins
> Time to fix that, then, with some documentation > http://www.python.org/doc/>, and by working through the Python > tutorial http://www.python.org/doc/tut/>. Thanks Ben, I'll be sure to read through these. I also read through this http://www.geocities.com/foetsch/python/new_style_classes.htm ear

Re: __del__ methods

2008-07-20 Thread Ben Finney
"Robert Rawlins" <[EMAIL PROTECTED]> writes: > This isn’t something I'd seen before (god that makes me feel stupid). No need to feel stupid, unless you've had the opportunity to learn and passed it by. > I've always based my code off the odd example that's dotted around Time to fix that, then,

RE: __del__ methods

2008-07-20 Thread Robert Rawlins
> In Python 2.x, "classic" classes (which are not part of the unified > type hierarchy) are deprecated, and exist only for backward > compatibility with old code. > > You need to create "new-style" classes > http://www.python.org/doc/newstyle/> by inheriting from some > class that is part of the un

Re: Problems with curses

2008-07-20 Thread Siddhant
On Jul 13, 6:22 pm, Clay Hobbs <[EMAIL PROTECTED]> wrote: > > On Sat, 12 Jul 2008 20:49:56 -0400, Clay Hobbs wrote: > > > >       Unfortunately, the error message isn't very helpful. > > > But it would be helpful to tell it.  If you get exceptions, always > > copy'n'paste the traceback here.  Peopl

Re: MethodChain

2008-07-20 Thread James Coglan
> Name clashes aren't an issue, since MethodChain doesn't apply any > special meaning to the method names it knows; the limitation is > because JavaScript doesn't allow you to modify property lookup > behavior.  And since we can make the chain object callable, we don't > need "fire" or "toFunction

Re: Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-07-20 Thread Kay Schluehr
On 20 Jul., 09:52, John Ladasky <[EMAIL PROTECTED]> wrote: > Why not do genetic programming directly on Python code? Maybe my code > tree data structure is redundant to something which already exists? > But apparently Python's "_ast" module offers only one-way access -- it > will generate an AST

Re: matplotlib: Plotting a graph against time

2008-07-20 Thread arsyed
On Jul 19, 3:09 pm, Durand <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to plot a simple graph against date or time using matplotlib. I've > read about date_plot but I'm not really sure how to use it. At the moment, I > have some data arranged into lists, where list1 contains x values (time) a

Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-07-20 Thread John Ladasky
Hi folks, I've played around with neural nets for a while. I wrote my own slow, pure-Python NN package. I knew that there were Python NN packages out there -- but I couldn't really understand their features and documentation at first, not without some hands-on experience. I haven't yet solved a

Re: MethodChain

2008-07-20 Thread Miles
On Sun, Jul 20, 2008 at 1:01 AM, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > The methods are a problem IMHO. You can't add an own method/function with > the name `fire()` or `toFunction()`. `MethodChain` has to know all > functions/methods in advance. You can add the methods of whole c

Re: Not entirely serious: recursive lambda?

2008-07-20 Thread Kay Schluehr
On 20 Jul., 04:43, Michael Tobis <[EMAIL PROTECTED]> wrote: > Can a lambda call itself without giving itself a name? Sure, use a fixed point combinator. I've just added this recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/576366 > Google was not my friend on this one, and I susp