Pymel / Python Coding

textIn() / readFile()

def textIn():
    import EasyDialogs
    input_file = EasyDialogs.AskFileForOpen()
    wanted=unicode
    import os
    input_text = os.path.basename(input_file)
    input2_text = os.path.dirname(os.path.abspath(input_text))
    output_text = os.path.splitext(input2_text)[0]+ '\\' + os.path.splitext(input_text)[0]  + ".csv"
    fileLocation = pm.text('File_Location_Label', e=True, l=output_text)  

def readFile():
    import pymel.core as pm
    import re
    dataFile = pm.text('File_Location_Label', q=True, l=True)
    dataPath = dataFile
    f = open (dataPath)
    line = f.readline()
    while line:
        parts = line.split(",")
        cityObject = parts[2].strip()
        pm.textCurves( f='Times-Roman', t=cityObject,n=cityObject)
        line = f.readline()
    f.close()

WordPress Pastebin plugin