Re: Generarl programming question.

2015-04-11 Thread Steven D'Aprano
Thomas, before I reply to your comment, I have a meta-comment to make. Your signature says "Please do not cc me. / Bitte keine Kopien per E-Mail." which suggests that you do not want to be emailed. But your post included an explicit "Mail-Copies-To: use...@pointedears.de" header which compliant ne

Re: Generarl programming question.

2015-04-11 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 4/11/2015 3:19 PM, Thomas 'PointedEars' Lahn wrote: >> Terry Reedy wrote: >>> What Chris is describing is one local namespace (sheet of paper) per >>> function *call*. >> I *know* what he is describing: the *call* stack. > > My comment above was directed not at you specifi

Re: Generarl programming question.

2015-04-11 Thread Terry Reedy
On 4/11/2015 3:19 PM, Thomas 'PointedEars' Lahn wrote: Terry Reedy wrote: On 4/11/2015 12:23 PM, Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: The 'x' inside each function is completely separate, no matter how many times they get called. They're usually stored on something called a "

Re: Generarl programming question.

2015-04-11 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 4/11/2015 12:23 PM, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >>> The 'x' inside each function is completely separate, no matter how >>> many times they get called. They're usually stored on something called >>> a "call stack" - you put another sheet of pape

Re: Generarl programming question.

2015-04-11 Thread Terry Reedy
On 4/11/2015 12:23 PM, Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: The 'x' inside each function is completely separate, no matter how many times they get called. They're usually stored on something called a "call stack" - you put another sheet of paper on top of the stack every time

Re: Generarl programming question.

2015-04-11 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > The 'x' inside each function is completely separate, no matter how > many times they get called. They're usually stored on something called > a "call stack" - you put another sheet of paper on top of the stack > every time you call a function, local variables are all writte

Re: Generarl programming question.

2015-04-11 Thread jonas . thornvall
Den lördag 11 april 2015 kl. 17:26:03 UTC+2 skrev Steven D'Aprano: > On Sun, 12 Apr 2015 01:00 am, jonas.thornv...@gmail.com wrote: > > > If two functions crossreference eachother back and forth what happen with > > the local variables. > > Nothing. They are local to the function that creates the

Re: Generarl programming question.

2015-04-11 Thread Steven D'Aprano
On Sun, 12 Apr 2015 01:00 am, jonas.thornv...@gmail.com wrote: > If two functions crossreference eachother back and forth what happen with > the local variables. Nothing. They are local to the function that creates them. > Will there be a new instance of function holding the variables or do the

Re: Generarl programming question.

2015-04-11 Thread Chris Angelico
On Sun, Apr 12, 2015 at 1:22 AM, wrote: > Thanks i was worried, i try to make a generic base choice algorithm that > should work for anybase, and i just realised that the bignumb add would need > to call the bignumb subtraction and viceversa. I thought there may be > instances but i was not su

Re: Generarl programming question.

2015-04-11 Thread jonas . thornvall
Den lördag 11 april 2015 kl. 17:16:09 UTC+2 skrev Chris Angelico: > On Sun, Apr 12, 2015 at 1:00 AM, wrote: > > If two functions crossreference eachother back and forth what happen with > > the local variables. > > > > Will there be a new instance of function holding the variables or do they >

Re: Generarl programming question.

2015-04-11 Thread Chris Angelico
On Sun, Apr 12, 2015 at 1:00 AM, wrote: > If two functions crossreference eachother back and forth what happen with the > local variables. > > Will there be a new instance of function holding the variables or do they get > messed up? You mean if one function calls another, and that function ca

Generarl programming question.

2015-04-11 Thread jonas . thornvall
If two functions crossreference eachother back and forth what happen with the local variables. Will there be a new instance of function holding the variables or do they get messed up? -- https://mail.python.org/mailman/listinfo/python-list

Re: Newby Python Programming Question

