Re: [Tutor] Talking between C++ & Python ?

2007-04-05 Thread R. Alan Monroe
> I have written a Python app, a company who don't use Python want to integrate > its back end with their C++ coded GUI. > At the moment they are proposing using CSV files to communicate between the > Python & C++, ie C++ GUI generates a CSV, calls Python back end, back end > does the work and

[Tutor] UnicodeDecodeError in kinterbasdb

2007-04-05 Thread Andy Koch
Hello, I've installed Python 25 on an XP machine, installed kinterbasdb (and eginix-mx-base). Python works fine. However, when I try to load the firebird module in IDLE I get ... Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "cr

[Tutor] beautifulSoup and .next iteration

2007-04-05 Thread Jon Crump
As a complete tyro, I've broken my teeth on this web-page scraping problem. I've several times wanted to scrape pages in which the only identifying elements are positional rather than syntactical, that is, pages in which everything's a sibling and there's no way to predict how many sibs there a

Re: [Tutor] Question about exception

2007-04-05 Thread Mike Hansen
> If the Exception is defined as a class, e will be an instance of > that class so you can have pretty much anything available: > > class MyException(Exception): > def __init__(self, msg, mylist) > self.msg = msg > self.mylist = mylist > Exception.__init__(self, msg) >

Re: [Tutor] Question about exception

2007-04-05 Thread Bill Campbell
On Thu, Apr 05, 2007, Mike Hansen wrote: >When doing a try/except block, is it possible to return a list as part >of the exception? > >try: >check_someting() >except CheckSomethingError, e: >for each_error in e: > # do something > >Can 'e' be a list of errors? If so, how do you constr

[Tutor] Question about exception

2007-04-05 Thread Mike Hansen
When doing a try/except block, is it possible to return a list as part of the exception? try: check_someting() except CheckSomethingError, e: for each_error in e: # do something Can 'e' be a list of errors? If so, how do you construct your exception class? Is it better to do it l

[Tutor] question about gui tool-kits

2007-04-05 Thread shawn bright
lo there all, i have been working with pygtk2 for a while now, and, though i do like the look and feel of a GTK2 app, i would like to do some stuff with wx. I know, it doesn't look as cool, but , i may have need to work on something that i can port to a windows box, and i think that wx would be a

Re: [Tutor] Talking between C++ & Python ?

2007-04-05 Thread Dave S
On Thursday 05 April 2007 18:54, Alan Gauld wrote: > "Dave S" <[EMAIL PROTECTED]> wrote > > > At the moment they are proposing using CSV files to communicate > > between the > > Python & C++, ie C++ GUI generates a CSV, calls Python back end, > > back end > > does the work and generates return CSV,

Re: [Tutor] Talking between C++ & Python ?

2007-04-05 Thread Alan Gauld
"Dave S" <[EMAIL PROTECTED]> wrote > At the moment they are proposing using CSV files to communicate > between the > Python & C++, ie C++ GUI generates a CSV, calls Python back end, > back end > does the work and generates return CSV, Python exits back to C++. > > This would work but seems a bi

[Tutor] Talking between C++ & Python ?

2007-04-05 Thread Dave S
Hi all, I have written a Python app, a company who don't use Python want to integrate its back end with their C++ coded GUI. At the moment they are proposing using CSV files to communicate between the Python & C++, ie C++ GUI generates a CSV, calls Python back end, back end does the work and g

Re: [Tutor] Tutor Digest, Vol 38, Issue 2

2007-04-05 Thread Rikard Bosnjakovic
Jay, PLEASE shorten your posts by removing all unnecessary quoting. On 4/5/07, Jay Mutter III <[EMAIL PROTECTED]> wrote: > Whether I attempt to just strip the string or attempt to > > if line.endswith('No.\r'): > line = line.rstrip() > > It doesn't work. That's because you assume the linef

Re: [Tutor] where to look for help with modbus TCP/IP

2007-04-05 Thread Kent Johnson
Jeff Peery wrote: > hello, I want to use python to communicate (pluck data out of registers) > with a controller (walchem, > http://www.walchem.com/nav/CMImage.aspx?CMID=0&Name=180277_Modbus_C.pdf). > I found great documentation using python sockets and TCP/IP; however I > am very unfamiliar wi

Re: [Tutor] Tutor Digest, Vol 38, Issue 2

2007-04-05 Thread Alan Gauld
"Jay Mutter III" <[EMAIL PROTECTED]> wrote > Whether I attempt to just strip the string or attempt to > > if line.endswith('No.\r'): > line = line.rstrip() > > It doesn't work. Can you try printing the string repr just before the test. Or even the last 6 characters: print repr(line[-6:

Re: [Tutor] where to look for help with modbus TCP/IP

2007-04-05 Thread Alan Gauld
"Jeff Peery" <[EMAIL PROTECTED]> wrote > sockets and TCP/IP; however I am very unfamiliar with > modbus and how modbus TCP/IP is related to TCP/IP. I've learned never to say never on this list but this isn't really a novice type thing so you might get better results asking on the main comp.

Re: [Tutor] Newbie question concerning text covering multiple lines

2007-04-05 Thread Kent Johnson
Guba Castro wrote: > The links you sent me are helpful, many thanks for that. Maybe there is > another site you might be able to recommend to me: what I want to do > with Python in primarily (Linux) scripting. Any ideas? What do you mean by "Linux scripting"? If you want to work with files and d

[Tutor] where to look for help with modbus TCP/IP

2007-04-05 Thread Jeff Peery
hello, I want to use python to communicate (pluck data out of registers) with a controller (walchem, http://www.walchem.com/nav/CMImage.aspx?CMID=0&Name=180277_Modbus_C.pdf). I found great documentation using python sockets and TCP/IP; however I am very unfamiliar with modbus and how modbus TCP

Re: [Tutor] windows and python and shebangs, oh my!

2007-04-05 Thread John Clark
Be aware that by default the Apache web server _WILL_ use the shebang line even when running on Windows to try to find the Python interpreter when python is run as a CGI script. There is a setting in the configuration file that controls whether to use the shebang line or to reference the window

Re: [Tutor] Tutor Digest, Vol 38, Issue 2

2007-04-05 Thread Jay Mutter III
> > > Message: 3 > Date: Sun, 1 Apr 2007 16:42:56 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Tutor Digest, Vol 38, Issue 1 > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=original

Re: [Tutor] Newbie question concerning text covering multiple lines

2007-04-05 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > Several good beginners tutorials are listed here: > http://wiki.python.org/moin/BeginnersGuide/NonProgrammers But very few of them will have been updated to reflect changes in 2.5. My own tutor is accurate for 2.3. This is precisely because, as Kent sai

Re: [Tutor] windows and python and shebangs, oh my!

2007-04-05 Thread Alan Gauld
"Kirk Bailey" <[EMAIL PROTECTED]> wrote > OK, in a script, we include a special statement telling the shell > where > to go find the interpeter. This is the first line of the script, and > is > a dpecial sort of comment, called informally the shebang. Yes, but it is not a Python feature it is a