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
- by opening startmenu -> write "cmd" + enter
- then write "c:" + enter in black window/console
- and write
cd "my folder"
+enter - 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:
cd /home/user/my_folder && python myscript.py
this should work.
Comments
Post a Comment