2012-05-15 Thread Jean-Michel Pichavant
Coyote wrote: CM writes: I don't know Spyder IDE, but I don't think this should happen; could there just be a simple mistake? Because you first refer to the .py file as 'file_utils.py' but then you refer to the file as 'pwd.py'...which is also the name of your function. Room for confusion..

Re: Newby Python Programming Question

2012-05-14 Thread Simon Cropper
On 15/05/12 12:18, Chris Angelico wrote: On Sat, May 12, 2012 at 8:25 AM, Coyote wrote: I've been playing around with a couple of IDEs because I liked the one I used with IDL and I wanted to use something similar for Python. The IDLDE was an Eclipse variant, but I've tried installing Eclipse

Re: Newby Python Programming Question

2012-05-14 Thread Chris Angelico
On Sat, May 12, 2012 at 8:25 AM, Coyote wrote: > I've been playing around with a couple of IDEs because I liked the one I used > with IDL and I wanted to use something similar for Python. The IDLDE was an > Eclipse variant, but I've tried installing Eclipse before for something else > and I'm p

Re: Newby Python Programming Question

2012-05-14 Thread Coyote
CM writes: > I don't know Spyder IDE, but I don't think this should happen; could > there just be a simple mistake? Because you first refer to the .py > file as 'file_utils.py' but then you refer to the file as > 'pwd.py'...which is also the name of your function. Room for > confusion...so could

Re: Newby Python Programming Question

2012-05-14 Thread CM
On May 11, 11:25 am, Coyote wrote: > Folks, > > I am migrating to Python after a 20+ year career writing IDL programs > exclusively. I have a really simple question that I can't find the answer to > in any of the books and tutorials I have been reading to get up to speed. > > I have two programs

Re: Newby Python Programming Question

2012-05-14 Thread Coyote
Maarten writes: > I do recommend you read http://docs.python.org/howto/doanddont.html as a > starting point to avoid learning some bad habits, especially on importing. > You probably already found > https://www.cfa.harvard.edu/~jbattat/computer/python/science/idl-numpy.html Yikes! I'm sure tha

Re: Newby Python Programming Question

2012-05-14 Thread Maarten
On Friday, May 11, 2012 5:25:20 PM UTC+2, Coyote wrote: > I am migrating to Python after a 20+ year career writing IDL programs > exclusively. I have a really simple question that I can't find the answer to > in any of the books and tutorials I have been reading to get up to speed. Welcome here

Newby Python Programming Question

2012-05-14 Thread Coyote
Folks, I am migrating to Python after a 20+ year career writing IDL programs exclusively. I have a really simple question that I can't find the answer to in any of the books and tutorials I have been reading to get up to speed. I have two programs. The first is in a file I named file_utils.py:

Re: One more socket programming question

2008-06-18 Thread John Salerno
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Salerno <[EMAIL PROTECTED]> wrote: >> >>I'm now experimenting with the SocketServer class. Originally I >>subclassed the StreamRequestHandler to make my own custom handler, but a >>result of this seems to be that the

Re: One more socket programming question

2008-06-18 Thread Tim Roberts
John Salerno <[EMAIL PROTECTED]> wrote: > >I'm now experimenting with the SocketServer class. Originally I >subclassed the StreamRequestHandler to make my own custom handler, but a >result of this seems to be that the client socket closes after it has >been used, instead of staying open. Right.

One more socket programming question

2008-06-17 Thread John Salerno
I'm now experimenting with the SocketServer class. Originally I subclassed the StreamRequestHandler to make my own custom handler, but a result of this seems to be that the client socket closes after it has been used, instead of staying open. Just as a test, I decided to use BaseRequestHandler

Re: Programming question

2008-06-11 Thread Terry Reedy
"Brad Navarro" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Basically, what I am trying to do is get a list of each file's attributes within a directory. Basically, the information that the 'ls -l' command would give you in a linux shell, except the results for each file in the dir

Re: Programming question

