Thread: Reading a file
View Single Post
Old 05-01-2006, 05:52 AM   #5 (permalink)
coolman
Registered User
 
Join Date: Mar 2006
Posts: 25
coolman is on a distinguished road
This is what I have so far not sure its right

This is what I have so far not sure its right as I am new to Python

Code:
           
 f = open("StudentList.txt", "r")    #Open file
for line in f:	# while there are lines to be read in file
String = line	# Store each line as a temporary String
if string = re.sub(‘\-*’, ‘’, string) # If string does not match '^-+$' add string to output array
coolman is offline   Reply With Quote