How do I use raw_input in Python 3

后端 未结 8 2540
旧时难觅i
旧时难觅i 2020-11-22 01:39
import sys
print(sys.platform)
print(2**100)
raw_input()

I am using Python 3.1 and can\'t get the raw_input to \"freeze\" the dos pop-

8条回答
  •  执笔经年
    2020-11-22 02:29

    Probably not the best solution, but before I came here I just made this on the fly to keep working without having a quick break from study.

    def raw_input(x):
      input(x)
    

    Then when I run raw_input('Enter your first name: ') on the script I was working on, it captures it as does input() would.

    There may be a reason not to do this, that I haven't come across yet!

提交回复
热议问题