簡體   English   中英

Python stdin請求在stdout打印之前到來

[英]Python stdin request coming before stdout prints

我最近一直在嘗試學習Python 3.3並遇到問題。 這是我正在使用的測試代碼:

print('should print before stdin')
x = raw_input('Enter something: ')

這是輸出的樣子:

>>something
should print before stdin
Enter something:

為什么打印語句在標准輸入之后?

在Python 3.X中,已刪除了raw_input("") ,因此請使用input() 請參閱此文檔

print('should print before stdin')
x = input('Enter something: ')

產量

should print before stdin
Enter something: yes

Process finished with exit code 0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM