0

I wrote the next program:

with open('h.txt','a') as f:
    f.write('asd')

when i run it from the cmd (e.g typed C:\Users\USER\PycharmProjects\2016_project\test.py in the cmd) - no new file was created

but when I double clicked the icon in the windows explorer (I'm with windows (10)) a new text file was created

can someone explain to me what's happening?? and how to bypass this problem?

(p.s. I'm most of the time in school so it may take me a little time to responce) thanks

1 Answer 1

1

Choose the folder and use Python to run. Use like:

cd C:\Users\USER\PycharmProjects\2016_project
python test.py
Sign up to request clarification or add additional context in comments.

2 Comments

(the problem was that the new files where created - but in the current dir the cmd was in...)
@hai tederry, most likely, the file is in the root of drive C:. Run files like I showed or you need to use full path

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.