Re: [Tutor] curl and python

2009-01-16 Thread Kent Johnson
On Fri, Jan 16, 2009 at 5:56 PM, Jeremiah Jester wrote: > I'm trying to get curl to traverse a remote http directory get all page > names and do some processing on these file with python. > > For starters, i need to get the directory listing in an array from the > domain. Any ideas on how to do th

Re: [Tutor] referring to subfolders

2009-01-16 Thread Che M
> Date: Fri, 16 Jan 2009 21:26:52 -0800 > From: st...@alchemy.com > To: pine...@hotmail.com > CC: tutor@python.org > Subject: Re: [Tutor] referring to subfolders > > Che M wrote: >> I have been using absolute paths in my programs, but >> want to get out o

Re: [Tutor] referring to subfolders

2009-01-16 Thread Steve Willoughby
Che M wrote: I have been using absolute paths in my programs, but want to get out of the habit as I try to run them on other computers. I was surprised to find that this type of reference didn't work: path = '/subfolder/myfile.py' Pathnames are relative by default. So: 'myfile.py' would b

[Tutor] referring to subfolders

2009-01-16 Thread Che M
I have been using absolute paths in my programs, but want to get out of the habit as I try to run them on other computers. I was surprised to find that this type of reference didn't work: path = '/subfolder/myfile.py' But instead I did it this way and it works: import os.path self.currentdir =

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Alan Gauld
"Smith, Jeff" wrote There was an add-on to the GNU C compiler for FORTRAN77 at one time (g77). I don't know if it is still available to how well it works though. Caveat: Fortran is one of the few mainstream languages that I have never read or written so I have no personal experience. But...

Re: [Tutor] [python(x, y)] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread Alan Gauld
"Vicent" wrote That "problem" has to contain, somehow, a property or element called "function" which, in fact, I would like it to be a function, or a "pointer" to a function. I won't repeat what others have said about passing function objects into an object and storing them as attributes.

[Tutor] curl and python

2009-01-16 Thread Jeremiah Jester
I'm trying to get curl to traverse a remote http directory get all page names and do some processing on these file with python. For starters, i need to get the directory listing in an array from the domain. Any ideas on how to do this? Thanks, JJ Disclaimer: The information contained in this

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Sander Sweers
On Fri, Jan 16, 2009 at 22:20, Wayne Watson wrote: > Will that do me any good if I implement my application under Win Python? Your question was for a fotran compiler to compile the source code. The fotran program is your reference point to compare the results to. Greets Sander __

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Wayne Watson
Title: Signature.html Will that do me any good if I implement my application under Win Python? Sander Sweers wrote: On Fri, Jan 16, 2009 at 21:06, Wayne Watson wrote: Anything under Win? Yes, minigw http://www.mingw.org/. Greets Sander -- Wayne Wat

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Sander Sweers
On Fri, Jan 16, 2009 at 21:06, Wayne Watson wrote: > Anything under Win? Yes, minigw http://www.mingw.org/. Greets Sander ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Wayne Watson
Title: Signature.html Anything under Win? Sander Sweers wrote: On Fri, Jan 16, 2009 at 20:02, Wayne Watson wrote: That is interesting. I'll pursue it. Thanks. Of course, at the moment, I have no F77 compiler, so I can't even execute or use the code. Is there a freebie F77 compile

Re: [Tutor] Simple program with menu to view videos

2009-01-16 Thread Kent Johnson
On Fri, Jan 16, 2009 at 11:35 AM, David wrote: > I am asking for some tips on how I can make > this program with less code and using some classes, if that is the best way > to proceed. I have a lot of code that is just copied from one function to > the next. When you are copy/pasting code, think

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Smith, Jeff
There was an add-on to the GNU C compiler for FORTRAN77 at one time (g77). I don't know if it is still available to how well it works though. Jeff From: tutor-bounces+jsmith=medplus@python.org [mailto:tutor-bounces+jsmith=medplus@python.org] On Behalf

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Sander Sweers
On Fri, Jan 16, 2009 at 20:02, Wayne Watson wrote: > That is interesting. I'll pursue it. Thanks. Of course, at the moment, I > have no F77 compiler, so I can't even execute or use the code. Is there a > freebie F77 compiler out there? GCC supportd it http://gcc.gnu.org/. Greets Sander _

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Wayne Watson
Title: Signature.html That is interesting. I'll pursue it. Thanks. Of course, at the moment, I have no F77 compiler, so I can't even execute or use the code. Is there a freebie F77 compiler out there? greg whittier wrote: There's an absolutely incredible project call f2py http://cens.ioc.ee

Re: [Tutor] @property?

2009-01-16 Thread Kent Johnson
On Fri, Jan 16, 2009 at 12:32 PM, spir wrote: > Hello, > > would someone point me to some clear doc about properties: purpose, use, > underlying model... Properties: http://personalpages.tds.net/~kent37/kk/8.html Decorators (the @ syntax): http://personalpages.tds.net/~kent37/kk/1.html

Re: [Tutor] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread wesley chun
> All Python values are references, so you are essentially storing a > pointer to the function object within the problem. Python assignment > does not copy. This is a fundamental concept of Python that often > confuses newbies, it is worth taking some time to understand it > correctly. My explanati