2008-06-11 Thread Python Nutter
2008/6/12 Brad Navarro <[EMAIL PROTECTED]>: > Basically, what I am trying to do is get a list of each file's attributes > within a directory. Basically, the information that the 'ls –l' command Python For System Administrators: http://www.ibm.com/developerworks/aix/library/au-python/ handy to a

Re: Programming question

2008-06-11 Thread Jeff McNeil
Have a look at os.listdir and os.stat. I've never worked with 1.5, so I don't know what will work with it and what won't,. but I'd imagine the following ought to be fine, though. stat_list = [] for dirent in os.listdir('your_directory'): stat_list.append(os.stat(dirent)) Jeff On Wed, Jun

Programming question

2008-06-11 Thread Brad Navarro
Greetings, Being extremely new to Python, I haven't got the experience to figure this one out on my own and frankly I am not sure I would know where to look. Basically, what I am trying to do is get a list of each file's attributes within a directory. Basically, the information that the 'l

Re: Pyqt programming question

2007-04-12 Thread Marcpp
On 12 abr, 12:34, Phil Thompson <[EMAIL PROTECTED]> wrote: > On Thursday 12 April 2007 11:07 am, Marcpp wrote: > > > On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > > > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > > I have a program (python + pyqt), with a button I'll would

Re: Pyqt programming question

2007-04-12 Thread Marcpp
On 12 abr, 12:07, "Marcpp" <[EMAIL PROTECTED]> wrote: > On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > > > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > > I have a program (python + pyqt), with a button I'll would to open a > > > new dialog window to input text, when press s

Re: Pyqt programming question

2007-04-12 Thread Phil Thompson
On Thursday 12 April 2007 11:07 am, Marcpp wrote: > On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > I have a program (python + pyqt), with a button I'll would to open a > > > new dialog window to input text, when press save or o

Re: Pyqt programming question

2007-04-12 Thread Marcpp
On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > I have a program (python + pyqt), with a button I'll would to open a > > new dialog window to input text, when press save or ok, this text is > > returned to the principal program. >

Re: Pyqt programming question

2007-04-12 Thread Phil Thompson
On Thursday 12 April 2007 10:23 am, Marcpp wrote: > I have a program (python + pyqt), with a button I'll would to open a > new dialog window to input text, when press save or ok, this text is > returned to the principal program. > I've seek in internet but i don't find anything. Use QInputDialog.g

Pyqt programming question

2007-04-12 Thread Marcpp
I have a program (python + pyqt), with a button I'll would to open a new dialog window to input text, when press save or ok, this text is returned to the principal program. I've seek in internet but i don't find anything. -- http://mail.python.org/mailman/listinfo/python-list

Re: socket programming question

2006-06-20 Thread Grant Edwards
On 2006-06-20, Kiran <[EMAIL PROTECTED]> wrote: > is it possible to make python do some other processing while > it is waiting for a socket to timeout? Yes. You can either use threads or select. Or you can use one of the async server frameworks like twisted. -- Grant Edwards

Re: socket programming question

2006-06-20 Thread Irmen de Jong
Kiran wrote: > Hello All, > My question is, is it possible to make python do some other > processing while it is waiting for a socket to timeout? sure, you have to use threads and/or use asynchronous socket programming. Google is your friend. --Irmen -- http://mail.python.org/mailman/listinfo

socket programming question

2006-06-20 Thread Kiran
Hello All, My question is, is it possible to make python do some other processing while it is waiting for a socket to timeout? thanks a lot! Kiran -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Programming - Question

2006-02-10 Thread Grant Edwards
On 2006-02-11, D <[EMAIL PROTECTED]> wrote: > I've used os.popen() before, but if I execute it on a remote > system how could I get the output back to the requesting > machine? Write it to the socket? -- Grant Edwards grante Yow! Where does it go when

Re: Socket Programming - Question

