Python:对同一个程序使用多个pythonwindows
Python: Use multiple python windows for a same program
有没有办法让 python 程序能够打开和管理多个终端 windows?比如,在我的脚本中,打开两个 windows,当我在第一个中写一些东西时,比如 with
d = input()
它打印在第二个?我想尽可能避免使用套接字,并避免使用像 Tkinter 这样的 python GUI 库......但是如果没有其他办法没关系,请尽可能避免使用它。
谢谢
是的,你可以!!
1) 您可以将 input_output 数据保存在一个文件中,然后在另一个 python 脚本(实时)上使用它。
2) 您可以使用 multiprocessing 模块来处理多进程阅读更多信息:
https://pymotw.com/2/multiprocessing/basics.html
3) 您可以使用多线程模块来处理多线程,阅读更多信息:https://www.tutorialspoint.com/python/python_multithreading.htm
4) 您可以使用 sys 和 subprocess 模块来使用 pip 端口
有没有办法让 python 程序能够打开和管理多个终端 windows?比如,在我的脚本中,打开两个 windows,当我在第一个中写一些东西时,比如 with
d = input()
它打印在第二个?我想尽可能避免使用套接字,并避免使用像 Tkinter 这样的 python GUI 库......但是如果没有其他办法没关系,请尽可能避免使用它。 谢谢
是的,你可以!!
1) 您可以将 input_output 数据保存在一个文件中,然后在另一个 python 脚本(实时)上使用它。
2) 您可以使用 multiprocessing 模块来处理多进程阅读更多信息: https://pymotw.com/2/multiprocessing/basics.html
3) 您可以使用多线程模块来处理多线程,阅读更多信息:https://www.tutorialspoint.com/python/python_multithreading.htm
4) 您可以使用 sys 和 subprocess 模块来使用 pip 端口