How do I fix the NotImplementedError in Python?

2.6k views Asked by At

I am a beginner coding so I don't know a lot about python, but if you answered this it would be much appreciated.

This is what I have so far:

import turtle
def clear1():
  import os
  os.system('cls' if os.name == 'nt' else "printf '\033c'")

then a bunch of turtle code. Then after the turtle code:

choice = input("Want to get started? ")
while choice == "yes" or choice == "Yes":
  clear1()

Output:

NotImplementedError: os is not yet implemented in Skulpt on line 1

And I am very confused because I use the exact same algorithm in a different project and it works

Link to current project: https://repl.it/@WeirdDragon/RPS#main.py

Link to project it worked on: https://repl.it/@WeirdDragon/Fortune-teller#main.py

1

There are 1 answers

4
DYZ On

From what I can tell, Skulpt uses old and unsupported Python 2.7 for "Python (with turtle)" projects but modern Python 3.8 for non-turtle projects. Apparently, Skulpt's 2.7 does not support the module os. So, you can use either turtle or os but not both.