D
D
DmitriyKaznov2015-09-23 11:30:22
Python
DmitriyKaznov, 2015-09-23 11:30:22

Python 3.5 interpreter, how to work with files?

Welcome all. A small preface - once upon a time I studied python on ubuntu and, in fact, abandoned this matter. Now, due to some circumstances, it was necessary to bring my skills at least to the basic ones. On Ubuntu, the situation was simple: create a file -> write the required code -> save -> run. Profit. At the moment I hang on Win8 and put the PYTHON 3.5 interpreter And, I'm sorry, I broke my brain. I open the interpreter, I try to create a file in order to open it and start writing in it (Maybe the interpreter is not intended for this at all? O_o), but no matter what I do, it doesn’t work for me. Of course, you can work with Visual Studio, but I'm used to not retreating in such things.
F = open('text.txt', 'w')
bb226dc4a58e49a49cbb81238c9ce68d.png
I tried to create a file and open it for editing with this request. It didn't work out. Tostorians, tell me, please. And don't scold me, please =)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Martyanov, 2015-09-23
@vilgeforce

You have clearly written that you do not have write permissions to the specified file. Judging by the screenshot, you are typing text in the interpreter, from which directory are you calling it?

D
DmitriyKaznov, 2015-09-23
@DmitriyKaznov

693da7d5f04b4f978bc279ed7307d746.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question