0

I am running a python script from Ubuntu TLS on Windows 10. I need to save a file to a windows folder. If it do e.g. from a pandas dataframe

df.to_csv("C:\\Users\\XXXX\\Downloads\\my_file.csv")

It just creates a filename C Users XXXX Downloads myfile.csv in the same folder as my script... (on the ubuntu file system)

1 Answer 1

2

try the following

df.to_csv("/mnt/c/Users/XXXX/Downloads/my_file.csv")
Sign up to request clarification or add additional context in comments.

2 Comments

I get : FileNotFoundError: [Errno 2] No such file or directory
@smallbirds seems I missed the slash character at the beginning of the path.

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.