Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getLines( filename ):
- path = Cocoa.NSBundle.mainBundle().bundlePath()
- real_path = path[0: len(path) - 8]
- print real_path
- f = open(real_path + filename, 'r') # open the file as an object
- if len(f.read()) <= 0:
- lines = {} # list to hold lines in the file
- for line in f.readlines(): # loop through the lines
- line = line.replace( "r", " " )
- line = line.replace( "t", " " )
- lines = line.split(" ") # segment the columns using tabs as a base
- f.close() # close the file object
- return lines
- lines = getLines( "raw.txt" )
- for index, item in enumerate( lines ): # iterate through lines
- # ...
- f= open(real_path + filename, 'r') # open the file as an object
- if len(f.read()) <= 0:
- lines = {} # list to hold lines in the file
- for line in f.readlines(): # loop through the lines
- f= open(real_path + filename, 'r') # open the file as an object
- lines = {} # list to hold lines in the file
- for line in f.readlines(): # loop through the lines
- f= open(real_path + filename, 'r') # open the file as an object
- lines = [] # list to hold lines in the file
- for line in f.readlines(): # loop through the lines
- # process line
- lines.append(line.split(" "))
Add Comment
Please, Sign In to add comment