Multiple lines user input in command-line Python application

前端 未结 3 1312
清歌不尽
清歌不尽 2021-01-05 13:30

Is there any easy way to handle multiple lines user input in command-line Python application?

I was looking for an answer without any result, becaus

3条回答
  •  猫巷女王i
    2021-01-05 14:26

    Use :

    input = raw_input("Enter text")

    These gets in input as a string all the input. So if you paste a whole text, all of it will be in the input variable.

    EDIT: Apparently, this works only with Python Shell on Windows.

提交回复
热议问题