0

I'm trying to run a python program in the terminal. I have successfully called the .py script using python filename.py, and once the script starts running it asks for the first input file, which is a .csv file. When I type the path to that .csv file, I get a syntax error. See below for all the code starting with calling the python script.

python /Users/juliafiske/Desktop/GTSeq_Pipeline/Genotyping_Scripts/Genotyping_Scripts/GTseq_BarcodeSplit_MP_NextSeq_10K.py 

type the path to input file
Format= /home/user/...

/Users/juliafiske/Desktop/GTSeq_Pipeline/Practice/Practice_sampleIDs_new.csv
Traceback (most recent call last):
  File "/Users/juliafiske/Desktop/GTSeq_Pipeline/Genotyping_Scripts/Genotyping_Scripts/GTseq_BarcodeSplit_MP_NextSeq_10K.py", line 24, in <module>
    path1 = input()
  File "<string>", line 1
    /Users/juliafiske/Desktop/GTSeq_Pipeline/Practice/Practice_sampleIDs_new.csv
    ^
SyntaxError: invalid syntax

The beginning of the .py script being called looks like this:

from multiprocessing import Process

print('type the path to input file\nFormat= /home/user/...')
path1 = input()

print('type the path to the fastq file to split\nFormat= /home/user/...')
path2 = input()
2
  • What happens if you put quotes around the input? Commented Dec 4, 2019 at 22:51
  • 1
    That worked!! Thank you so much. Such a simple fix, I'm a beginner! Commented Dec 4, 2019 at 23:08

2 Answers 2

3

You're using Python 2.

Use raw_input() instead of input() to collect keyboard input.

Sign up to request clarification or add additional context in comments.

Comments

1

Quotations were needed around /Users/juliafiske/....

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.