Re: [Tutor] (no subject)

2014-05-14 Thread Alan Gauld
On 15/05/14 05:57, JEAN MICHEL wrote: with open ("period1.txt", 'r') as infile: for line in infile: values = line.split() name.append(values[0] + ','+ values[1]) for line in infile: values = line.split() score1=float(values[2])

Re: [Tutor] (no subject)

2014-05-14 Thread JEAN MICHEL
thank you for the all advice I really appreciate it. I probably wasn't wasn't too clear when i first sent my email asking for help, my apologies so let me better explain what i'm doing. I'm trying to write a program that reads 3 class data files such as period1.txt, period2.txt. Inside those files

Re: [Tutor] (no subject)

2014-05-14 Thread Cameron Simpson
Before we begin, two etiquette requests: - please supply a meaningful subject line; it helps everyone keep track of the discussions; this one might have used something like "help with simple grading problem" - please see if your mailer (GMail?) can be told to send just plain text to this

Re: [Tutor] (no subject)

2014-05-14 Thread Danny Yoo
On Wed, May 14, 2014 at 9:15 PM, Danny Yoo wrote: >> if curraverage>= 90: >> grade= "A" >> lettergrades.append(grade) >> else: >> if curraverage >= 80 and curraverage < 90: >> grade= "B" >> lettergrades.append(grad

Re: [Tutor] (no subject)

2014-05-14 Thread Danny Yoo
> if curraverage>= 90: > grade= "A" > lettergrades.append(grade) > else: > if curraverage >= 80 and curraverage < 90: > grade= "B" > lettergrades.append(grade) > else: > if curraverage >=

Re: [Tutor] (no subject)

2014-05-14 Thread Dave Angel
On 05/14/2014 04:48 PM, JEAN MICHEL wrote: I'm a Python beginner Welcome to python-tutor trying write a program that reads outside txt files, What's an "outside txt file"? And since you only one file, perhaps you left out the othertwo? takes the data like the name and test grades of s

Re: [Tutor] Translator - multiple choice answer

2014-05-14 Thread C Smith
This might be useful for reading values from a text value into a dictionary: https://stackoverflow.com/questions/17775273/how-to-read-and-store-values-from-a-text-file-into-a-dictionary-python On Wed, May 14, 2014 at 7:00 PM, Danny Yoo wrote: >> Program read TXT file (c:\\slo3.txt) >> In this fil

Re: [Tutor] Translator - multiple choice answer

2014-05-14 Thread Danny Yoo
> Program read TXT file (c:\\slo3.txt) > In this file there are two words per line separated by tab. > First word is foreign language and second word is proper translation, like > this: > > pivobeer > kruhbread > rdeca red > krompir potatoe > hisahouse > cesta road > autocar > >

Re: [Tutor] (no subject)

2014-05-14 Thread Alan Gauld
On 14/05/14 21:48, JEAN MICHEL wrote: I'm a Python beginner Welcome to the list. Please always include a subject line relating to your question. It makes searching the archives much easier! I'm having difficulties writing the program so far I've been able to write up half of the program

[Tutor] Translator - multiple choice answer

2014-05-14 Thread Mario Py
Hi all, my first post here and my first ever programing project! (actually stealing code from all over the internet for now) So please be easy on me & hints probably will not work with me, I'm complete beginner... I'm trying to create something useful, small program which will help my wife to

[Tutor] (no subject)

2014-05-14 Thread JEAN MICHEL
I'm a Python beginner trying write a program that reads outside txt files, takes the data like the name and test grades of students then calculate the average and also assigns a grade and writes the data into a new txt file. I'm having difficulties writing the program so far I've been able to write

Re: [Tutor] While Loop?

2014-05-14 Thread Dave Angel
On 05/14/2014 05:45 AM, Sam Ball wrote: I'm attempting to create a program where the user inputs their account number (which must be 8 digits) and if what the user enters is not 8 digits in length I want python to tell the user this is invalid and then keep asking for the account number until

Re: [Tutor] substituting for time_series, Pandas, Anaconda. Practical Programming, intro Comp Sci, Gries text

2014-05-14 Thread Albert-Jan Roskam
- Original Message - > From: Jim Byrnes > To: tutor@python.org > Cc: > Sent: Wednesday, May 14, 2014 10:40 PM > Subject: Re: [Tutor] substituting for time_series, Pandas, Anaconda. > Practical Programming, intro Comp Sci, Gries text > > On 05/14/2014 02:08 PM, Charles Agriesti wrot

Re: [Tutor] substituting for time_series, Pandas, Anaconda. Practical Programming, intro Comp Sci, Gries text

2014-05-14 Thread Jim Byrnes
On 05/14/2014 02:08 PM, Charles Agriesti wrote: Practical programming, 2nd Edition, Paul Gries, Jennifer Campbell, Jason Montojo (Python 3) P 184, the last half of chapter 10 requires the time_series module, which is no longer available, apparently replaced by Pandas. Read the first paragraph

Re: [Tutor] substituting for time_series, Pandas, Anaconda. Practical Programming, intro Comp Sci, Gries text

2014-05-14 Thread Marc Tompkins
On Wed, May 14, 2014 at 12:08 PM, Charles Agriesti wrote: > Is this Anaconda thing any part of being able to run the scripts from the > textbook with time_series? Is it a complete wild goose chase? > First off - I know nothing about using Python in a scientific setting. Second (before anyone el

Re: [Tutor] substituting for time_series, Pandas, Anaconda. Practical Programming, intro Comp Sci, Gries text

2014-05-14 Thread Albert-Jan Roskam
> From: Charles Agriesti >To: Tutor@python.org >Sent: Wednesday, May 14, 2014 9:08 PM >Subject: [Tutor] substituting for time_series, Pandas, Anaconda. Practical >Programming, intro Comp Sci, Gries text > > >Practical programming, 2nd Edition, Paul Gries, Jenn

[Tutor] substituting for time_series, Pandas, Anaconda. Practical Programming, intro Comp Sci, Gries text

2014-05-14 Thread Charles Agriesti
Practical programming, 2nd Edition, Paul Gries, Jennifer Campbell, Jason Montojo (Python 3) P 184, the last half of chapter 10 requires the time_series module, which is no longer available, apparently replaced by Pandas. Looked into installing Pandas. Installing Anaconda is supposed to accom

Re: [Tutor] for the error about 'import site' failed; use -v for traceback

2014-05-14 Thread C Smith
What are you trying to do? On Wed, May 14, 2014 at 12:24 PM, C Smith wrote: > That looks pretty normal. I don't see any errors. > > On Wed, May 14, 2014 at 5:42 AM, Tao Zhu wrote: >> Hi everyone, >> when I use python, the problem occured. when I used the command "python -v", >> the results are l

Re: [Tutor] for the error about 'import site' failed; use -v for traceback

2014-05-14 Thread C Smith
That looks pretty normal. I don't see any errors. On Wed, May 14, 2014 at 5:42 AM, Tao Zhu wrote: > Hi everyone, > when I use python, the problem occured. when I used the command "python -v", > the results are listed as follows. could you tell me what wrong? > > $ python -v > # installing zipimpo

Re: [Tutor] While Loop?

2014-05-14 Thread Danny Yoo
On Wed, May 14, 2014 at 2:45 AM, Sam Ball wrote: > I'm attempting to create a program where the user inputs their account > number (which must be 8 digits) and if what the user enters is not 8 digits > in length I want python to tell the user this is invalid and then keep > asking for the account

Re: [Tutor] While Loop?

2014-05-14 Thread Alan Gauld
On 14/05/14 10:45, Sam Ball wrote: I'm attempting to create a program where the user inputs their account number (which must be 8 digits) and if what the user enters is not 8 digits in length I want python to tell the user this is invalid and then keep asking for the account number until a suitab

[Tutor] for the error about 'import site' failed; use -v for traceback

2014-05-14 Thread Tao Zhu
Hi everyone, when I use python, the problem occured. when I used the command "python -v", the results are listed as follows. could you tell me what wrong? $ python -v # installing zipimport hook import zipimport # builtin # installed zipimport hook # /usr/local/lib/python2.4/site.pyc matches /usr

[Tutor] While Loop?

2014-05-14 Thread Sam Ball
I'm attempting to create a program where the user inputs their account number (which must be 8 digits) and if what the user enters is not 8 digits in length I want python to tell the user this is invalid and then keep asking for the account number until a suitable number has been entered. I'm g