Python vlookup issue -


i'm trying use python-vlookup, following script:

### python_vlookup import python_vlookup faster_vlookup csv_rows = python_vlookup.get_csv_data('example.csv') column_dict = python_vlookup.create_column_dict(csv_rows,1) ###  lookup_value = 'outdoor/accessories' lookup_list = ['bed-and-bath/accessories','bed-and-bath/storage-and-hampers/storage','decor-and-pillows/rugs/hide']   print python_vlookup.vlookup(lookup_value,'example.csv',2) print python_vlookup.vlookup(lookup_list,'example.csv',3)  print python_vlookup.faster_vlookup(lookup_list,column_dict) 

but error:

ioerror: [errno 2] no such file or directory: 'example.csv'

how put file in directory resolve problem?

either start using full paths (recommended), such as:

csv_rows = python_vlookup.get_csv_data('c:\\users\\youruser\\desktop\\example.csv') 

or can move example.csv file main script directory. aka need reside in same folder, instance on desktop.

for instance:

c:\  |  |-- folder          |          |-- example.csv          |-- myscript.py 
  1. by opening startmenu -> write "cmd" + enter
  2. then write "c:" + enter in black window/console
  3. and write cd "my folder"+enter
  4. finally, write c:\python34\python.exe myscript.py+enter

note: assumes python3.4, replace c:\python32\ path wherever installed python.

if you're using linux, you'd need do:

  1. cd /home/user/my_folder && python myscript.py

this should work.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -