cbugs

在Python3中已经有很大一部分语句与Python2不互通了,运行暂停的方法也有所不同。

1、input();

    这种方法不用包含模块,因此这也是最常用的一种暂停手段。

    Python2中的raw_input()和input()语句在Python3中已经被合并到input()中。

2、os.system("pause");

    这种方法需要包含os模块(import os),在windows下IDLE运行会弹出cmd命令行,

    进行暂停操作,直接运行.py文件会直接在命令行中暂停。

3、time.sleep("second");

    这种方法需要包含time模块(import time),second是自定义的时间长短,根据实际情况,

    可能会发生上下浮动。
---------------------
原文:https://blog.csdn.net/zmz971751504/article/details/78288988

posted on 2019-06-18 21:09  bug_x  阅读(1395)  评论(0编辑  收藏  举报

分类:

技术点:

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2021-12-05
  • 2021-12-12
  • 2021-12-12
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-18
  • 2021-10-18
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2021-10-18
相关资源
相似解决方案