How to pull a file with python code in Unix env
Question: I have the file in this place

    
    
    /home/unica/app/Affinium/Campaign/partitions/partition1/scripts/runscripts/campaigns/cnyr/dev 
    

I want to call it here.like.

    
    
     with open('/home/unica/app/Affinium/Campaign/partitions/partition1/scripts/runscripts/campaigns/cnyr/dev/CNYR_DM_TM_CAMPAIGN_WAVES.csv','rb') as csvfile
    

But it is throwing error as syntax error.Also how can I simplify the path name
into some alias name.


Answer: Try this:

    
    
    fileName = '/home/unica/app/Affinium/Campaign/partitions/partition1/scripts/runscripts/campaigns/cnyr/dev/CNYR_DM_TM_CAMPAIGN_WAVES.csv'
    
    with open(fileName, 'rb') as csvfile: # notice that the line must end with a ':'
        for line in csvfile:
            # do something
    

Or even better, use the [`csv`](https://docs.python.org/2/library/csv.html)
module:

    
    
    import csv
    
    with open(fileName, 'rb') as csvfile:
        reader = csv.reader(csvfile, delimiter=',', quotechar='|') # specify delimiter, etc.
        for row in reader:
            # do something
    

