Closed pgm00039 closed 2 years ago
pyotdr
is pyOTDR myfil.sor
(note the maj).Yes, I'm writing that command but I don't know if I'm using it wrong
I'm using Windows 10 and Python 3.9 (Spyder) via Anaconda
I don't have any Windows machine to test. I can confirm that pyOTDR is working with python 3.9. Can you paste the entire stack trace (error) showed on your terminal.
runfile('C:/Users/Pablo/Desktop/prueba/untitled0.py', wdir='C:/Users/Pablo/Desktop/prueba') File "C:\Users\Pablo\Desktop\prueba\untitled0.py", line 3 pyOTDR myfile.sor ^ SyntaxError: invalid syntax
I think you are trying to run it inside a python terminal? You have to run it inside a shell terminal, not python interpreter
I have tried both but to no avail. I get the same result.
I tried this on a Win10 laptop running Python 3.7 (pip install pyotdr, then run the pyotdr command), but cannot reproduce the problem. I know that you have already tried running this outside the python interpreter, but have a look at this:
https://stackoverflow.com/questions/13961140/syntax-error-when-using-command-line-in-python
Does just typing python.exe in the CMD window work for you?
Yes, I also tried in the CMD but I get the same issue with SyntaxError: invalid syntax
I just noticed you have a "untitled0.py" file in your error listing. Is this a python file you created? Did you put in the line
pyotdr myfile.sor
inside a python file, and are trying to run the "untitled0.py" file?
Yes, I tried in many ways, but none of them worked for me. I really need to be able to use it as part of my college final project. I need to be able to use it to analyze the trace.
You said "yes"; does this mean that you do have the line
pyotdr myfile.sor
inside a python file "untitled0.py"?
You should not be doing that. You need to type this on the command line (next to the C:> prompt); it should look something like this:
C:/> pyotdr myfile.sor
This is outside of python. Not in a python interpreter window, or having that line inside a python file and trying to execute that python file. If you want to integrate pyotdr inside your program, that is a different matter altogether.
Hi! Due to work issues I'm learning to use Python. I have installed pyotdr as you wrote on the main page. However, I can't parse any file as you say here: "To parse an OTDR SOR file, run the program as pyotdr myfile.sor" The console show me an error -> ### SyntaxError: invalid syntax Could you tell me how I could make correct use of it?