Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name '[argument]' is not defined #23

Open
K-Mistele opened this issue Apr 12, 2018 · 1 comment
Open

Name '[argument]' is not defined #23

K-Mistele opened this issue Apr 12, 2018 · 1 comment

Comments

@K-Mistele
Copy link

Downloading and importing the module works fine. When I try and run it, no matter what arguments I use (-i, -o, etc.), I get an error that says name '[whatever the letter argument is] is not defined.
Ex.
>>>querycsv -i podcasts.csv -o output.csv [sql command]
Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'i' is not defined

@dmiro
Copy link
Contributor

dmiro commented Jul 15, 2022

You have to run the script from the console, and not from the Python interpreter.

Correct:

PS C:\Users\miromart\querycsv-redux> pip install -e .  
Obtaining file:///C:/Users/miromart/Documents/querycsv/querycsv-redux
  Preparing metadata (setup.py) ... done
Installing collected packages: querycsv-redux
  Running setup.py develop for querycsv-redux
Successfully installed querycsv-redux-5.0.0
PS C:\Users\miromart\querycsv-redux> querycsv -i aa.csv  "select * from aa where nombre='david'"
 nombre | edad
===============
 david  | 10

Incorrect:

PS C:\Users\miromart\querycsv-redux> python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> querycsv -i podcasts.csv -o output.csv [sql command]   
  File "<stdin>", line 1
    querycsv -i podcasts.csv -o output.csv [sql command]
             ^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants