Ask coding questions

← Back to all posts
open_file_test- repl don't write on my text file
OfirLiron (8)

https://repl.it/@OfirLiron/write1

Hi i am trying to write text file with repl. there is error messege, and I can see the files open under the files section, but nothing happens?
what can I do?

Commentshotnewtop
a5rocks (732)

What do you mean "nothing happens"? I can see the written file contents, what more do you expect the program to do?

OfirLiron (8)

@a5rocks
Thanks, well I expected it will change the file on my computer

SixBeeps (1410)

I'm guessing that you're expecting the files on your own computer to be changed. That will not work, though, because Repl.it is a website and not a program so you are unable to edit local files.

OfirLiron (8)

Thank you all for responding,
Yes I mean that the files on my computer remains untouched. so what python repl does, it looks if there is path in my computer with the specified name, and if so build file with the same name on repl and work on it??

SixBeeps (1410)

@OfirLiron No, Repl.it is not allowed to touch your computer's files. If it were allowed to do that, people could write code to delete every single file on your computer, so it is blocked from accessing your local files.
What Repl.it does instead is it runs your code on its own computer, which runs linux. If you want to run it on your computer instead, you can do so by installing Python on your local machine and downloading your code from Repl.it (people have already asked how to do this, so just search the Ask board for how to do this)

ash15khng (575)

The program works? There's no print statement so the console is empty. The files get edited correctly too.

OfirLiron (8)

@ash15khng
What do you mean by empty console? can you give example for print that will fill it so I can understand your point?

ash15khng (575)

@OfirLiron Just put a print statement at the end of the code to check if the whole thing runs.