Re: [Tutor] How to get two user inputs in same prompt seperated by a special character?

2012-07-13 Thread mariocatch
On Fri, Jul 13, 2012 at 11:46 PM, Santosh Kumar wrote: > Like in my script: > > #!/usr/bin/env python > #-*- coding:utf-8 -*- > > print "You will be prompted to enter your height in feet and inches." > height_in_feet = input("How much feet are you long: ") > remaining_inches = input("How much inch

[Tutor] How to get two user inputs in same prompt seperated by a special character?

2012-07-13 Thread Santosh Kumar
Like in my script: #!/usr/bin/env python #-*- coding:utf-8 -*- print "You will be prompted to enter your height in feet and inches." height_in_feet = input("How much feet are you long: ") remaining_inches = input("How much inches remained? ") inches_in_feet = height_in_feet * 12 total_height_in

Re: [Tutor] What’s the differences between these two pieces of code ?

2012-07-13 Thread eryksun
On Sat, Jul 7, 2012 at 12:59 AM, redstone-cold wrote: > > for i in range(1, 7): > > print(2 * i, end=' ') The HTML attachment was scrubbed: http://mail.python.org/pipermail/tutor/attachments/20120707/855bd6ce/attachment-0001.html Here's the troublesome 'indent': Please post using plain text

Re: [Tutor] converting EBCIDIC to ASCII

2012-07-13 Thread Steven D'Aprano
Prinn, Craig wrote: I am trying to convert an EBCIDIC file to ASCII, when the records are fixed length I can convert it fine, I have some files that are coming in as variable length records, is there a way to convert the file in Python? I tried using no length but then it just reads in to a fixed

Re: [Tutor] converting EBCIDIC to ASCII

2012-07-13 Thread Marc Tompkins
On Fri, Jul 13, 2012 at 1:28 PM, Prinn, Craig wrote: > The records are coming off of a mainframe, so there probably was a 2 > byte RDW or length indicator at one point. If there is a x0D x0A at the end > would that work? > > Thanks > > Craig > I presume so, but (despite my bloviating abo

Re: [Tutor] What’s the differences between these two pieces of code ?

2012-07-13 Thread Mark Lawrence
On 13/07/2012 18:54, Chris Hare wrote: On Jul 6, 2012, at 11:59 PM, redstone-cold wrote: What’s the differences between these two pieces of code ? (1) for i in range(1, 7): print(2 * i, end=' ') (2) for i in range(1, 7): print(2 * i, end=' ') print() I think they are exactly the

Re: [Tutor] starting to learn

2012-07-13 Thread David Rock
* blindmaildrop [2012-07-11 16:46]: > Hello! > > I am just starting to learn python, having signed up for a class on it in > University. The last time I programmed anything was in the long long long > ago of BASIC and (well since I spent time doing other things) I missed the > development boat.

Re: [Tutor] converting EBCIDIC to ASCII

2012-07-13 Thread Marc Tompkins
On Thu, Jul 5, 2012 at 9:30 AM, Prinn, Craig wrote: > ** ** ** ** ** ** > > I am trying to convert an EBCIDIC file to ASCII, when the records are > fixed length I can convert it fine, I have some files that are coming in as > variable length records, is there a way to convert the file in Python? I

Re: [Tutor] What’s the differences between these two pieces of code ?

2012-07-13 Thread Dave Angel
On 07/07/2012 12:59 AM, redstone-cold wrote: > What’s the differences between these two pieces of code ? > > (1) > > for i in range(1, 7): > > print(2 * i, end=' ') > > > > > > (2) > > for i in range(1, 7): > > print(2 * i, end=' ') > > print() > > > > > > when executed both respe

Re: [Tutor] get columns from txt file

2012-07-13 Thread Prasad, Ramit
Please always reply to the list! > > Hi! > I am sorry, but still I don't get it! > I am trying with this (the code is attached) > > csv_out=csv.writer(open('out1.csv', 'wb'), delimiter=' ', > quoting=csv.QUOTE_ALL, dialect='excel') > and > csv_out=csv.writer(open('out1.csv', 'wb'), dialect='exce

Re: [Tutor] What’s the differences between these two pieces of code ?

2012-07-13 Thread Chris Hare
On Jul 6, 2012, at 11:59 PM, redstone-cold wrote: > What’s the differences between these two pieces of code ? > (1) > for i in range(1, 7): > print(2 * i, end=' ') > > > (2) > for i in range(1, 7): > print(2 * i, end=' ') > print() > I think they are exactly the same, except the se

Re: [Tutor] starting to learn

2012-07-13 Thread R. Alan Monroe
> So starting from scratch, how-to? print "hello world" Alan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] get columns from txt file

