Re: [Tutor] Explain to me Initializing

2011-01-15 Thread Alan Gauld
"walter weston" wrote in message news:blu151-w4251d1fb9896dc3f8266c5d8...@phx.gbl... Please explain to me what initializing is,like when you _init_ a function or class . what is _init_ and what does it really do ? First you don;t init a function, you can init an object. Initializing means se

Re: [Tutor] TKinter help

2011-01-15 Thread Alan Gauld
"walter weston" wrote I am just starting to learn Tkinter and I was wondering if I should just run tkinter in pythons new window and run the program. You don;t run Tkinter, it is just a set of modules like any other. So you run Python as normal, whether from ODLE or from the command line. O

Re: [Tutor] Explain to me Initializing

2011-01-15 Thread Steven D'Aprano
walter weston wrote: Please explain to me what initializing is,like when you _init_ a function or class . what is _init_ and what does it really do ? do you need it? Do you know how it is when you get in a car, and turn the key in the ignition, and change into gear, and only then the car is

Re: [Tutor] Explain to me Initializing

2011-01-15 Thread Noah Hall
Based on the number of emails you're sending to the mailing list, I suggest you read a tutorial, work your way through it, and return with any further issues you come across. http://docs.python.org/tutorial/ is a good start, and I recommend any of the tutorials on http://wiki.python.org/moin/Begin

