[Pythonmac-SIG] inputing multi-digit numbers

Henning.Ramm@mediapro-gmbh.de Henning.Ramm at mediapro-gmbh.de
Thu Nov 10 14:01:50 CET 2005


 

	-----Original Message-----
	From: pythonmac-sig-bounces at python.org [mailto:pythonmac-sig-bounces at python.org] On Behalf Of Kirk Durston
	Sent: Thursday, November 10, 2005 2:00 AM
	To: pythonmac-sig at python.org
	Subject: [Pythonmac-SIG] inputing multi-digit numbers
	
	
	I'm having a hard time figuring out how to input a list of numbers, each one of which can be 1, 2, or 3 digits in length. First, I select a column in an Excel file, and copy and past it into a Word file. I then save it as a text file. I then open a new window in Python and copy and paste the column of numbers from the text file into the window and save it as 'Function ID'
	
	In my main program, I type
	
	input=open('Function ID', 'r')
	x=input.readlines()
	input.close()
	print x
	 

Try open (or file) with mode 'rU' (universal newline support), apparently the \r is not recognized as \n 
 
Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20051110/ed53ecb0/attachment.html


More information about the Pythonmac-SIG mailing list