2012-07-13 Thread susana moreno colomer
Hi! I am sorry, but still I don't get it! I am trying with this (the code is attached) csv_out=csv.writer(open('out1.csv', 'wb'), delimiter=' ', quoting=csv.QUOTE_ALL, dialect='excel') and csv_out=csv.writer(open('out1.csv', 'wb'), dialect='excel-tab') When I open out1 with text editor, I g

[Tutor] starting to learn

2012-07-13 Thread blindmaildrop
Hello! I am just starting to learn python, having signed up for a class on it in University. The last time I programmed anything was in the long long long ago of BASIC and (well since I spent time doing other things) I missed the development boat. So starting from scratch, how-to? thanks --c.

[Tutor] What’s the differences between these two pieces of code ?

2012-07-13 Thread redstone-cold
What’s the differences between these two pieces of code ? (1) for i in range(1, 7): print(2 * i, end=' ') (2) for i in range(1, 7): print(2 * i, end=' ') print() when executed both respectively in Python shell ,I get the same effect . Who can tell me why ?_

[Tutor] converting EBCIDIC to ASCII

2012-07-13 Thread Prinn, Craig
I am trying to convert an EBCIDIC file to ASCII, when the records are fixed length I can convert it fine, I have some files that are coming in as variable length records, is there a way to convert the file in Python? I tried using no length but then it just reads in to a fixed buffer size and I

Re: [Tutor] extracting a column from many files

2012-07-13 Thread bob gailer
On 7/13/2012 5:20 AM, susana moreno colomer wrote: [snip] Please post the entire traceback. You did not tell us what error or where in option 1. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] get columns from txt file

2012-07-13 Thread Joel Goldstick
On Fri, Jul 13, 2012 at 5:21 AM, Marc Tompkins wrote: > Reply to the group, please! > > On Fri, Jul 13, 2012 at 2:09 AM, susana moreno colomer > wrote: >> >> >> Hi! >> I am sorry, but still I don't get it! >> I am trying with this (the code is attached) >> >> csv_out=csv.writer(open('out1.csv', '

Re: [Tutor] get columns from txt file

2012-07-13 Thread Marc Tompkins
Reply to the group, please! On Fri, Jul 13, 2012 at 2:09 AM, susana moreno colomer < susana...@hotmail.com> wrote: > > Hi! > I am sorry, but still I don't get it! > I am trying with this (the code is attached) > > csv_out=csv.writer(open('out1.csv', 'wb'), delimiter=' ', > quoting=csv.QUOTE_ALL,

Re: [Tutor] extracting a column from many files

2012-07-13 Thread susana moreno colomer
From: susana...@hotmail.com To: tutor@python.org Date: Thu, 12 Jul 2012 17:45:31 +0200 Subject: [Tutor] extracting a column from many files Hi! I want to extract from certain kind of files column number 5 and 6. I want to extract acolumns number 5 to one file, and anumber6 to another

Re: [Tutor] get columns from txt file

2012-07-13 Thread Marc Tompkins
On Thu, Jul 12, 2012 at 11:36 PM, susana moreno colomer < susana...@hotmail.com> wrote: > Hi! > I am trying this, but still I get 6 numbers per cell. The only one > difference is that I get a comma between numbers instead an space. > I am opening the document also with excel > Many thanks, > Susa