Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
代码:
self.write("<html><head></head>"+ <body><h1>You are now logged out.</h1></body></html>") sleep(1)
的内容self.write()将在 1 秒后打印出来,这不是我想要的。我希望首先将内容打印到屏幕上。为什么sleep()要先执行,我怎样才能self.write先执行?
self.write()
sleep()
self.write
基本的 HTML 会话?
一切都是按照这个顺序运行的。而且由于连接在完成之前不会关闭sleep(),因此您将看不到数据。