[Tutor] PLC communication with python?

2006-03-07 Thread Jeff Peery
Hello, I would like to write a python script that communicates with a PLC (programmable logic controller) as well as instruments like calipers and things. I'm completely in the dark here and not sure where to start reading and learning. could someone point me in the right direction for learning

Re: [Tutor] [OT] Shells

2006-03-07 Thread Simon Gerber
> It looks promising, although without good command line editing and the > ability to create active GUIs it will be limited. But then, you can't do GUIs > in > bash either... There's always Zenity. Which of course isn't a built in part of the Bash shell. But it does allow you to create simple GUI

Re: [Tutor] search and replace

2006-03-07 Thread Danny Yoo
> > Slightly more robust is the '\b' boundary assertion pattern: > > And I never understood why there were two... > > Which begs the question: under what circumstance would we prefer > to use \W instead of \b? In terms of code: ## >>> import re >>> re.search(r'(\W\w+\W)', 'hello|||').gro

Re: [Tutor] search and replace

2006-03-07 Thread Alan Gauld
>> Specifically \W signifies a word boundary so >> > Using the non-word pattern '\W' will work except in cases where we're > right at the edge: Sneaky! I didn't know that... > Slightly more robust is the '\b' boundary assertion pattern: And I never understood why there were two... Which begs th

Re: [Tutor] search and replace

2006-03-07 Thread Danny Yoo
> regex allows us to specify certain conditions in the patterns > such as whether the characters are digits etc, and also whether > we are kooking for a word which is wat you want. > Specifically \W signifies a word boundary so > > \Whello\W > > will find hello as a word. Hi Alan, Using the non-

[Tutor] saving .csv file as an xl worksheet

2006-03-07 Thread János Juhász
Hi, last week I had to make a simple solution to convert prn file to excel. It seems to be very similar. I just wondered how easy to create an xml file that can be opened with excel. It can have functions, autofilters, format descriptions. It is about 100 times faster to create than on the win32co

[Tutor] Re: [Tutor] Functions and random buttons

2006-03-07 Thread Simon Stoltze
What I meant was that I wanted a command for each button, wich would set it to True, but I was having problems with passing the button name to the function. But your email answers my problem, thanks.-Oprindelig mail-Fra: Alan GauldDato: 7. marts 2006 10:42:00Til: "Simon Stoltze" [EMAIL PROT

Re: [Tutor] after signal handler

2006-03-07 Thread Hameed U. Khan
On 3/6/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Mon, 6 Mar 2006, Hameed U. Khan wrote: > > > I want to go back after signal handler to the isntruction where I was > > stuck. Below is the code I'm trying to play with. > > Hi Hameed, > > Here's a small test program that shows that the signa

Re: [Tutor] how to write a string into a specific line in a file

2006-03-07 Thread Alan Gauld
> I was wondering if it is possible to write a string to a specific line > in a file without reading in the whole file in as the below. Some languages, such as COBOL and some BASICs etc support random access files, unfortunately Python doesn't (Although I'll be amazed if somebody hasn't cooked u

Re: [Tutor] how to write a string into a specific line in a file

2006-03-07 Thread tak
Sorry, I meant lines in line in the below: f = open(filename) lines = f.readlines() f.close() # num for some line number >>lines[num] = "String" f = open(filename) f.writelines(lines) f.close() *** Hello, I was wondering if it is

[Tutor] how to write a string into a specific line in a file

2006-03-07 Thread tak
Hello, I was wondering if it is possible to write a string to a specific line in a file without reading in the whole file in as the below. ___ f = open(filename) lines = f.readlines() f.close() # num for some line number line[num] =

Re: [Tutor] [OT] Shells

2006-03-07 Thread Alan Gauld
Hi john, > Agreed --- but the new Microsoft shell looks very interesting. > Ars has a good review of it here: > http://arstechnica.com/guides/other/msh.ars Nice heads-up. I hadn't heard of this before, despite reading several of the comics' views on Vista. It looks promising, although without g

Re: [Tutor] Functions and random buttons

2006-03-07 Thread Alan Gauld
Simon, > ...I want to make each button clickable The buttons are clickable so I'm not absolutely sure what you mean? Do you mean you want to add some action to them when they are clicked? Thats done with the command option in Tkinter. define a function and assign it to the button. In this case

Re: [Tutor] search and replace

2006-03-07 Thread Alan Gauld
Hi tak, > hello, Othello. # just the hello and not Othello One simplistic approach that does not use regex is to search for spaces as part of the string. But that doesn't work for punctuation nor at the start or end of lines. So that leaves us, as you observed, with regular expressions. regex a

Re: [Tutor] search and replace

2006-03-07 Thread Danny Yoo
> I have a problem finding specific words. > I would like to filter out a word or replace it in a file. > I notices that the re module is good for finding patterns. Hi Tak, Although regular expressions might be overkill for this problem, it can't hurt to know about the Regex HOWTO: http://