2006-02-10 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I am relatively new to Python, and wanted to see if this is even > possible, and if so how to go about implementing it. What I'm looking > to do is create a client/server application that does the following: > > 1) System2 listens on port > 1023

Re: Socket Programming - Question

2006-02-10 Thread D
I've used os.popen() before, but if I execute it on a remote system how could I get the output back to the requesting machine? -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Programming - Question

2006-02-10 Thread D
Thanks! Now, I'm a bit confused as to exactly how it works - will it display the output of what it executes on the target system? I would like to create a window in Tktinker to where a user can select options (such as run scan on remote system) - it would then run the command-line based scan and

Re: Socket Programming - Question

2006-02-10 Thread Grant Edwards
On 2006-02-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am relatively new to Python, and wanted to see if this is > even possible, and if so how to go about implementing it. > What I'm looking to do is create a client/server application > that does the following: > > 1) System2 listens on

Re: Socket Programming - Question

2006-02-10 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > An example of what I am looking to use this for is for remote virus > scanning. So System2 listens, System1 connects and sends it the Just found this through OSNews: http://rpyc.sourceforge.net/ It actually seems to be a perfect fit for your job. Lorenzo -- http://

Socket Programming - Question

2006-02-10 Thread [EMAIL PROTECTED]
I am relatively new to Python, and wanted to see if this is even possible, and if so how to go about implementing it. What I'm looking to do is create a client/server application that does the following: 1) System2 listens on port > 1023 2) System1 connects to System2 and sends traffic to it -

Re: object oriented programming question

2005-12-19 Thread Daniel Nogradi
Hi Michael, one more thing. As you could see my only goal was to be able to say 1  inst = x() 2 3  inst.a("some string") 4  inst.a.func() 5 6  inst.b("some other string") 7  inst.b.func() and (3) should modify 'inst.content' in some way depending on "some string" and the attribute 'a' while (4)

Re: object oriented programming question

2005-12-18 Thread Daniel Nogradi
Hello Daniel You've certainly got a lot going on here.The heart of your question seems to be how a nested (inner) class _a can access its parent, x.  The short answer is that, in Python, it can't without some help.  _a and its instances are unaware of the context in which they are defined, sothey h

Re: object oriented programming question

2005-12-17 Thread Michael Spencer
Daniel Nogradi wrote: > I have class 'x' with member 'content' and another member 'a' which is an > instance of class '_a'. The class '_a' is callable and has a method 'func' > which I would like to use to modify 'content' but I don't know how to > address 'content' from the class '_a'. Is it pos

object oriented programming question

2005-12-17 Thread Daniel Nogradi
I have class 'x' with member 'content' and another member  'a'  which is an instance of class '_a'. The class '_a' is callable and has a method 'func' which I would like to use to modify 'content' but I don't know how to address 'content' from the class '_a'. Is it possible? Here is the code that

Re: Yet Another Python Web Programming Question

2005-07-12 Thread Thomas Bartkus
"Daniel Bickett" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It was his opinion that > web programming should feel no different from desktop programming. Should that ever become even remotely possible - I'll be interested in web programming myself. Thomas Bartkus --

RE: Yet Another Python Web Programming Question

2005-07-12 Thread Sells, Fred
FWIW there's "dos2unix" program that fixes this on most systems. -Original Message- From: Bill Mill [mailto:[EMAIL PROTECTED] Sent: Monday, July 11, 2005 11:55 AM To: Daniel Bickett Cc: python-list@python.org Subject: Re: Yet Another Python Web Programming Question >

Re: Yet Another Python Web Programming Question

2005-07-11 Thread Bill Mill
> Python using CGI, for example, was enough for him until he started > getting 500 errors that he wasn't sure how to fix. A common error is that python cgi files need line endings to be in unix text file format, not windows text file format (\n instead of \r\n) [1]. Why this is, I don't know, but

Re: Yet Another Python Web Programming Question

