Browse code

PYthonscript hinzugefügt. Leere Scriptdatei entfernt.

dewomser authored on28/12/2019 15:31:39
Showing2 changed files

1 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
- 
2 0
new file mode 100644
... ...
@@ -0,0 +1,32 @@
1
+#! /usr/bin/env python
2
+# -*- coding: utf-8 -*-
3
+# vi:ts=4:et
4
+from Tkinter import *
5
+import pycurl
6
+try:
7
+    from io import BytesIO
8
+except ImportError:
9
+    from StringIO import StringIO as BytesIO
10
+
11
+buffer = BytesIO()
12
+c = pycurl.Curl()
13
+c.setopt(c.URL, 'http://192.168.1.6')
14
+c.setopt(c.WRITEDATA, buffer)
15
+# For older PycURL versions:
16
+#c.setopt(c.WRITEFUNCTION, buffer.write)
17
+c.perform()
18
+c.close()
19
+
20
+body = buffer.getvalue()
21
+# Body is a string on Python 2 and a byte string on Python 3.
22
+# If we know the encoding, we can always decode the body and
23
+# end up with a Unicode string.
24
+#print(body.decode('iso-8859-1'))
25
+
26
+
27
+root = Tk()
28
+
29
+w = Label(root, text= body.decode('iso-8859-1'), padx = 40, pady = 40)
30
+w.pack()
31
+
32
+root.mainloop()