简体   繁体   English

如何将 replit 模块导入 python?

[英]how do I import replit module to python?

I made a blackjack game and a calculator following an online tutorial, however the only tutorial used replit module (from replit import clear -> clear() ) (replit being the website/online interpreter).我按照在线教程制作了二十一点游戏和计算器,但是唯一的教程使用了 replit 模块(来自 replit import clear -> clear() )(replit 是网站/在线解释器)。 I am now trying the same program in vscode:我现在在 vscode 中尝试相同的程序:

  1. is there a way to import replit to vscode?有没有办法将replit导入vscode?
  2. is there a similar module to get the same result?是否有类似的模块可以获得相同的结果? I have seen some people make suggestions to clear console but they all seem to depend on which OS I am running, since my desktop is windows and laptop is mac I want something that can work on both.我见过一些人提出清除控制台的建议,但他们似乎都取决于我正在运行的操作系统,因为我的桌面是 windows 而笔记本电脑是 mac 我想要一些可以在两者上运行的东西。

Did you try "import os" at the beginning of code and using "os.system('clear')"?您是否在代码开头尝试过“import os”并使用“os.system('clear')”? This should work on any OS or code editor/IDE.这应该适用于任何操作系统或代码编辑器/IDE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM