[Tutor] how do (or do I) do a list of variable names?

2014-02-02 Thread rick
Hello Everyone, I think my approach is all wrong, but here goes. var1 = []; var2 = []; var3 = []; . . . ~50 lists each variable would be a list of two digit integers, or two digit integers stored as strings (I don't need to do any math, I just need to know which integers are in which variable

Re: [Tutor] how do (or do I) do a list of variable names?

2014-02-02 Thread Peter Otten
rick wrote: > Hello Everyone, > > I think my approach is all wrong, but here goes. > > var1 = []; var2 = []; var3 = []; . . . ~50 lists > > > each variable would be a list of two digit integers, or two digit > integers stored as strings (I don't need to do any math, I just need to > know whi

[Tutor] most useful ide

2014-02-02 Thread Ian D
Hi Are there any recommendations for python ide's currently I am using idle, which seems pretty decent but am open to any suggestions cheers ___ Tutor maillist - Tutor@python.org To unsubscribe or chang

[Tutor] sorting and writing to data file

2014-02-02 Thread adrian
Hello community, Newbie here. I have a data (.dat) file with integers (2,9,1,5,7,3,9) in it just as shown. My instructions are to sort the numbers and rewrite them back to the data file. *here is my code:** * lab3int=[2,9,1,5,7,3,9] lab3int.sort() print(lab3int) lab3int=open('lab3int.dat','w

Re: [Tutor] Best version for novice

2014-02-02 Thread Leam Hall
On 02/01/2014 03:35 PM, Alan Gauld wrote: On 01/02/14 18:41, Ian D wrote: Is it better to use python 3 as a newcomer who isn't really going to be writing any software as such just using it for learning? The more important question is which version does your preferred tutorial use? And are y

[Tutor] strange errors

2014-02-02 Thread Gabriele Brambilla
Hi, sometimes when I try to run a program in Python I obtain some errors. The strange thing is that sometimes when I run it a second time or when I turn off the pc and I restart later to try to make it works it gives different errors. How could I avoid this problem? I think that it is because it

Re: [Tutor] help me

2014-02-02 Thread hind fathallah
thank you so much because I got it :)  On Saturday, February 1, 2014 1:28 PM, Danny Yoo wrote: On Fri, Jan 31, 2014 at 8:55 PM, hind fathallah wrote: > hi can you answer this question for me plz [question omitted] Many of us probably could answer this. But this is not a homework-answerin

Re: [Tutor] sorting and writing to data file

2014-02-02 Thread Alan Gauld
On 02/02/14 03:08, adrian wrote: Newbie here. I have a data (.dat) file with integers (2,9,1,5,7,3,9) in it just as shown. In your code below you use a hard coded list not a data file? lab3int=[2,9,1,5,7,3,9] lab3int.sort() print(lab3int) So far so good. lab3int=open('lab3int.dat','w')

Re: [Tutor] strange errors

2014-02-02 Thread Alan Gauld
On 02/02/14 02:11, Gabriele Brambilla wrote: sometimes when I try to run a program in Python I obtain some errors. How are you running the program? doubly clicking in a file manager/explorer? Running from an OS command line? Importing from the Python >>> prompt? Or using some kind of IDE? (Wh

Re: [Tutor] sorting and writing to data file

2014-02-02 Thread Peter Otten
Alan Gauld wrote: > You need a loop such as > > for item in lab3int: >intFile.write( str(item) ) You also need to separate the values, with a space, a newline or whatever. So: for item in lab3int: intFile.write(str(item)) intFile.write("\n") This can be simplified to for item in

Re: [Tutor] most useful ide

2014-02-02 Thread Alan Gauld
On 02/02/14 08:25, Ian D wrote: Are there any recommendations for python ide's Lots depending who you ask... currently I am using idle, which seems pretty decent but am open to any suggestions If it works for you then use it. The thing about IDEs is that they ae very personal. Some people

Re: [Tutor] most useful ide

2014-02-02 Thread Asokan Pichai
On Sun, Feb 2, 2014 at 1:55 PM, Ian D wrote: > Hi > > Are there any recommendations for python ide's > > currently I am using idle, which seems pretty decent but am open to any > suggestions > cheers > While not an IDE in the usual sense I have found IPython a great addition to my toolkit. YMMV

Re: [Tutor] most useful ide

2014-02-02 Thread scurvy scott
Hi Are there any recommendations for python ide's currently I am using idle, which seems pretty decent but am open to any suggestions cheers I personally prefer the Linux interpreter. Since you're asking. Scott On Sun, Feb 2, 2014 at 10:43 AM, Asokan Pichai wrote: > > > > On Sun, Feb 2, 2

Re: [Tutor] strange errors

2014-02-02 Thread ALAN GAULD
forwarding to list... Please use reply-all when responding to the list.   Alan Gauld Author of the Learn To Program website http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos > > From: Gabriele Brambilla >To: Alan Gauld >Sent: Sunday, 2 Febr

Re: [Tutor] most useful ide

2014-02-02 Thread Albert-Jan Roskam
>Subject: Re: [Tutor] most useful ide > >On 02/02/14 08:25, Ian D wrote: > >> Are there any recommendations for python ide's > >Lots depending who you ask... If you ask me: Spyder (free) or PyCharm (free for open source projects) ;-) ___ Tutor maillis

Re: [Tutor] most useful ide

2014-02-02 Thread Kodiak Firesmith
Pycharm is nice for bigger projects (since tou can collapse any section); but it's crazy resource intensive. For Linux Gedit can be made very nice for python, and of course vim in the shell is very nice with the right ~/.vimrc. On Feb 2, 2014 11:20 AM, "scurvy scott" wrote: > Hi > > Are there an

Re: [Tutor] most useful ide

2014-02-02 Thread Pierre Dagenais
On 14-02-02 01:16 PM, Kodiak Firesmith wrote: > Pycharm is nice for bigger projects (since tou can collapse any section); > but it's crazy resource intensive. For Linux Gedit can be made very nice I prefer Geany as it will run my code with a click of the mouse. > for python, and of course vim

Re: [Tutor] most useful ide

2014-02-02 Thread Oscar Benjamin
On Feb 2, 2014 8:17 PM, "Pierre Dagenais" wrote: > > > > On 14-02-02 01:16 PM, Kodiak Firesmith wrote: > > Pycharm is nice for bigger projects (since tou can collapse any section); > > but it's crazy resource intensive. For Linux Gedit can be made very nice > > I prefer Geany as it will run my co

Re: [Tutor] Best version for novice

2014-02-02 Thread Pierre Dagenais
On 14-02-01 08:20 PM, Steven D'Aprano wrote: > On Sat, Feb 01, 2014 at 06:41:10PM +, Ian D wrote: >> Hi >> >> Is it better to use python 3 as a newcomer who isn't really going to >> be writing any software as such just using it for learning? > > Yes, you should use Python 3, with one provi

Re: [Tutor] most useful ide

2014-02-02 Thread Ken G.
On 02/02/2014 03:10 PM, Pierre Dagenais wrote: On 14-02-02 01:16 PM, Kodiak Firesmith wrote: Pycharm is nice for bigger projects (since tou can collapse any section); but it's crazy resource intensive. For Linux Gedit can be made very nice I prefer Geany as it will run my code with a click o

Re: [Tutor] most useful ide

2014-02-02 Thread Wiktor Matuszewski
W dniu 2014-02-02 18:56, Albert-Jan Roskam pisze: >> On 02/02/14 08:25, Ian D wrote: >> >>> Are there any recommendations for python ide's >> >> Lots depending who you ask... > > If you ask me: Spyder (free) or PyCharm (free for open source projects) ;-) There is also PyCharm Community Edition.

[Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread Kipton Moravec
I am new to Python, and I do not know how to traverse lists like I traverse arrays in C. This is my first program other than "Hello World". I have a Raspberry Pi and they say Python is the language of choice for that little machine. So I am going to try to learn it. I have data in the form of x,

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread David Hutto
On Sun, Feb 2, 2014 at 3:46 PM, Kipton Moravec wrote: > I am new to Python, and I do not know how to traverse lists like I > traverse arrays in C. This is my first program other than "Hello World". > I have a Raspberry Pi and they say Python is the language of choice for > that little machine. So

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread David Hutto
On Sun, Feb 2, 2014 at 6:44 PM, David Hutto wrote: > > > > On Sun, Feb 2, 2014 at 3:46 PM, Kipton Moravec wrote: > >> I am new to Python, and I do not know how to traverse lists like I >> traverse arrays in C. This is my first program other than "Hello World". >> I have a Raspberry Pi and they s

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread David Hutto
Kind of sure this is the translation line for line: #We define some vars before utilizing them x,and y are list comprehension # You said int for x, so it's created in ints, and y is in floats x = [num for num in range(0,496)] # You said double for y, so the it's created in floats, and x is an int

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread Dave Angel
Kipton Moravec Wrote in message: > I am new to Python, and I do not know how to traverse lists like I > traverse arrays in C. This is my first program other than "Hello World". > I have a Raspberry Pi and they say Python is the language of choice for > that little machine. So I am going to try to

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread Steven D'Aprano
On Sun, Feb 02, 2014 at 02:46:38PM -0600, Kipton Moravec wrote: > I am new to Python, and I do not know how to traverse lists like I > traverse arrays in C. You can do this, but normally shouldn't: data = [2, 4, 8, 16, 32] for i in range(0, len(data)): x = data[i] print(x) That is a mor

Re: [Tutor] sorting and writing to data file

2014-02-02 Thread spir
On 02/02/2014 04:08 AM, adrian wrote: Hello community, Newbie here. I have a data (.dat) file with integers (2,9,1,5,7,3,9) in it just as shown. My instructions are to sort the numbers and rewrite them back to the data file. *here is my code:** * lab3int=[2,9,1,5,7,3,9] lab3int.sort() print(la

Re: [Tutor] most useful ide

2014-02-02 Thread spir
On 02/02/2014 09:10 PM, Pierre Dagenais wrote: On 14-02-02 01:16 PM, Kodiak Firesmith wrote: Pycharm is nice for bigger projects (since tou can collapse any section); but it's crazy resource intensive. For Linux Gedit can be made very nice I prefer Geany as it will run my code with a click