Re: [Tutor] Simple program with menu to view videos

2009-01-16 Thread spir
Le Fri, 16 Jan 2009 11:35:13 -0500, David a écrit : > Hi, > I just received the dvd Python Fundamentals by Wesley J. Chun and it was > packaged by the distributor for use on Window and Mac but I use Linux so > I pulled the videos of of the dvd. There are 10 lessons with a total of > 58 individ

Re: [Tutor] @property?

2009-01-16 Thread Steve Willoughby
On Fri, Jan 16, 2009 at 06:32:19PM +0100, spir wrote: > Hello, > > would someone point me to some clear doc about properties: purpose, use, > underlying model... > [Could not find myself, probably because the word "property itself has far > too wide meaning.] I'm a little confused here because

Re: [Tutor] Creating simple windows in XP

2009-01-16 Thread W W
On Thu, Jan 15, 2009 at 5:45 PM, Alan Gauld wrote: > You mean like doing > > import tkMessageBox > tkMessageBox.showinfo("Window Text", "A short message") > > in Tkinter? :-) > > OR > > res = tkMessageBox.askokcancel("Which?", "Ready to stop?") > print res > > At that level Tkinter is pretty easy

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread greg whittier
There's an absolutely incredible project call f2py http://cens.ioc.ee/projects/f2py2e/ that I've used before. It doesn't translate the code, but wraps it (which is actually better) and lets you import your library as a module. It even generates docstrings so you can see how to call the functions.

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Chris Fuller
On Friday 16 January 2009 10:40, Wayne Watson wrote: > I may have a need down the line to convert a large number of lines of > FORTRAN code to Python. Is there a good translator available to do this? In > the past, I've found some for translating Pascal to C, and possibly others. There is a Fotra

[Tutor] @property?

2009-01-16 Thread spir
Hello, would someone point me to some clear doc about properties: purpose, use, underlying model... [Could not find myself, probably because the word "property itself has far too wide meaning.] Thank you. denis -- la vida e estranya ___ Tutor mai

[Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread Wayne Watson
Title: Signature.html I may have a need down the line to convert a large number of lines of FORTRAN code to Python. Is there a good translator available to do this? In the past, I've found some for translating Pascal to C, and possibly others. -- Wayne Watson (Watson Adventures,

[Tutor] Simple program with menu to view videos

2009-01-16 Thread David
Hi, I just received the dvd Python Fundamentals by Wesley J. Chun and it was packaged by the distributor for use on Window and Mac but I use Linux so I pulled the videos of of the dvd. There are 10 lessons with a total of 58 individual videos. Most lessons are 6-8 videos long. So I did as Alan

Re: [Tutor] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread Vicent
On Fri, Jan 16, 2009 at 14:56, greg whittier wrote: > > In python, the name of a function is just a pointer to it. Try this > > >>> def foo(): >print "Hi!" > > > >>> class Problem: >def __init__(self,fun): >self.fun = fun > > > >>> p1 = Problem(foo) > >>> p2 = Pro

Re: [Tutor] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread greg whittier
On Fri, Jan 16, 2009 at 7:51 AM, Vicent wrote: > > That "problem" has to contain, somehow, a property or element called > "function" which, in fact, I would like it to be a function, or a "pointer" > to a function. In python, the name of a function is just a pointer to it. Try this >>> def fo

Re: [Tutor] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread Kent Johnson
On Fri, Jan 16, 2009 at 7:51 AM, Vicent wrote: > I want to define an object or data structure called "Problem". > > That "problem" has to contain, somehow, a property or element called > "function" which, in fact, I would like it to be a function, or a "pointer" > to a function. > > For example, i

Re: [Tutor] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread Andre Engels
On Fri, Jan 16, 2009 at 1:51 PM, Vicent wrote: > I am posting this question to two Python forums: Tutor and Python(x,y). > > In the case of Tutor [1], I think it's the right place to ask questions for > a newbie like me. > > In the case of Python(x,y) Discussion Group [2], I am posting also becaus

[Tutor] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread Vicent
I am posting this question to two Python forums: Tutor and Python(x,y). In the case of Tutor [1], I think it's the right place to ask questions for a newbie like me. In the case of Python(x,y) Discussion Group [2], I am posting also because I think I am addressing a specific group of Python users

Re: [Tutor] 2 & 4 or more spaces per indentation level..

2009-01-16 Thread spir
Le Fri, 16 Jan 2009 09:11:06 +0530, Senthil Kumaran a écrit : > > >they used a different spacing than you, is there a simple/good/smart > >way to get it all back to the 4 spacing default? Or if for example I > > Rule #0 is Never mix tabs and spaces. > Rule #1 is use a standard spacing

Re: [Tutor] 2 & 4 or more spaces per indentation level..

2009-01-16 Thread Alan Gauld
"Eric Dorsey" wrote Working in IDLE on Windows Vista, I have one program that I set to have 2 character spacing (due to the levels of if's and while's going on -- later my brother called this a bit of a code smell, ie. logic shouldn't go that deep, it should be broken out into separate funct