Standalone USB Web Server and Python Interpeter

2007-12-04 Thread mcl
I would like to have a USB pen drive, which can execute python scripts including CGI versions, which I can take to any Windows PC and run without having to install anything on the PC. My days of hacking are past so I am looking for something very simple. I would envisage a batch file which would

RV: Receiving messages blocks all :-(

2007-12-04 Thread Jose Ignacio Gisbert
First, sorry for sending this mail to this list, I know this is off-topic, but xmpppy-devel mailing list is out of work :-( If someone uses xmpppy, please try to answer me, or at least give me a more adequate mailing list, please. Thank you. ---

Re: project - trivia game

2007-12-04 Thread Ramsey Nasser
Shawn, First of all, next time try and isolate the problem yourself and send a short snippet of code demonstrating the behavior you're having trouble with. This makes it easier for other people to understand what is going on and help you in a more focused way. On Dec 5, 2007 2:43 AM, Shawn Minisa

Send file in base64

2007-12-04 Thread Jose Ignacio Gisbert
Hi all, I need to send a file to a server using xmlrpc api. The receiver must get file data in base64 type, and what I do is: openfilename=tkFileDialog.askopenfilename(filetypes=[("all files", "*")]) f=open(tlocald.get(),'r') functionsend(xmlrpclib.Binary(f), f.name) And what I get i

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Deltantor
[EMAIL PROTECTED] wrote: > This is *not* an attempt to start yet another Python-versus- > AnyOtherProgrammingLanguage flame war, but I thought people might be > interested in this: > > http://www.tiobe.com/tpci.htm > > Marc Real programmers use brainfuck. Kidding of course, I believe someone sho

Re: YOU MUST KNOW THIS MAN

2007-12-04 Thread Deltantor
aassime abdellatif wrote: > In The Name Of Allaah, > > Most Gracious, Most Merciful > > > YOU MUST KNOW THIS MAN > MUHAMMAD > (May peace and blessings of God Almighty be upon him) > > > You may be an atheist or an agnostic; or you may belong to a

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Carl Banks
On Dec 4, 10:24 am, George Sakkis <[EMAIL PROTECTED]> wrote: > Cool (assuming these numbers actually mean something), but this has > more to do with Perl's fall than Python's > increase:http://www.tiobe.com/tiobe_index/Perl.html. I'd say that's even better news. > Even more amazing is the rate C

Re: Why Python 3?

2007-12-04 Thread Carl Banks
On Dec 4, 11:39 pm, Chris Gonnerman > I don't think I can surely be the only one. Certainly, I'm nobody > important; it's not as if my opinion has any real bearing on the > situation. I suspect that many Python coders will stay with 2.x; after > all, this is Open Source... there is no Micro$oft f

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > Anyone has an idea what the huge peak around the middle of 2004 can be > attributed to? There's a Q/A section at the bottom of http://www.tiobe.com/index.htm?tiobe_index which covers this: Q: What happened to Java

Re: Python Class Best Practice

2007-12-04 Thread Pavan Mishra
On Dec 5, 4:18 am, Rod Person <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I've been doing python programming for about 2 years as a hobby and now > I'm finally able to use it at work in an enterprise environment. Since > I will be creating the base classes and l

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Daniel Fetchinson
On 12/4/07, Daniel Fetchinson <[EMAIL PROTECTED]> wrote: > > > Well we Python folks are spoiled but for most people C++ counts as a > > > high level language > > > > Well, some parts are high-level, but it's full of very > > deep elevator shafts for you to accidentally fall > > into... > > > > A tr

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Daniel Fetchinson
> > Well we Python folks are spoiled but for most people C++ counts as a > > high level language > > Well, some parts are high-level, but it's full of very > deep elevator shafts for you to accidentally fall > into... > > A truly high-level language also *doesn't* have low > level parts (or at leas

Why Python 3?

2007-12-04 Thread Chris Gonnerman
I spent some time today reading about Python 3, and specifically the differences between Python 3 and Python 2, and I was left with a question... why? Why bother to change to Python 3, when the CPython implementation is slower, and probably will be for a while? When I learned Python, 1.5 was t

Getting wxPython to work on a Mac

2007-12-04 Thread Timothy Smith
Not sure exactly what I need to do to get wxPython to work on either of my Macs. (One's a notebook running Tiger (OS X 10.4.11), the other a Mac Pro running Leopard (10.5.1.)) I downloaded what should be the latest binary, and it installed without error. So Python comes up as $ python -V Pytho

Re: Python Class Best Practice

2007-12-04 Thread Rod Person
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, 04 Dec 2007 15:51:18 -0800 Gary Herron <[EMAIL PROTECTED]> wrote: > Rod Person wrote: > > > > 1: > > class Foo(object): > > member1='' > > member2=0 > > > > def __init__(self,member1='',member2=0): > > self.member1 = member1 > >

RE project - trivia game

2007-12-04 Thread Shawn Minisall
Sorry, 4got to send it in html for the bold parts. thx def drawMainMenu(win): #define and draw the buttons mainMenuList = [] mainMenuList.append (CreateRect(4,6,7,8,"grey",win)) mainMenuList.append (CreateRect(3.5,6.5,5,6,"grey",win)) mainMenuList.append (CreateRect(3.5,6.5,3,4,"g

project - trivia game

2007-12-04 Thread Shawn Minisall
For my final project, I'm trying to do a GUI based game similar to are you smarter then a 5th grader. I've been working on it and am stuck with some code someone helped me with to randomize the A,B,C,D letters that the correct answer is assigned too. The code that does this is highlighted in

Re: Any idea how to open Matlab and run M-files by using Python?

2007-12-04 Thread [EMAIL PROTECTED]
On Dec 3, 6:12 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On 3 Des, 05:02, itcecsa <[EMAIL PROTECTED]> wrote: > > > I am implementing a small Python project, what I am going to do is to > > open Matlab and run some M-files, and get some output from Matlab > > command prompt. > > > I have no idea

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread greg
George Sakkis wrote: > Well we Python folks are spoiled but for most people C++ counts as a > high level language Well, some parts are high-level, but it's full of very deep elevator shafts for you to accidentally fall into... A truly high-level language also *doesn't* have low level parts (or at

Re: Python Class Best Practice

2007-12-04 Thread Gary Herron
Rod Person wrote: > I've been doing python programming for about 2 years as a hobby and now > I'm finally able to use it at work in an enterprise environment. Since > I will be creating the base classes and libraries I wondering which why > is consider best when creating python classes: > > 1: > cl

Python Class Best Practice

2007-12-04 Thread Rod Person
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've been doing python programming for about 2 years as a hobby and now I'm finally able to use it at work in an enterprise environment. Since I will be creating the base classes and libraries I wondering which why is consider best when creating python

Re: Delete a instance passed by reference into a method

2007-12-04 Thread hdante
On Dec 4, 11:47 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-12-03 at 18:27 -0800, hdante wrote: > > (note, you don't want to do this, it's a proof of concept) > > > import sys > > > class A(object): > >def __init__(self): > >pass > >def m1(self, x = None): > >

Re: Screen Shots?

2007-12-04 Thread Mike C. Fletcher
katie smith wrote: > UGH so frustrating. In my game there is a minimap. On top of the > minimap is a window showing the part of the map your viewing. The > minimap is composed of other little pictures piled of top of eachother. > > I want to know how to basically take a picture from ex.((50,50),t

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread Gabriel Genellina
En Tue, 04 Dec 2007 14:49:36 -0300, Dennis Lee Bieber <[EMAIL PROTECTED]> escribió: > How about the cognate: Kulkukan? You meant Kukulkan. If you got it wrong from "Apocalypto" (Mel Gibson), well, it's just one of many errors in the film... -- Gabriel Genellina -- http://mail.python

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread Kristina ivana
On 4 Dec 2007 13:40:47 GMT, Marc 'BlackJack' Rintsch declaimed the following in comp.lang.python: > On Tue, 04 Dec 2007 08:31:55 +0100, Zara wrote: > > > > He meant quetzatcoatl. We could rename the language. > > That name is already taken in the progr

Re: python 2.5 - f=open('a_file.txt','w') gives [Errno 2]

2007-12-04 Thread Bruno Desthuilliers
dirkheld a écrit : >>How exactly are you starting the Python interpreter? "No such file or >>directory" on file creation can happen when you try to create a file >>in a directory that has ceased to exist: > > > Damn...now it's time to be ashamed. Because of my new installation of > leopard I use

Re: using pdb and catching exception

2007-12-04 Thread Diez B. Roggisch
Amit Gupta schrieb: > On Dec 3, 11:10 am, Amit Gupta <[EMAIL PROTECTED]> wrote: >> >> Thanks Frank. But again, this results into stack-track when the >> exception is caught. On the other hand, I would like the debug-trace >> just before throwing the exception. As a case, I might be debugging >> cod

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, George Sakkis <[EMAIL PROTECTED]> wrote: > On Dec 4, 10:08 am, [EMAIL PROTECTED] wrote: > > This is *not* an attempt to start yet another Python-versus- > > AnyOtherProgrammingLanguage flame war, but I thought people might be > > interested in this: > > > > http:/

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > http://www.tiobe.com/tpci.htm But dreaded Ruby is coming up fast. Run Away! Run Away! HAHAHAHAHAHA. -- -- Lou Pecora -- http://mail.python.org/mailman/listinfo/python-list

Re: writing results to array

2007-12-04 Thread Bevan Jenkins
Thank you all very much. Firstly for providing an answer that does exactly what I require. But also for the hints on the naming conventions and the explanations of how I was going wrong. Thanks again, b -- http://mail.python.org/mailman/listinfo/python-list

Undefined Symbols while importing modules

2007-12-04 Thread [EMAIL PROTECTED]
Hi all, I have been learning to write Python extension modules, and am quite at a loss over a small glitch thats taking place. When I import my module I get the following exception >>> import pygsmd Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/

PyObjC and Webkits

2007-12-04 Thread Tommy Grav
I am trying to install PyObjC 1.4 on my Mac OS X 10.4.11. I run: [EMAIL PROTECTED] Temporary/pyobjc-1.4 --> python setup.py bdist_mpkg -- open ** using pyobjc source-deps py2app for building running bdist_mpkg installing to build/bdist.macosx-10.3-fat/mpkg running build running build_py running

Re: Different kinds of Import Errors

2007-12-04 Thread Gabriel Genellina
On 1 dic, 02:41, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Dec 1, 12:24 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > > Sorry, but this does not work. If there is an ImportError > > during importing the existing module, it won't get inserted > > into sys.modules. I just tried it with a

Re: Tool for translating Matlab to Python?

2007-12-04 Thread Shane Geiger
I would like such a tool, too. Could someone with an interest in MatLab help me figure out how to express this in Python? :-) http://caprolibra.com/B10g/images/OptI_column_effect1/index.html Rolf, you may not have seen this recently on this list: http://www.geocities.com/ptmcg/python/using_m

Tool for translating Matlab to Python?

2007-12-04 Thread Rolf Wester
Hi, is there a tool to automatically translate Matlab source to Python/numpy code? Regards Rolf -- http://mail.python.org/mailman/listinfo/python-list

Re: os.access() under windows

2007-12-04 Thread Martin v. Löwis
> Up to a point: this meets the case where we fail to access > the file at all (for read or write or whatever). But what > about where we can read the directory entry, and the > read-only attribute isn't set? At present, we'll return > True to a W_OK access check in these circs, but this user > mig

Re: Why use Slot? from Peter Norvig's AI code

2007-12-04 Thread Terry Reedy
"Davy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi all, | | When reading Python source code of Peter Norvig's AI book, I found it | hard for me to understand the idea of slot (function nested in | function). Please see "program()" nested in "make_agent_program()", | why not u

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Paul Rudin
George Sakkis <[EMAIL PROTECTED]> writes: > On Dec 4, 11:07 am, Paul Rudin <[EMAIL PROTECTED]> wrote: >> George Sakkis <[EMAIL PROTECTED]> writes: >> > Even more amazing is the rate C++ is losing ground: >> >http://www.tiobe.com/tiobe_index/C__.html >> >> I don't really find surprising that low le

Re: os.access() under windows

2007-12-04 Thread Tim Golden
Martin v. Löwis wrote: >> Now, ironically, I'm confused by your recap :) What I meant to say was >> that the os.access function as implemented under Windows returns False >> if the path in question (say, "x:\someones-private-docs\diary.doc") was >> inaccessible to the process invoking os.access by

Re: Escaping the semicolon?

2007-12-04 Thread Nick
> > If you move '\\' to the front of your list of replacement characters, > things will probably work as you expect. > > -- > Jerry I knew it would be something like that! Thanks for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread George Sakkis
On Dec 4, 11:07 am, Paul Rudin <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > Even more amazing is the rate C++ is losing ground: > >http://www.tiobe.com/tiobe_index/C__.html > > I don't really find surprising that low level languages lose ground at > the expense of high

Re: Escaping the semicolon?

2007-12-04 Thread Jerry Hill
On Dec 4, 2007 11:33 AM, Nick <[EMAIL PROTECTED]> wrote: > Try "123 *?/ abc d;o /$'" as the argument... and you get - > > 123 \*\?\/ abc d\\;o \/\$ That's because of the order you're doing the replacement. Put a print statement inside your for loop and you'll see something like this: input start

Re: os.access() under windows

2007-12-04 Thread Martin v. Löwis
> Now, ironically, I'm confused by your recap :) What I meant to say was > that the os.access function as implemented under Windows returns False > if the path in question (say, "x:\someones-private-docs\diary.doc") was > inaccessible to the process invoking os.access by virtue of file > system per

Re: Escaping the semicolon?

2007-12-04 Thread Nick
Thanks guys, you answered that interactive prompt question really clearly however, whats going on here. This works now - >>> working_string = '123;abc' >>> search_string = ';' >>> print working_string.replace(search_string, '\\' + search_string) 123\;abc But this doesn't - --- import sys import

Re: Different kinds of Import Errors

2007-12-04 Thread Thomas Guettler
Graham Dumpleton schrieb: > What example did you use to test it? What version of Python are you > using? Yes, this changed. Python 2.3 includes the half imported module. Python 2.4 does not. But the traceback of the exception contains the needed information: Here are the two example files: # fo

Re: os.access() under windows

2007-12-04 Thread Tim Golden
Martin v. Löwis wrote: >> Martin. Could you confirm that the outline below correctly >> describes the behaviour of the os.access function under >> Windows, please? > > It's correct for Python 2.5.2 and 2.6; for 2.5.1 (as discussed) > the test "if directory:return True" was not implemented. Thanks

Re: Escaping the semicolon?

2007-12-04 Thread Mel
Nick wrote: > Is this expected behavior? > s = '123;abc' s.replace(';', '\;') > '123\\;abc' > > I just wanted a single backslash. I can see why this probably happens > but i wondered if it is definitely intentional. What you're seeing on the screen is a "literalization" of the string

Re: newbie:this program stops responding after pressing quit button

2007-12-04 Thread Eric Brunel
On Tue, 04 Dec 2007 14:32:34 +0100, Boris <[EMAIL PROTECTED]> wrote: > I am using windows vista and python 2.5 .This program stops responding > after pressing quit button. I am not able to figure the problem out. > please help. > > from Tkinter import * > > def greeting( ): > print 'Hello stdou

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Paul Rudin
George Sakkis <[EMAIL PROTECTED]> writes: > Even more amazing is the rate C++ is losing ground: > http://www.tiobe.com/tiobe_index/C__.html I don't really find surprising that low level languages lose ground at the expense of higher level ones. The developer-time/run-time trade-off tends to move

Re: Escaping the semicolon?

2007-12-04 Thread Tim Chase
> Is this expected behavior? > s = '123;abc' s.replace(';', '\;') > '123\\;abc' You're asking the interpreter to print a representation of your string, so it does so. Representations wrap the results in quotes and escape characters within that need escaping. >>> s.replace(';', '\;'

Re: read lines

2007-12-04 Thread Bruno Desthuilliers
Peter Otten a écrit : > Bruno Desthuilliers wrote: > >> # You don't need to read the whole file in memory > >> lines1, lines2 = tee(infile) >> print min(extract_numbers(lines1)), max(extract_numbers(lines2)) > > tee() internally maintains a list of items that were seen by > one but not all of th

Re: Escaping the semicolon?

2007-12-04 Thread Diez B. Roggisch
Nick wrote: > Hi all, > > Is this expected behavior? > s = '123;abc' s.replace(';', '\;') > '123\\;abc' > > I just wanted a single backslash. I can see why this probably happens > but i wondered if it is definitely intentional. There is only a single backslash. But the interactive pr

Re: os.access() under windows

2007-12-04 Thread Martin v. Löwis
> Martin. Could you confirm that the outline below correctly > describes the behaviour of the os.access function under > Windows, please? It's correct for Python 2.5.2 and 2.6; for 2.5.1 (as discussed) the test "if directory:return True" was not implemented. Notice that the first sentence: "If t

Re: Escaping the semicolon?

2007-12-04 Thread Bruno Desthuilliers
Nick a écrit : > Hi all, > > Is this expected behavior? > s = '123;abc' s.replace(';', '\;') > '123\\;abc' >>> print s.replace(';', '\;') 123\;abc > I just wanted a single backslash. You got it - even if it's not obvious !-) > I can see why this probably happens > but i wondered if

Re: Escaping the semicolon?

2007-12-04 Thread Sergio Correia
On Dec 4, 2007 10:40 AM, Nick <[EMAIL PROTECTED]> wrote: > Is this expected behavior? > > >>> s = '123;abc' > >>> s.replace(';', '\;') > '123\\;abc' > Everything is Ok. It's still a single backslash. Try: >>> print s.replace(';', '\;') Or >>> x = s.replace(';', '\;') >>> print x Best, Sergio

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread Duncan Booth
George Sakkis <[EMAIL PROTECTED]> wrote: > Even more amazing is the rate C++ is losing ground: > http://www.tiobe.com/tiobe_index/C__.html Given that the ratings are relative it may simply indicate that C++ is standing still while the others run ahead. -- http://mail.python.org/mailman/listinfo

Escaping the semicolon?

2007-12-04 Thread Nick
Hi all, Is this expected behavior? >>> s = '123;abc' >>> s.replace(';', '\;') '123\\;abc' I just wanted a single backslash. I can see why this probably happens but i wondered if it is definitely intentional. Thanks Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie:this program stops responding after pressing quit button

2007-12-04 Thread Michael Speer
On Dec 4, 2007 8:32 AM, Boris <[EMAIL PROTECTED]> wrote: > I am using windows vista and python 2.5 .This program stops responding > after pressing quit button. I am not able to figure the problem out. > please help. > > from Tkinter import * > > def greeting( ): > print 'Hello stdout world!...'

Question involving a Python app...

2007-12-04 Thread Nick Watton
hi not a direct answer to your question, but fixes the issue. full details of a work-around at this link: http://www.sephiroth.it/phpBB/showthread.php?t=9244 cheers Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread George Sakkis
On Dec 4, 10:08 am, [EMAIL PROTECTED] wrote: > This is *not* an attempt to start yet another Python-versus- > AnyOtherProgrammingLanguage flame war, but I thought people might be > interested in this: > > http://www.tiobe.com/tpci.htm > > Marc Cool (assuming these numbers actually mean something),

Re: Die, thread! Die! (Was Re: "Python" is not a good name)

2007-12-04 Thread bryan rasmussen
Could we name Stackless Die, microthread! Die! then? Cheers, Bryan Rasmussen On Dec 4, 2007 4:04 PM, Shane Geiger <[EMAIL PROTECTED]> wrote: > Die, thread! Die! > > > > grflanagan wrote: > > On Dec 4, 11:53 am, [EMAIL PROTECTED] wrote: > > > >> On Dec 4, 11:36 am, MarkE <[EMAIL PROTECTED]> wrote:

Re: read lines

2007-12-04 Thread Peter Otten
Bruno Desthuilliers wrote: > # You don't need to read the whole file in memory > lines1, lines2 = tee(infile) > print min(extract_numbers(lines1)), max(extract_numbers(lines2)) tee() internally maintains a list of items that were seen by one but not all of the iterators returned. Therefore after

Python surpasses Perl in TIOBE index

2007-12-04 Thread marcpenninga
This is *not* an attempt to start yet another Python-versus- AnyOtherProgrammingLanguage flame war, but I thought people might be interested in this: http://www.tiobe.com/tpci.htm Marc -- http://mail.python.org/mailman/listinfo/python-list

Die, thread! Die! (Was Re: "Python" is not a good name)

2007-12-04 Thread Shane Geiger
Die, thread! Die! grflanagan wrote: > On Dec 4, 11:53 am, [EMAIL PROTECTED] wrote: > >> On Dec 4, 11:36 am, MarkE <[EMAIL PROTECTED]> wrote: >> >> >>> Ithon >>> >> Pie - Fun >> > > Pie-a-thon? > > http://montypython.tribe.net/thread/fd519910-25e3-4102-b898-8815d6ece32a > > ht

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread George Sakkis
On Dec 3, 12:50 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I know this because I've been through it myself. When I tell people > that I use Python, I often qualify it by pointing out that it is used > extensively at Google. In other words, I'm banking on the reputation > of Google to offset the go

Re: reloading modules and isinstance()

2007-12-04 Thread Diez B. Roggisch
Tlis wrote: > I am using a software system with an embedded Python interpreter > (version 2.3) for scripting. The KcsPoint2D.py module contains a > Point2D class with the following method: > > def SetFromMidpoint(self, p1, p2): >if not isinstance(p1, Point2D) or not isinstance(p2, Point2D): >

RE:connect to server question

2007-12-04 Thread jyoung79
Hi Martin, Thanks very much for your help. This works perfect!! Jay >> Here's the code I presently use in a Bash Shell script: >> >> /bin/mkdir -p /Volumes/A_Share >> /sbin/mount_afp "afp://username:[EMAIL PROTECTED]/A_Share" >> "/Volumes/A_Share" >> >> Can something similar be done w

reloading modules and isinstance()

2007-12-04 Thread Tlis
I am using a software system with an embedded Python interpreter (version 2.3) for scripting. The KcsPoint2D.py module contains a Point2D class with the following method: def SetFromMidpoint(self, p1, p2): if not isinstance(p1, Point2D) or not isinstance(p2, Point2D): raise TypeError, 'so

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread Bjoern Schliessmann
Marc 'BlackJack' Rintsch wrote: > On Tue, 04 Dec 2007 08:31:55 +0100, Zara wrote: >> He meant quetzatcoatl. We could rename the language. > > That name is already taken in the programming language domain. > There's a Tiny C compiler for 6510 based targets: Uh, why don't take one of his aliases?

Re: read lines

2007-12-04 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : (snip) > # Notice that here, b is a string, not a number... > try: > b = int(tmp[1]) oops, I meant: b = float(tmp[1]) Idem here: > def extract_number(iterable): > for linenum, line in enumerate(iterable): > try: >

Re: read lines

2007-12-04 Thread Bruno Desthuilliers
Chris a écrit : > On Dec 4, 2:14 pm, Horacius ReX <[EMAIL PROTECTED]> wrote: >> Hi, I have a text file like this; >> >> 1 -33.453579 >> 2 -148.487125 >> 3 -195.067172 >> 4 -115.958374 >> 5 -100.597841 >> 6 -121.566441 >> 7 -121.025381 >> 8 -132.103507 >> 9 -108.939327 >> 10 -97.046703 >> 11 -52.866

Re: Delete a instance passed by reference into a method

2007-12-04 Thread Carsten Haese
On Mon, 2007-12-03 at 18:27 -0800, hdante wrote: > (note, you don't want to do this, it's a proof of concept) > > import sys > > class A(object): > def __init__(self): > pass > def m1(self, x = None): > if x == None: > x = sys._getfram

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread Marc 'BlackJack' Rintsch
On Tue, 04 Dec 2007 08:31:55 +0100, Zara wrote: > On Sat, 1 Dec 2007 16:51:35 +0200, "Dotan Cohen" > <[EMAIL PROTECTED]> wrote: > >>On 30/11/2007, Gerardo Herzig <[EMAIL PROTECTED]> wrote: >>> You will be eaten by the Snake-Ra god tonight! >> >>Wasn't Ra the Sun god? >> > > He meant quetzatcoatl

Re: converting to and from octal escaped UTF--8

2007-12-04 Thread MonkeeSage
On Dec 3, 8:10 am, Michael Goerz <[EMAIL PROTECTED]> wrote: > MonkeeSage wrote: > > On Dec 3, 1:31 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > >> On Dec 2, 11:46 pm, Michael Spencer <[EMAIL PROTECTED]> wrote: > > >>> Michael Goerz wrote: > Hi, > I am writing unicode stings into a special

Re: read lines

2007-12-04 Thread Zepo Len
> Your regex is not working correctly I guess, I don't even know why you > are using a regex, something like this would work just fine: > > import sys > nums = [float(line.split(' -')[1]) for line in open(sys.argv[1])] > print 'min=', min(nums), 'max=', max(nums) Sorry, that should be line.split

Re: read lines

2007-12-04 Thread Piet van Oostrum
> Horacius ReX <[EMAIL PROTECTED]> (HR) wrote: >HR> while 1: >HR> line = infile1.readline() You have an infinite loop. Fortunately your program stops because of the error. When you encounter end of file, line becomes the empty string and the split gives you only 1 item instead of 2.

newbie:this program stops responding after pressing quit button

2007-12-04 Thread Boris
I am using windows vista and python 2.5 .This program stops responding after pressing quit button. I am not able to figure the problem out. please help. from Tkinter import * def greeting( ): print 'Hello stdout world!...' win = Frame( ) win.pack( ) Label(win, text='Hello container world')

Re: converting to and from octal escaped UTF--8

2007-12-04 Thread Piet van Oostrum
> Michael Goerz <[EMAIL PROTECTED]> (MG) wrote: >MG> if (ord(character) < 32) or (ord(character) > 128): If you encode chars < 32 it seems more appropriate to also encode 127. Moreover your code is quadratic in the size of the string so if you use long strings it would be better to u

Re: read lines

2007-12-04 Thread Neil Cerutti
On 2007-12-04, Horacius ReX <[EMAIL PROTECTED]> wrote: > Hi, I have a text file like this; > > 1 -33.453579 > 2 -148.487125 > 3 -195.067172 > 4 -115.958374 > 5 -100.597841 > 6 -121.566441 > 7 -121.025381 > 8 -132.103507 > 9 -108.939327 > 10 -97.046703 > 11 -52.866534 > 12 -48.432623 > 13 -112.79041

Re: read lines

2007-12-04 Thread Zepo Len
> Hi, I have a text file like this; > > 1 -33.453579 > 2 -148.487125 > > > So I want to write a program in python that reads each line and > detects which numbers of the second column are the maximum and the > minimum. > > I tried with; > > import os, sys,re,string > > # first parameter is the

Re: python 2.5 - f=open('a_file.txt','w') gives [Errno 2]

2007-12-04 Thread dirkheld
> How exactly are you starting the Python interpreter? "No such file or > directory" on file creation can happen when you try to create a file > in a directory that has ceased to exist: Damn...now it's time to be ashamed. Because of my new installation of leopard I used another computername. So

Re: PYTHONPATH and PYTHON_PATH

2007-12-04 Thread Christian Heimes
loial wrote: > Is there any difference? > > Does it matter which I use? Yes, it does matter. The former is interpreted by Python, the latter isn't. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: read lines

2007-12-04 Thread Chris
On Dec 4, 2:14 pm, Horacius ReX <[EMAIL PROTECTED]> wrote: > Hi, I have a text file like this; > > 1 -33.453579 > 2 -148.487125 > 3 -195.067172 > 4 -115.958374 > 5 -100.597841 > 6 -121.566441 > 7 -121.025381 > 8 -132.103507 > 9 -108.939327 > 10 -97.046703 > 11 -52.866534 > 12 -48.432623 > 13 -112.7

read lines

2007-12-04 Thread Horacius ReX
Hi, I have a text file like this; 1 -33.453579 2 -148.487125 3 -195.067172 4 -115.958374 5 -100.597841 6 -121.566441 7 -121.025381 8 -132.103507 9 -108.939327 10 -97.046703 11 -52.866534 12 -48.432623 13 -112.790419 14 -98.516975 15 -98.724436 So I want to write a program in python that reads eac

Re: Why use Slot? from Peter Norvig's AI code

2007-12-04 Thread Bruno Desthuilliers
Davy a écrit : > Hi all, > > When reading Python source code of Peter Norvig's AI book, I found it > hard for me to understand the idea of slot (function nested in > function). First point : this code seems to be based on an older (way older) Python version, so some things would not be done tha

PYTHONPATH and PYTHON_PATH

2007-12-04 Thread loial
Is there any difference? Does it matter which I use? -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with import

2007-12-04 Thread Alexander Dietz
Aaah, this it it! Thank you very much... Alex On Dec 4, 2007 11:49 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > Hi, > > > > I have some problems when importing a library. Suppose I have a > > directory /home/user/pythonlib/package in which I have a python- >

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread grflanagan
On Dec 4, 11:53 am, [EMAIL PROTECTED] wrote: > On Dec 4, 11:36 am, MarkE <[EMAIL PROTECTED]> wrote: > > > Ithon > > Pie - Fun Pie-a-thon? http://montypython.tribe.net/thread/fd519910-25e3-4102-b898-8815d6ece32a http://www.flickr.com/photos/kirstywombat/1862165664/ -- http://mail.python.org/mail

Re: Problems with import

2007-12-04 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I have some problems when importing a library. Suppose I have a > directory /home/user/pythonlib/package in which I have a python- > library called test.py. Now I want to import that, so I put the > following directory into the PYTHONPATH: /home/user/pythonlib a

Problems with import

2007-12-04 Thread alexLIGO
Hi, I have some problems when importing a library. Suppose I have a directory /home/user/pythonlib/package in which I have a python- library called test.py. Now I want to import that, so I put the following directory into the PYTHONPATH: /home/user/pythonlib and in my main python script I put: fr

Problems with import

2007-12-04 Thread Alexander Dietz
Hi, I have some problems when importing a library. Suppose I have a directory /home/user/pythonlib/package in which I have a python-library called test.py. Now I want to import that, so I put the following directory into the PYTHONPATH: /home/user/pythonlib and in my main python script I put: fro

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread Tóth Csaba
Dennis Lee Bieber írta: > Changing the name of the language, at this stage, means giving up > over ten years of history and rebuilding name recognition from > scratch... Along with having to rename Jython, IronPython, CherryPy, > probably Boa Constructor, the pysqlite DB adapter, numpy, scipy

Why use Slot? from Peter Norvig's AI code

2007-12-04 Thread Davy
Hi all, When reading Python source code of Peter Norvig's AI book, I found it hard for me to understand the idea of slot (function nested in function). Please see "program()" nested in "make_agent_program()", why not use program() directly? ## http://aima-python.googlecode.com/svn/trunk/agents.py

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread cokofreedom
On Dec 4, 11:36 am, MarkE <[EMAIL PROTECTED]> wrote: > Ithon Pie - Fun -- http://mail.python.org/mailman/listinfo/python-list

Re: os.access() under windows

2007-12-04 Thread Tim Golden
Martin v. Löwis wrote: > It would be possible to fix this specific case, by always > returning True for directories; and perhaps I'll do that for > 2.5.2. Martin. Could you confirm that the outline below correctly describes the behaviour of the os.access function under Windows, please? If you conf

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread MarkE
Ithon -- http://mail.python.org/mailman/listinfo/python-list

make money with bux!!

2007-12-04 Thread beronz
http://bux.to/?r=beronz use this link to register What is Bux.to? Bux.to is a new innovative, international and FREE English based service that allows advertisers to reach thousands of potential customers by displaying their ad on our, "Surf Ads" page. How does it work? You view websites in 30 s

Re: connect to server question

2007-12-04 Thread Martin v. Löwis
> Here's the code I presently use in a Bash Shell script: > > /bin/mkdir -p /Volumes/A_Share > /sbin/mount_afp "afp://username:[EMAIL PROTECTED]/A_Share" > "/Volumes/A_Share" > > Can something similar be done with Python? You can always use os.system to do what the shell does, ie. os.sy

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread Zara
On Sat, 1 Dec 2007 13:40:10 -0800 (PST), "Russ P." <[EMAIL PROTECTED]> wrote: >On Dec 1, 12:47 pm, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: >> On Sat, 2007-12-01 at 12:10 -0800, Russ P. wrote: >> > On Dec 1, 2:10 am, Bjoern Schliessmann > > [EMAIL PROTECTED]> wrote: >> > > Russ P. wrote: >> >

Re: Generating API documentation as a textfile

2007-12-04 Thread Laurent Pointal
MonkeeSage a écrit : > On Dec 3, 8:58 am, Samuel <[EMAIL PROTECTED]> wrote: >> On Mon, 03 Dec 2007 06:45:45 -0800, Giampaolo Rodola' wrote: >>> dir.__doc__ >> This contains only the docstring one object (module, class, >> function, ...). I was thinking more of the complete API documentation >> that

  1   2   >