[英]How do I fix the NotImplementedError in Python?
我是一個初學者編碼,所以我對 python 了解不多,但如果你回答這個問題,將不勝感激。
這是我到目前為止所擁有的:
import turtle
def clear1():
import os
os.system('cls' if os.name == 'nt' else "printf '\033c'")
然后是一堆烏龜代碼。 然后在海龜代碼之后:
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
而且我很困惑,因為我在不同的項目中使用完全相同的算法並且它有效
鏈接到當前項目: https://repl.it/@WeirdDragon/RPS#main.py
鏈接到它工作的項目: https://repl.it/@WeirdDragon/Fortune-teller#main.py
據我所知,Skulpt 將舊的和不受支持的 Python 2.7 用於“Python(與海龜)”項目,但現代 Python 3.8 用於非海龜項目。 顯然,Skulpt 的 2.7 不支持模塊os
。 因此,您可以使用turtle
或os
,但不能同時使用兩者。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.