Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Tkinter/py2app程序,使用服务器查看来自另一台计算机的数据_Python_Tkinter_Py2app - Fatal编程技术网

Python Tkinter/py2app程序,使用服务器查看来自另一台计算机的数据

Python Tkinter/py2app程序,使用服务器查看来自另一台计算机的数据,python,tkinter,py2app,Python,Tkinter,Py2app,我制作了一个tkinter程序,然后使用py2app将其转换为一个独立的应用程序。现在我希望把它带到下一个层次。我在家里的另一台电脑上安装了这个应用程序,我想知道是否有办法将这两台电脑连接起来,并能够在另一台电脑上访问输入的数据 例如,如果我有以下代码: counter = 0 def buttonPushed() global counter counter += 1 myButton = Button(window, text="enter", command=buttonPu

我制作了一个tkinter程序,然后使用py2app将其转换为一个独立的应用程序。现在我希望把它带到下一个层次。我在家里的另一台电脑上安装了这个应用程序,我想知道是否有办法将这两台电脑连接起来,并能够在另一台电脑上访问输入的数据

例如,如果我有以下代码:

counter = 0
def buttonPushed()
   global counter
   counter += 1

myButton = Button(window, text="enter", command=buttonPushed())
myLabel = Label(window, text= str(counter))
我希望能够从另一台计算机上访问在一台计算机上相同的计数器

我对tkinter和软件开发还很陌生,所以我不知道该怎么做。我需要用某种服务器连接这两者吗?如果是这样,我该怎么做


同样,两台计算机都在同一个网络上。

您可以使用TCP套接字。是的,这是有意义的,但我如何设置它?您可以浏览此页。谢谢。此页非常有用。那么我需要将另一台计算机设置为客户端吗?那么我怎样才能在tkinter程序上看到一台计算机上的数据呢?是的,你需要以客户机的身份运行,你可以在tkinter程序中添加客户机部分并从服务器读取数据。你可以使用TCP套接字。是的,这很有意义,但我如何设置呢?你可以浏览这一页谢谢这一页非常有用。那么我需要将另一台计算机设置为客户端吗?那么我怎样才能在tkinter程序中看到一台计算机上的数据呢?是的,您需要以客户机身份运行,您可以在tkinter程序中添加客户机部分,并从服务器读取数据