dwave-system
dwave-system copied to clipboard
Reading asymmetric TSP data from a TSPLIB file
Current Problem
Placed file ftv33 from the TSPLIB in directory that contains ‘read’ script. ‘Read’ script has a line
infile = open(ftv33)
Error is:
File "C:\Users\PSU Brandywine\my_env\myScripts\Test5Copy1.py", line 5, in
Alternatives Considered Tried ftv33.py, ftv33.txt and ftv33 with no . Also tried these in the open call. Same error every time
Issue is not attaching ftv33 to the directory that contains the 'read' script. This has been done. Issue is opening ftv33 so its data can be read.
Do either of these work for you?
# You have to add the file extension, whether that's .txt, .atsp, or something else
infile = open(r"ftv33.txt")
# You may also need to specify the path to the file. On Windows that might look something like this
infile = open(r"C:\Users\username\Documents\Projects\TSP\ftv33.txt")
I have tried the suggestions from akoszegi. They work in IDLE, but not in a Command Prompt. Something deeper prevents a file from opening in a Command Prompt. Richard Warren
How do I reopen this
Closing as unrelated to dwave-system
. If you're still having issues, I would encourage you to open an issue in our Community.