dwave-system icon indicating copy to clipboard operation
dwave-system copied to clipboard

Reading asymmetric TSP data from a TSPLIB file

Open rwarren13 opened this issue 4 years ago • 4 comments

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 infile = open('ftv33') FileNotFoundError: [Errno 2] No such file or directory: 'ftv33'

Alternatives Considered Tried ftv33.py, ftv33.txt and ftv33 with no . Also tried these in the open call. Same error every time

rwarren13 avatar Jun 09 '20 00:06 rwarren13

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.

rwarren13 avatar Jun 09 '20 18:06 rwarren13

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") 

akoszegi avatar Jun 11 '20 00:06 akoszegi

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

rwarren13 avatar Jun 11 '20 01:06 rwarren13

How do I reopen this

rwarren13 avatar Jun 16 '20 20:06 rwarren13

Closing as unrelated to dwave-system. If you're still having issues, I would encourage you to open an issue in our Community.

arcondello avatar Jan 26 '23 18:01 arcondello