Re: [Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread Corey Richardson
On 01/15/2011 06:30 PM, Corey Richardson wrote: > On 01/15/2011 05:45 PM, walter weston wrote: >> I thought creating a Python help hotline would help programmers >> exponential! I think they should make a help hotline for every >> programming language. and since I havent discovered something simila

Re: [Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread Corey Richardson
On 01/15/2011 05:45 PM, walter weston wrote: > I thought creating a Python help hotline would help programmers > exponential! I think they should make a help hotline for every > programming language. and since I havent discovered something similar It > would probably be lucretive! > irc.freenode.

Re: [Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread Emile van Sebille
On 1/15/2011 2:45 PM walter weston said... It would probably be lucretive! Really? You'd pay? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread Corey Richardson
On 01/15/2011 05:45 PM, walter weston wrote: > I thought creating a Python help hotline would help programmers > exponential! I think they should make a help hotline for every > programming language. and since I havent discovered something similar It > would probably be lucretive! > > > > __

[Tutor] Anyone interested in creating a python help hotline?

2011-01-15 Thread walter weston
I thought creating a Python help hotline would help programmers exponential! I think they should make a help hotline for every programming language. and since I havent discovered something similar It would probably be lucretive! __

[Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread walter weston
I thought creating a Python help hotline would help programmers exponential! I think they should make a help hotline for every programming language. and since I havent discovered something similar It would probably be lucretive! _

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-15 Thread Steven D'Aprano
Sean Carolan wrote: Bite the bullet and learn how to use vim; you won't regret it. There's a steep learning curve at first but once you get the hang of it you'll be coding like a boss. Well, I don't know about you, but I've worked for a number of bosses over the years and only one of them cou

[Tutor] TKinter help

2011-01-15 Thread walter weston
I am just starting to learn Tkinter and I was wondering if I should just run tkinter in pythons new findow and run the program. Iv done this before and my python crashed.. plus I want to create a text widget that has a quit box. will pythons IDLE be able to handle this and display the widget ?

Re: [Tutor] Add rownumber to list of .arff files

2011-01-15 Thread David Hutto
>>> filename = ['file1','file2','file3'] >>> fileprefix = 'TRE_' >>> for item in filename: print('%s%s'%(fileprefix,item)) ... TRE_file1 TRE_file2 TRE_file3 or with list comp >>> combined = [('%s%s'%(fileprefix,item)) for item in filename] >>> combined ['TRE_file1', 'TRE_file2', 'TRE_file3'] >>>

Re: [Tutor] Add rownumber to list of .arff files

2011-01-15 Thread David Hutto
On Sat, Jan 15, 2011 at 12:02 PM, Daan Raemdonck wrote: > Dear all, > > > > I am reaching out to you because I have a small issue I need to deal with, > yet I feel that it requires pretty advanced coding to solve. > > I have a whole lot of .arff files that would simply need a case number added > t

Re: [Tutor] defining functions and classes

2011-01-15 Thread Brett Murch
Yes you are right it is a Name error because skills was not defined. Sorry will make things more clear in the future. I have it sorted now. Will just start from the beginning and try not to go to fast. On Sat, 2011-01-15 at 21:34 +1100, Steven D'Aprano wrote: > Brett Murch wrote: > > > I keep ge

Re: [Tutor] defining functions and classes

2011-01-15 Thread Brett Murch
On Sat, 2011-01-15 at 08:23 -0500, Dave Angel wrote: > On 01/-10/-28163 02:59 PM, Brett Murch wrote: > > Hi everyone, > > > > I'm just starting to learn Python and am starting by creating a text > > game but am having trouble with classes and funtions. I want to create a > > class or function where

Re: [Tutor] module to parse XMLish text?

2011-01-15 Thread Karim
Hello, I did not see the XML code in details before I gave the code with ElementTree. In fact with unclosing tags you will get errors at parse time and it will give you the location of errors. You could use the module from Stefan which is way way superior than ElementTree which can validate

Re: [Tutor] end parameter in 2.7.1?

2011-01-15 Thread शंतनू
Python 2.7.1 (r271:86832, Jan 13 2011, 22:08:21) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> print('hello', end='') File "", line 1 print('hello', end='') ^ SyntaxError: invalid syntax >>> fr

Re: [Tutor] end parameter in 2.7.1?

2011-01-15 Thread Alan Gauld
"Bill DeBroglie" wrote Using Mac OS X 10.5.8 and Python 2.7.1 but am following a book which is using Python 3.1. In 2.7 there should be a way to get print() to work like 3.1... The author uses the end parameter in numerous programs but this doesn't seem to translate to 2.7. Any advice as

Re: [Tutor] end parameter in 2.7.1?

2011-01-15 Thread Peter Otten
Bill DeBroglie wrote: > Twice in two days...! > > Using Mac OS X 10.5.8 and Python 2.7.1 but am following a book which > is using Python 3.1. The author uses the end parameter in numerous > programs but this doesn't seem to translate to 2.7. Any advice as to > how I can specify the final string o

[Tutor] Add rownumber to list of .arff files

2011-01-15 Thread Daan Raemdonck
Dear all, I am reaching out to you because I have a small issue I need to deal with, yet I feel that it requires pretty advanced coding to solve. I have a whole lot of .arff files that would simply need a case number added to every line of data. I've been able to do this for 1 file, but now I

Re: [Tutor] end parameter in 2.7.1?

2011-01-15 Thread Karim
IN 3.1 for print(): >>> print('hello', end =' ') hello>>> It suppress the newline character. On 01/15/2011 07:05 PM, Emile van Sebille wrote: On 1/15/2011 9:35 AM Bill DeBroglie said... Twice in two days...! Using Mac OS X 10.5.8 and Python 2.7.1 but am following a book which is using Pyth

Re: [Tutor] how come this doesnt work

2011-01-15 Thread Alex Hall
On 1/15/11, Alan Gauld wrote: > "Alex Hall" wrote > >> m=int(m) >> just before the if statement. This causes m to turn from a string >> into >> an integer and is what is known as "casting" or "type casting", if I >> have my vocabulary correct. > > Sadly you don't although its a common error. > >

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-15 Thread Izz ad-Din Ruhulessin
Although I probably wont switch from Eclipse to vim, that looks nevertheless very, very nice, bookmarked. 2011/1/15 Sean Carolan > >>> I am new to programming and to Python. I've been using Python with > IDLE > >>> on Windows Vista for a few weeks now. > >>> (And I'm loving it!) However, I'm t

Re: [Tutor] end parameter in 2.7.1?

2011-01-15 Thread Emile van Sebille
On 1/15/2011 9:35 AM Bill DeBroglie said... Twice in two days...! Using Mac OS X 10.5.8 and Python 2.7.1 but am following a book which is using Python 3.1. The author uses the end parameter What's an 'end' parameter? Emile in numerous programs but this doesn't seem to translate to 2.7. Any

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-15 Thread Sean Carolan
>>> I am new to programming and to Python.  I've been using Python with IDLE >>> on Windows Vista for a few weeks now. >>> (And I'm loving it!)  However, I'm thinking about switching to Ubuntu >>> 10.10.  If I download Ubuntu, will I still be able to use the >>> IDLE environment?  I am really quite

Re: [Tutor] When I print random.random

2011-01-15 Thread Emile van Sebille
On 1/14/2011 9:19 PM Steven D'Aprano said... walter weston wrote: when I print random.random() it always returns a float why is this? how do I change it to a whole number? Because random.random() is defined to always return a float between 0 and 1. That's what it does. If you want a random wh

Re: [Tutor] color of "print" function

2011-01-15 Thread Emile van Sebille
On 1/14/2011 4:48 PM Bill DeBroglie said... Hello all, I don't have a problem per se, but have noticed something that I'd like to figure out... Ths best way to figure it out is 'use the source Luke' Idle is written in python, and in python27/Lib/idlelib there's colordelegator.py, where you'

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-15 Thread Izz ad-Din Ruhulessin
Install Eclipse via Synaptic and then PyDev via Eclipse. 2011/1/15 Timo > On 15-01-11 02:17, Joel Knoll wrote: > >> Hello, >> >> I am new to programming and to Python. I've been using Python with IDLE >> on Windows Vista for a few weeks now. >> (And I'm loving it!) However, I'm thinking about

[Tutor] end parameter in 2.7.1?

2011-01-15 Thread Bill DeBroglie
Twice in two days...! Using Mac OS X 10.5.8 and Python 2.7.1 but am following a book which is using Python 3.1. The author uses the end parameter in numerous programs but this doesn't seem to translate to 2.7. Any advice as to how I can specify the final string of the print function? Than

Re: [Tutor] no luck with sqlinsert

2011-01-15 Thread Tommy Kaas
> >I get a invalid syntax error when I try to run this script - and it's > > con.commit() which is highlighted when I get the error. > > Aren't you one closing parenthesis short? > > Alan Gauld Yes, you're absolutely right. Thanks. Tommy ___ Tutor ma

Re: [Tutor] defining functions and classes

2011-01-15 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Brett Murch wrote: Hi everyone, I'm just starting to learn Python and am starting by creating a text game but am having trouble with classes and funtions. I want to create a class or function where someone creates a charater and has a choice of their name or os. This i

Re: [Tutor] defining functions and classes

2011-01-15 Thread Alan Gauld
"Brett Murch" wrote game but am having trouble with classes and funtions. I want to create a class or function where someone creates a charater and has a choice of their name or os. This is what I have so far; class Administrator(): def Skills(name,os): OK, You have a ways to go to und

Re: [Tutor] how come this doesnt work

2011-01-15 Thread Alan Gauld
"Alex Hall" wrote m=int(m) just before the if statement. This causes m to turn from a string into an integer and is what is known as "casting" or "type casting", if I have my vocabulary correct. Sadly you don't although its a common error. This is type conversion. You are actually changing

Re: [Tutor] help

2011-01-15 Thread Alan Gauld
"walter weston" wrote how comes when I run code from a new window in python IDLE the text highlighting dissapears No idea, it doesn't do that for me. Can you be more specific about what you are doing. Also which version of Python, which OS etc? How exactly are you running the code? A

Re: [Tutor] defining functions and classes

2011-01-15 Thread Steven D'Aprano
Brett Murch wrote: I keep getting a syntax error on calling it. any ideas on what I'm doing wrong? Should we *guess*, or would you like to share with us the actual error you are getting? My guess is that you're not getting a syntax error at all, you're getting a NameError that Skills is no

Re: [Tutor] defining functions and classes

2011-01-15 Thread Kann Vearasilp
Do you also have to define the class attributes? class Administrator(): name = "" os = "" def Skills(name,os): name = raw_input('What is your name') os = raw_input('What is your os') self.name = name self.os = os Skills(name,os) On Sat, Jan 15, 2011 at 11:10

[Tutor] defining functions and classes

2011-01-15 Thread Brett Murch
Hi everyone, I'm just starting to learn Python and am starting by creating a text game but am having trouble with classes and funtions. I want to create a class or function where someone creates a charater and has a choice of their name or os. This is what I have so far; class Administrator():

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-15 Thread Timo
On 15-01-11 02:17, Joel Knoll wrote: Hello, I am new to programming and to Python. I've been using Python with IDLE on Windows Vista for a few weeks now. (And I'm loving it!) However, I'm thinking about switching to Ubuntu 10.10. If I download Ubuntu, will I still be able to use the IDLE en

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-15 Thread Nick Stinemates
Python comes pre installed on Ubuntu, as most of the GUI is written in it. Nick On Friday, January 14, 2011, Joel Knoll wrote: > > > > > > Hello, > > I am new to programming and to Python.  I've been using Python with IDLE on > Windows Vista for a few weeks now. > (And I'm loving it!)  However,