Re: [Tutor] Tkinter and threading

2016-06-02 Thread Marco Soldavini
Thanks for you answers! On Thu, Jun 2, 2016 at 6:39 PM, Peter Otten <__pete...@web.de> wrote: >> For example a state machine with a var state which can have some >> discrete string values (like RUNNING, STOPPED, PAUSED, ABORTED, IDLE) >> and a text element on the gui that reports that state. >> >

[Tutor] Tkinter and threading

2016-06-02 Thread Marco Soldavini
Hello, probably this is a very naive question, but I've read some stuff on Tkinter and its infinite loop. Then about how can i bind actions to elements, for example buttons. What if I want to run another loop beside the graphical interface in the same python script? For example a state machine w

[Tutor] XML and ElementTree

2016-04-25 Thread Marco Soldavini
I've a few questions about parsing XML. I wrote some code that works but I want to know which are the most intelligent data structures to parse data to Consider that my XML file is something like the following: 1 XXX .

Re: [Tutor] ImportError: No module named...

2016-04-18 Thread Marco Soldavini
Yeah, I spotted the mistake. There was a file left in the folder named reportlab.pyc which I could not see from the pycharm interface. Thanks! On Mon, Apr 18, 2016 at 1:47 AM, Danny Yoo wrote: > >> But I get the following error code on line 1 >> >> ImportError: No module named pdfgen >> > > Is r

[Tutor] ImportError: No module named...

2016-04-17 Thread Marco Soldavini
I am running this configuration Win7 64 bit Python 2.7.9 PyCharm Community Edition 4.5.4 Reportlab-2.8.win32-py2.7 I am try to running this simple example code from reportlab.pdfgen import canvas from reportlab.platypus import Image im = Image ("logo.jpg") c = canvas.Canvas("hello.pdf") c.drawS

Re: [Tutor] Hello! Questions

2016-02-19 Thread Marco Soldavini
On Fri, Feb 19, 2016 at 3:32 PM, Peter Otten <__pete...@web.de> wrote: > > > Also, after reading http://openopc.sourceforge.net/api.html I wonder if it > wouldn't be better to go with the timestamp provided by the server > > bool1.append(opc.read(".watchdog")) > yes but my next

Re: [Tutor] Hello! Questions

2016-02-19 Thread Marco Soldavini
Sorry, Here my code in plaintext #While loop - scanning and storing OPC values at scan rate while (abort == 0):     # ESC pressed?     if msvcrt.kbhit() and ord(msvcrt.getch()) == 27:         abort = 1         break     # Server up     if opc.ping():         if opc['.run_batch'] == True and re

Re: [Tutor] Hello! Questions

2016-02-18 Thread Marco Soldavini
On Wed, Feb 17, 2016 at 11:13 AM, Alan Gauld wrote: > > My first question is about data types, data structures in general and how > > to organize an efficient loop for recording data. > > > while (stop condition false) > >read data > >write data into local array or something > >wait

[Tutor] Hello! Questions

2016-02-17 Thread Marco Soldavini
Hi, I am almost new to python and I am trying to build a not so easy app (but very neat and useful) related to industrial automation. Is this the right place to knock down problems one by one? Basically my app has several interactions but the most important is reading values from an embedded machi

[Tutor] Hello! Questions

2016-02-17 Thread Marco Soldavini
I hit the send button too early. anyway Basically something like while (stop condition false) read data write data into local array or something wait sample time Thanks marco ___ Tutor maillist - Tutor@python.org To unsubscribe or change