Re: [Tutor] IDLE shortcut doesn't exist except for in the Start Menu

2009-05-26 Thread Kent Johnson
On Tue, May 26, 2009 at 2:30 PM, Gregory Morton wrote: > Looking in the directory for Python, I see no real sign of IDLE anywhere in > it. The reason for why I want it visible is because I plan on storing Python > (this is 3.0.1 by the way) in my USB thumbdrive so I can use and transfer it > on ot

Re: [Tutor] IDLE shortcut doesn't exist except for in the Start Menu

2009-05-26 Thread Dave Angel
Gregory Morton wrote: Looking in the directory for Python, I see no real sign of IDLE anywhere in it. The reason for why I want it visible is because I plan on storing Python (this is 3.0.1 by the way) in my USB thumbdrive so I can use and transfer it on other computers. Is there any logic b

Re: [Tutor] IDLE shortcut doesn't exist except for in the Start Menu

2009-05-26 Thread Alan Gauld
"Gregory Morton" wrote Looking in the directory for Python, I see no real sign of IDLE anywhere in it. Look at the properties of the start menu item. It should show the shortcut points to something like: C:\Python25\Lib\idlelib\idle.pyw Is there any logic behind why I can't access IDLE wi

Re: [Tutor] CVS File Opening

2009-05-26 Thread Sander Sweers
2009/5/26 Paras K. : > Hello, > > I have been working on this script / program all weekend. I emailed this > address before and got some great help. I hope that I can get that again! > > > First to explain what I need to do: > > Have about 6 CSV files that I need to read. Then I need to split based

[Tutor] IDLE shortcut doesn't exist except for in the Start Menu

2009-05-26 Thread Gregory Morton
Looking in the directory for Python, I see no real sign of IDLE anywhere in it. The reason for why I want it visible is because I plan on storing Python (this is 3.0.1 by the way) in my USB thumbdrive so I can use and transfer it on other computers. Is there any logic behind why I can't access

[Tutor] CVS File Opening

2009-05-26 Thread Paras K.
Hello, I have been working on this script / program all weekend. I emailed this address before and got some great help. I hope that I can get that again! First to explain what I need to do: Have about 6 CSV files that I need to read. Then I need to split based on a range of IP address and if th

Re: [Tutor] writing HTML code to a variable/file

2009-05-26 Thread spir
Le Tue, 26 May 2009 15:57:10 +0100, Dayo Adewunmi s'exprima ainsi: > Hi, > > I'm extracting data from OpenLDAP, which needs to be formatted into > hyperlinks. So far, I can print the generated HTML code: > > print "http://users.example.com/~"; + userName + ">" + lastName > + ", " + firstName

Re: [Tutor] writing HTML code to a variable/file

2009-05-26 Thread Alan Gauld
"Dayo Adewunmi" wrote subsequently written to the file. How do I save this http://users.example.com/~"; + userName + ">" + lastName + ", " + firstName + " to a variable, then? aVar = 'http://users.example.com/~' + userName + ">" + lastName + ", " + firstName + "" But IMHO its much e

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Alan Gauld
"nikhil" wrote Are objects for arguments, that persist between function calls, created during function definition ONLY when they have default values ? In Python the parameters are not objects but names. names are used to reference objects. If there is no default value then there is no objec

Re: [Tutor] Python Function Doubt

2009-05-26 Thread spir
Le Tue, 26 May 2009 19:42:34 +0530, nikhil s'exprima ainsi: > Hi, > > Thanks for reply. > > I went through the link you provided. It was very helpful. > > What I understood is this, > > --> Objects are created for default argument types, inside the function > object. ... for default argument

[Tutor] writing HTML code to a variable/file

2009-05-26 Thread Dayo Adewunmi
Hi, I'm extracting data from OpenLDAP, which needs to be formatted into hyperlinks. So far, I can print the generated HTML code: print "http://users.example.com/~"; + userName + ">" + lastName + ", " + firstName + "" However I want to write each line to a file first, so that I can alphabet

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Dave Angel
nikhil wrote: Hi, I am learning Python and came across this example in the Python Online Tutorial ( http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3)

Re: [Tutor] Python Function Doubt

