Telnetlib to twisted

2006-10-27 Thread Matthew Warren
Hallo, >>> import telnetlib >>> l=telnetlib.Telnet('dbprod') >>> l.interact() telnet (dbprod) Login: Could anyone show how the above would be written using the twisted framework? All I'm after is a more 'intelligent' interactive telnet session (handles 'vi' etc..) rather than the full capabilit

RE: [Tutor] How to get the width of teh button widget..??

2006-10-20 Thread Matthew Warren
    Folks,   Sorry for asking you such a trivial question.!!! But i want to size up all the buttons with the same size as the largest one in the interface.. And thats why I am asking this question..   Regards, Asrarahmed      Hi Asrarahmed.  I think, from yo

RE: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Fredrik Lundh > Sent: 20 October 2006 06:43 > To: python-list@python.org > Subject: Re: Tkinter--does anyone use it for sophisticated > GUI development? > > Kevin Walzer wrote: > > > Comi

RE: making a valid file name...

2006-10-18 Thread Matthew Warren
> > Hi I'm writing a python script that creates directories from user > input. > Sometimes the user inputs characters that aren't valid > characters for a > file or directory name. > Here are the characters that I consider to be valid characters... > > valid = > ':./,^0123456789abcdefghijklmno

RE: Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
> break > else: > _DoThingsToTree(path[1:],value,item[path[0]],delete) > The '_' in front of DoThingsToTree shouldn't be there. That's what I get for trimming off the '_' elsewhere after I pasted the code in. Matt. This email is confidential and

Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
Hallo people, I have the following code that implements a simple recursive tree like structure. The trouble is with the GetTreeBranch function, the print statement prints a valid value but the return immediatley afterward doesn't return anything. Can anyone help me with why? Thanks, Matt. Co

RE: Any idea how to do this in Python?

2006-10-17 Thread Matthew Warren
> On 17 Oct 2006 02:56:45 -0700, Lad <[EMAIL PROTECTED]> wrote: > > > > Dennis, > > Thank you for your reply > > You say: > > >Pretend you are the computer/application/etc. How would YOU > > > perform such a ranking? > > That is what I do not know , how to perform such ranking. > > Do you have any

RE: Bad Code (that works) help me re-write!

2006-10-11 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Giles Brown > Sent: 11 October 2006 12:38 > To: python-list@python.org > Subject: Re: Bad Code (that works) help me re-write! > > Matthew Warren wrote: >

Bad Code (that works) help me re-write!

2006-10-11 Thread Matthew Warren
I have the following piece of code, taken from a bigger module, that even as I was writing I _knew_ there were better ways of doing it, using a parser or somesuch at least, but learning how wasn't as fun as coding it... And yes alarm bells went off when I found myself typing eval(), and I'm sure th

Using twisted, not telnetlib for interactive telnet (WAS: RE: Improving telnetlib)

2006-10-06 Thread Matthew Warren
> >The trouble is, I havent got a clue where to start and would > appreciate > >a couple of pointers to get me going... > > > > I'd suggest taking a look at Twisted, which contains a more complete > telnet implementation (not as important for being able to launch vi), > an ssh implementation (

RE: building strings from variables

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Gal Diskin > Sent: 05 October 2006 16:01 > To: python-list@python.org > Subject: building strings from variables > > Following a discussion with an associate at work about various ways to > b

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Giovanni Bajo > Sent: 04 October 2006 15:17 > To: python-list@python.org > Subject: Re: dictionary of list from a file > > [EMAIL PROTECTED] wrote: > > > while(){ > > @info=split

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -> > Python 2.5 introduced a dictionary type with automatic > > creation of values, > > ala Perl: > > > > === > > from collections import defaultdict > > > > d = defaultdict(list) > > for line in fl: > > k, v = line.strip().split() > > d[k].append(v

RE: Why do this?

2006-10-05 Thread Matthew Warren
> [Matthew Warren] > > | Blame outlook and AutoCaps. If number were a number I would write > | > | print "There are",number,"ways to skin a "+furryanimal > > You see now that strikes me as a bit mixed up. Why not simply use? > > print "a"

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Duncan Booth wrote: > > > print "There are"+number+"ways to skin a"+furryanimal > > > > or at least something equivalent to it. If I try to make > the same mistake > > with a format string it jumps out to me as wrong: > > > > "There are%sways to skin a%s" % (number, furryanimal) > > Relate

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Also, having a variable of type str called 'number' seems > perverse (and > probably error prone), so I suspect I might need something like: > And not something I would normally do, but for hastily written contrived examples I might :) >print "There are "+str(number)+" ways to skin a "

RE: Why do this?

2006-10-05 Thread Matthew Warren
> > | Now, I started programming when I was 8 with BBC Basic. > > Hey, likewise! (Except I was 12 when it came out!) I think it came out before I was 8, and I started out with print and input. Not sure if that's 'real' programming - I don't think I graduated to ifs and thens and gotos and gosubs

Why do this?

2006-10-05 Thread Matthew Warren
Ok, not really python focused, but it feels like the people here could explain it for me :) Now, I started programming when I was 8 with BBC Basic. I never took any formal classes however, and I have never become an expert programmer. I'm an average/hobbyist programmer with quite a few languages

RE: Raw strings and escaping

2006-10-04 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Scott David Daniels > Sent: 03 October 2006 18:11 > To: python-list@python.org > Subject: Re: Raw strings and escaping > > Matthew Warren wrote: > >

Improving telnetlib

2006-10-04 Thread Matthew Warren
Hi, I use telnetlib in an app I am writing, and would like to add functionality to it to support interactive terminal sessions , IE: be able to 'vi' a file. Currently it seems telnetlib isnt quite sophisticated enoguh to support such a thing. The trouble is, I havent got a clue where to start

RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Matthew Warren > Sent: 03 October 2006 16:07 > To: python-list@python.org > Subject: RE: Escapeism > > > > > -Original Message- > &

RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Kay Schluehr > Sent: 30 September 2006 18:02 > To: python-list@python.org > Subject: Re: Escapeism > > Sybren Stuvel wrote: > > Kay Schluehr enlightened us with: > > > Usually I struggle a

Raw strings and escaping

2006-10-03 Thread Matthew Warren
Hi, I would expect this to work, rawstring=r'some things\new things\some other things\' But it fails as the last backslash escapes the single quote. ..although writing this I think I have solved my own problem. Is \' the only thing escaped in a raw string so you can place ' in a raw string? Alt

RE: Making sure script only runs once instance at a time.

2006-09-30 Thread Matthew Warren
Apologies for repost. not sure what happened.   This email is confidential and may be privileged. If you are not the intended recipient please notify the sender immediately and delete the email from your computer. You should not copy the email, use it for any purpose or disclose its contents

RE: Making sure script only runs once instance at a time.

2006-09-29 Thread Matthew Warren
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hari SekhonSent: 29 September 2006 14:55To: python-list@python.orgSubject: Re: Making sure script only runs once instance at a time. I'm not sure if that is a very old way of doing it, which is why I wa

RE: Problems with Python 2.5 installer.

2006-09-29 Thread Matthew Warren
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of paw Sent: 29 September 2006 11:01 To: python-list@python.org Subject: Re: Problems with Python 2.5 installer. John Machin wrote: > paw wrote: > > I have ran the MSI installer for Python 2.5 several times at

BoaConstructor

2006-09-29 Thread Matthew Warren
..I'm just about to start a project, I have a threaded python app currently around 3000 lines / 12-15 source files that is cli driven, and I am about to start using boaConstructor to build a GUI around it.   Has anyone here any advice on wether boaConstructor is actually a good tool for this