0

I am using python 3.6 with Visual Studio Code on window 10. I was working on extracting data from SmartSheet using API. Here is my code.

import smartsheet
import importlib
import supporting_tools as spt

Token = 'api_token'


sheet_id_2nd = 'sheet_id'
sheet_id_3rd = 'sheet_id'

sheet2nd = spt.read_sheet (Token, sheet_id_2nd)
sheet3rd = spt.read_sheet (Token, sheet_id_3rd)

col_map_2nd = spt.col_list (sheet2nd)
col_map_3rd = spt.col_list (sheet3rd)
print(col_map_2nd)
id_set_2nd = set()
id_set_3rd = set()
for row in sheet2nd.rows:
     Id_cell = spt.get_cell_by_column_name(row, "Row ID", col_map_2nd)
     id_set_2nd.add(Id_cell.display_value)

print(id_set_2nd)

for row in sheet3rd.rows:
     Id_cell = spt.get_cell_by_column_name(row, "Row ID", col_map_3rd)
     id_set_3rd.add(Id_cell.display_value)

print(id_set_3rd)

This works fine when I run it in debug mode but returns this error when I run it in the terminal. I searched for a solution and it seems like there is problem with iPython but I am not sure. Any advice?

"C:/Users/Jay Choi/AppData/Local/Programs/Python/Python36/python.exe" "c:/Users/Jay Choi/Desktop/New folder/main.py"
  File "<stdin>", line 1
    "C:/Users/Jay Choi/AppData/Local/Programs/Python/Python36/python.exe" "C:/Users/Jay Choi/Desktop/New folder/main.py"
    ^
SyntaxError: invalid syntax
Daniel Walker
  • 6,380
  • 5
  • 22
  • 45
  • move it to a diff dir and work with it there.. dont use ur default c dir.. I think this is more of a path error.. than anything wrong with ur code.. – Yatish Kadam Aug 14 '20 at 16:19
  • can you provide the full stack trace? not sure what line it fails, thanks – bro Aug 14 '20 at 16:21
  • This message means that you are *not* running the program in the terminal, but instead trying to use a terminal command within the Python interpreter prompt (i.e., `python.exe` is already running). – Karl Knechtel Aug 14 '20 at 17:31

0 Answers0