2009-05-26 Thread nikhil
Hi, Thanks for reply. I went through the link you provided. It was very helpful. What I understood is this, --> Objects are created for default argument types, inside the function object. This happens only once when the function definition statement is executed. These objects persist

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Christian Witts
nikhil wrote: Hi, I am learning Python and came across this example in the Python Online Tutorial (http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3)

[Tutor] Python Function Doubt

2009-05-26 Thread nikhil
Hi, I am learning Python and came across this example in the Python Online Tutorial ( http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3) *O/P* [1] [1,2] [

Re: [Tutor] Tinkering with Tkinter

2009-05-26 Thread Doug Reid
--- On Tue, 5/26/09, W W wrote: From: W W Subject: Re: [Tutor] Tinkering with Tkinter To: "Doug Reid" Cc: Tutor@python.org Date: Tuesday, May 26, 2009, 11:42 AM On Mon, May 25, 2009 at 7:45 PM, Doug Reid wrote: The following code and it's explanation doesn't seem to work:   1. >>> f

Re: [Tutor] Tinkering with Tkinter

2009-05-26 Thread W W
On Mon, May 25, 2009 at 7:45 PM, Doug Reid wrote: > The following code and it's explanation doesn't seem to work: > > > 1. >>> from Tkinter import * > > 2. >>> tk = Tk() > > 3. >>> btn = Button(tk, text="click me") > > 4. >>> btn.pack() > > > > In line 1, we import the contents of the > Tk modul

Re: [Tutor] A few very basic questions

2009-05-26 Thread M Tramp
Alan Gauld btinternet.com> writes: > I'd be surprised if its a problem with Eclipse, but that's easy > to prove. Just run the code outside Eclipse from the > Terminal app. If you get the same error then it cannot be > Eclipse at fault. Same error from terminal. > Can you post the actual err

Re: [Tutor] import aliases ?

2009-05-26 Thread Kent Johnson
On Tue, May 26, 2009 at 4:11 AM, spir wrote: > Hello, > > In the case of such a dir structure: > > /pack >   __init__.py >   (modules) >   /pack1 >      __init__.py >      modules > > are the following imports synonyms: > 1-   import pack.pack1 > 2-   from pack import pack1 > ? > > If yes, is ther

Re: [Tutor] Can't print a string, gives me syntax error

2009-05-26 Thread Jeremiah Dodds
On Mon, May 25, 2009 at 6:46 PM, phpfood wrote: > I ran this in IDLE: > >>> t = 'hi' > >>> print t > SyntaxError: invalid syntax (, line 1) > > I've also tried this as sample.py : > import string > text = 'hello world' > print text > > > It gives me a syntax error on "print text" line > > What's

Re: [Tutor] Find a good linux distribution with python.

2009-05-26 Thread Norman Khine
Gentoo is python centric, although python3 is not yet in the main portage tree, but can be setup using an overlay http://overlays.gentoo.org/proj/python/ On Tue, May 26, 2009 at 6:36 AM, Dave Crouse wrote: > It's not a newbie distro by any means, but i am very fond of Arch Linux. > It has 3 versi

[Tutor] import aliases ?

2009-05-26 Thread spir
Hello, In the case of such a dir structure: /pack __init__.py (modules) /pack1 __init__.py modules are the following imports synonyms: 1- import pack.pack1 2- from pack import pack1 ? If yes, is there a reason for this? Also, there is something I find weird: * Using i

Re: [Tutor] Tinkering with Tkinter

2009-05-26 Thread Alan Gauld
"Doug Reid" wrote The following code and it's explanation doesn't seem to work: 1. >>> from Tkinter import * 2. >>> tk = Tk() 3. >>> btn = Button(tk, text="click me") 4. >>> btn.pack() In line 1, . Nothing appears on the screen after I enter line 2... A lot depends on the environment

Re: [Tutor] A few very basic questions

2009-05-26 Thread Alan Gauld
"M Tramp" wrote You need both pygtk and gtk. The former uses the latter. Yes. It is. I went back and installed more. Still I get the error: "No module named gtk" So I'm back to -- or nearly so -- my original question. Where on my hard drive should these libraries reside? I'm suspect