2005-07-10 Thread Sybren Stuvel
Daniel Bickett enlightened us with: > It would be a long while before he would find Python, and since that > time he would have no desire to ever touch PHP again. My thoughts exactly. > He would, however, be compelled to write a web application again, > but in Python now, of course. Same here :)

RE: Yet Another Python Web Programming Question

2005-07-10 Thread Robert Brewer
Paul Boddie wrote: > "Robert Brewer" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > > Daniel Bickett wrote: > > > I neglected to mention an important fact, and that is the > > > fact that I am limited to Apache, which elminates several > > > suggestions (that are appreciated

Re: Yet Another Python Web Programming Question

2005-07-10 Thread Paul Boddie
"Robert Brewer" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Daniel Bickett wrote: > > I neglected to mention an important fact, and that is the fact that I > > am limited to Apache, which elminates several suggestions (that are > > appreciated none-the-less). > > Do you have

Re: Yet Another Python Web Programming Question

2005-07-10 Thread Jorey Bump
Daniel Bickett <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I neglected to mention an important fact, and that is the fact that I > am limited to Apache, which elminates several suggestions (that are > appreciated none-the-less). "Limited to Apache" is not the same as "using apache in

RE: Yet Another Python Web Programming Question

2005-07-09 Thread Robert Brewer
Daniel Bickett wrote: > I neglected to mention an important fact, and that is the fact that I > am limited to Apache, which elminates several suggestions (that are > appreciated none-the-less). Do you have access to mod_python, mod_rewrite, FastCGI, or SCGI? Then CherryPy 2.1 is still a great opti

Re: Yet Another Python Web Programming Question

2005-07-09 Thread Daniel Bickett
I neglected to mention an important fact, and that is the fact that I am limited to Apache, which elminates several suggestions (that are appreciated none-the-less). -- Daniel Bickett dbickett at gmail.com http://heureusement.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet Another Python Web Programming Question

2005-07-09 Thread and-google
Daniel Bickett wrote: > Python using CGI, for example, was enough for him until he started > getting 500 errors that he wasn't sure how to fix. Every time you mention web applications on this list, there will necessarily be a flood of My Favourite Framework Is X posts. But you* sound like you do

Re: Yet Another Python Web Programming Question

2005-07-09 Thread Luis M. Gonzalez
Try Karrigell ( http://karrigell.sourceforge.net ). And let me know what you think... Cheers, Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet Another Python Web Programming Question

2005-07-09 Thread Jonathan Ellis
Daniel Bickett wrote: > He would read the documentation of Nevow, Zope, and Quixote, and would > find none of them to his liking because: > > * They had a learning curve, and he was not at all interested, being > eager to fulfill his new idea for the web app. It was his opinion that > web programmi

Re: Yet Another Python Web Programming Question

2005-07-09 Thread Dave Brueck
Daniel Bickett wrote: > He would read the documentation of Nevow, Zope, and Quixote, and would > find none of them to his liking because: > > * They had a learning curve, and he was not at all interested, being > eager to fulfill his new idea for the web app. It was his opinion that > web programm

Re: Yet Another Python Web Programming Question

2005-07-09 Thread Devan L
Take some time to learn one of the web frameworks. If your host doesn't already have it, ask your host if they would consider adding it. -- http://mail.python.org/mailman/listinfo/python-list

Yet Another Python Web Programming Question

2005-07-09 Thread Daniel Bickett
This post started as an incredibly long winded essay, but halfway through I decided that was a terribly bad idea, so I've trimmed it down dramatically, and put it in the third person (for humor's sake). Once upon a time a boy named Hypothetical programmed in PHP and made many a web application. I

Re: New to programming question

2005-04-01 Thread Joal Heagney
Joal Heagney wrote: Steve Holden wrote: I suppose this would be far too easy to understand, then: pr =['Guess my name', 'Wrong, try again', 'Last chance'] for p in pr: name = raw_input(p+": ") if name == "Ben": print "You're right!" break else: print "Loser: no more tries for you" reg

Re: New to programming question

2005-04-01 Thread Joal Heagney
Steve Holden wrote: Joal Heagney wrote: Bengt Richter wrote: On Fri, 01 Apr 2005 07:46:41 GMT, Joal Heagney <[EMAIL PROTECTED]> wrote: Oh goddammmni. I seem to be doing this a lot today. Look below for the extra addition to the code I posted. Joal Heagney wrote: Here's my contribution anyc

Re: New to programming question

2005-04-01 Thread Ben
Joal was right. It is a bit beyond me. But I appreciate your response. -- http://mail.python.org/mailman/listinfo/python-list

Re: New to programming question

2005-04-01 Thread Ben
Thanks for your reply. -- http://mail.python.org/mailman/listinfo/python-list

Re: New to programming question

2005-04-01 Thread Ben
Thanks for your input. -- http://mail.python.org/mailman/listinfo/python-list

Re: New to programming question

2005-04-01 Thread Ben
Thanks for your help. It is much appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Re: New to programming question

2005-04-01 Thread Steve Holden
Joal Heagney wrote: Bengt Richter wrote: On Fri, 01 Apr 2005 07:46:41 GMT, Joal Heagney <[EMAIL PROTECTED]> wrote: Oh goddammmni. I seem to be doing this a lot today. Look below for the extra addition to the code I posted. Joal Heagney wrote: Here's my contribution anycase: count = 0 # Get

Re: New to programming question

2005-04-01 Thread Joal Heagney
Bengt Richter wrote: On Fri, 01 Apr 2005 07:46:41 GMT, Joal Heagney <[EMAIL PROTECTED]> wrote: Oh goddammmni. I seem to be doing this a lot today. Look below for the extra addition to the code I posted. Joal Heagney wrote: Here's my contribution anycase: count = 0 # Get first input name = ra

Re: New to programming question

2005-04-01 Thread Bengt Richter
On Fri, 01 Apr 2005 07:46:41 GMT, Joal Heagney <[EMAIL PROTECTED]> wrote: >Oh goddammmni. I seem to be doing this a lot today. Look below for >the extra addition to the code I posted. > >Joal Heagney wrote: >> >> Here's my contribution anycase: >> >> count = 0 >> # Get first input >> name =

Re: New to programming question

2005-03-31 Thread Joal Heagney
Oh goddammmni. I seem to be doing this a lot today. Look below for the extra addition to the code I posted. Joal Heagney wrote: Here's my contribution anycase: count = 0 # Get first input name = raw_input("Guess my name: ") # Give the sucker two extra goes while count < 2: # Check the val

Re: New to programming question

2005-03-31 Thread Joal Heagney
Ben wrote: This is an exercise from the Non-programmers tutorial for Python by Josh Cogliati. The exercise is: Write a program that has a user guess your name, but they only get 3 chances to do so until the program quits. Here is my script: -- count = 0 name = raw_input("Gue

Re: New to programming question

2005-03-31 Thread Ron_Adam
On 31 Mar 2005 20:03:00 -0800, "Ben" <[EMAIL PROTECTED]> wrote: >Could someone tell me what is wrong and give me a better alternative to >what I came up with. Seperate you raw input statements from your test. Your elsif is skipping over it. Try using only one raw imput statement right after y

Re: New to programming question

2005-03-31 Thread Michael Spencer
Ben wrote: This is an exercise from the Non-programmers tutorial for Python by Josh Cogliati. The exercise is: Write a program that has a user guess your name, but they only get 3 chances to do so until the program quits. Here is my script: -- count = 0 name = raw_input("Gue

New to programming question

2005-03-31 Thread Ben
This is an exercise from the Non-programmers tutorial for Python by Josh Cogliati. The exercise is: Write a program that has a user guess your name, but they only get 3 chances to do so until the program quits. Here is my script: -- count = 0 name = raw_input("Guess my