Python版本和库

2024-03-28 11:40:23 发布

您现在位置:Python中文网/ 问答频道 /正文

对于我申请的实习,我已经完成了一项任务,那就是创建一个2048克隆。我的solution在这里找到。简报说:

Use either Python 2.7 or 3+ and if any 3rd party libraries are used add them in a requirements file parsable by pip. The game should be started by invoking the main file: python main.py

我只是想问一下,确保当我把它寄给他们的时候一切都能正常工作。我使用了以下导入:

from msvcrt import getch
import random
from copy import deepcopy

我需要在文件夹中添加任何内容才能使这些工作正常吗?我需要确保它能正确地为他们打印,因为我在不同的电脑上试过,打印语句的作用不同,我不确定为什么


Tags: orandfromimportlibrariesbyifuse
2条回答

您只需要向requirements.txt添加不属于标准库的内容

msvcrtrandomcopy都是Python标准库的一部分,不需要添加

不,您根本不需要创建任何类型的需求文件,因为mscvrtrandomcopy模块是python标准库的一部分。但是,mscvrt模块仅在windows上可用

相关问题 更多 >