Submit templates for repl.it/templates here.

← Back to all posts
OS Template for Jam
h
JordanDixon1 (324)

This is a Template of the OS module in python. It will teach you how to use OS and the many things you can do with it! If you have any questions leave a comment and I'll see if I can answer. Thanks!

Commentshotnewtop
KobeFF (432)

um... there's an error. check your code:

Saves file.txt main.py Hello./home/runner/1xpoel2ynyt Traceback (most recent call last): File "main.py", line 14, in <module> os.mkdir("Saves") FileExistsError: [Errno 17] File exists: 'Saves' 

JordanDixon1 (324)

@KobeFF Should be fixed now. The error was due to the directory already being created. All you have to do to fix that is to delete the directory "Saves". I will be adding more code to fix this problem by adding a try, except area before it tries making the directory. Thanks for letting me know.

KobeFF (432)

@KobeFF Wait, there's another error...
Traceback (most recent call last): File "main.py", line 28, in <module> os.chdir("/home/runner/Template-Challenge/Saves") FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/Template-Challenge/Saves'

JordanDixon1 (324)

@KobeFF That's weird... I'm not getting that...

JordanDixon1 (324)

@JordanDixon1 okay, I think I might have fixed it. I tried removing the directory and then changing to it. (face palm)

KobeFF (432)

@JordanDixon1 Hmmm.. Same error...

file.txt main.py Hello./home/runner/erl7ccm8kk Traceback (most recent call last): File "main.py", line 28, in <module> os.chdir("/home/runner/Template-Challenge/Saves") FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/Template-Challenge/Saves

`

JordanDixon1 (324)

@KobeFF Are you running it "as-is" or are you forking it?

JordanDixon1 (324)

@KobeFF hmmm... That is very weird...

JordanDixon1 (324)

@KobeFF whenever I run it I get the expected: Y33THello World (an os)!