From budzelaa at cc.umanitoba.ca Sat Feb 7 23:02:14 2009 From: budzelaa at cc.umanitoba.ca (budzelaa at cc.umanitoba.ca) Date: Sat, 07 Feb 2009 22:02:14 -0600 Subject: [Python Wpg] paramiko tunneling? Message-ID: <20090207220214.85rudwqi8048cc4c@webware.cc.umanitoba.ca> Hi, I am a newbie to SSH (paramiko) usage. I want to use paramiko to tunnel a TCP/IP connection over ssh, from a local machine to the same remote machine I connect to via paramiko-ssh. Forwarding?is trivial when using command-line ssh (ssh -L :localhost: ) but I can't figure out how to do it using paramiko (forwarded-tcpip?) and keep getting not very illuminating errormessages. More "normal" things like remote commands work without a hitch. Any help would be appreciated. Peter Budzelaar -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at pogma.com Sun Feb 8 11:45:11 2009 From: peter at pogma.com (Peter O'Gorman) Date: Sun, 08 Feb 2009 10:45:11 -0600 Subject: [Python Wpg] paramiko tunneling? In-Reply-To: <20090207220214.85rudwqi8048cc4c@webware.cc.umanitoba.ca> References: <20090207220214.85rudwqi8048cc4c@webware.cc.umanitoba.ca> Message-ID: <498F0C17.6050208@pogma.com> budzelaa at cc.umanitoba.ca wrote: > Hi, > > I am a newbie to SSH (paramiko) usage. I want to use paramiko to tunnel > a TCP/IP > > connection over ssh, from a local machine to the same remote machine > > I connect to via paramiko-ssh. > > Forwarding is trivial when using command-line ssh > > (ssh -L :localhost: ) > > but I can't figure out how to do it using paramiko (forwarded-tcpip?) and Does this help? http://bazaar.launchpad.net/~robey/paramiko/trunk/annotate/head%3A/demos/forward.py Peter -- Peter O'Gorman http://pogma.com From stuartw at mts.net Wed Feb 18 22:06:30 2009 From: stuartw at mts.net (Stuart Williams) Date: Wed, 18 Feb 2009 21:06:30 -0600 Subject: [Python Wpg] Last night's meeting In-Reply-To: <1233242249.17122.19.camel@localhost> References: <1233242249.17122.19.camel@localhost> Message-ID: We're only a week away with no topic. Thoughts? I may be able to give a short presentation on writing Python 2.6 code such that it works in Python 3.0, which would just be my rehash of what's been published on this topic based on my Python tutorial preparations. Stuart. On Thu, Jan 29, 2009 at 9:17 AM, Sydney Weidman wrote: > ... > As yet we have no topic for February 25th. Suggestions? From stuartw at mts.net Tue Feb 24 21:51:04 2009 From: stuartw at mts.net (Stuart Williams) Date: Tue, 24 Feb 2009 20:51:04 -0600 Subject: [Python Wpg] Last night's meeting In-Reply-To: References: <1233242249.17122.19.camel@localhost> Message-ID: I'll present on 2.6 to 3.0 suggestions, and if there's interest, possibly also on ways to understand classes better by trying to create them manually. We'll also have time for this suggestion: How about a discussion about this article by Guido about class syntax and implementation in Python: http://python-history.blogspot.com/2009/02/adding-support-for-user-defined-classes.html Stuart. On Wed, Feb 18, 2009 at 9:06 PM, Stuart Williams wrote: > We're only a week away with no topic. Thoughts? > > I may be able to give a short presentation on writing Python 2.6 code > such that it works in Python 3.0, which would just be my rehash of > what's been published on this topic based on my Python tutorial > preparations. > > Stuart. > > On Thu, Jan 29, 2009 at 9:17 AM, Sydney Weidman wrote: >> ... >> As yet we have no topic for February 25th. Suggestions? > From high.res.mike at gmail.com Tue Feb 24 23:02:21 2009 From: high.res.mike at gmail.com (Mike Pfaiffer) Date: Tue, 24 Feb 2009 22:02:21 -0600 Subject: [Python Wpg] Feb 25'th meeting In-Reply-To: References: <1233242249.17122.19.camel@localhost> Message-ID: <49A4C2CD.4050303@gmail.com> Stuart Williams wrote: > I'll present on 2.6 to 3.0 suggestions, and if there's interest, > possibly also on ways to understand classes better by trying to create > them manually. A review of classes would be great. I seem stuck in the past when it comes to programming. :-) > We'll also have time for this suggestion: > How about a discussion about this article by Guido about class > syntax and implementation in Python: > http://python-history.blogspot.com/2009/02/adding-support-for-user-defined-classes.html I'll read it before coming to the meeting tomorrow. > Stuart. Later Mike > On Wed, Feb 18, 2009 at 9:06 PM, Stuart Williams wrote: >> We're only a week away with no topic. Thoughts? >> >> I may be able to give a short presentation on writing Python 2.6 code >> such that it works in Python 3.0, which would just be my rehash of >> what's been published on this topic based on my Python tutorial >> preparations. >> >> Stuart. >> >> On Thu, Jan 29, 2009 at 9:17 AM, Sydney Weidman wrote: >>> ... >>> As yet we have no topic for February 25th. Suggestions? > _______________________________________________ > Winnipeg Python Users Group mailing list > http://WinniPUG.ca > Winnipeg at python.org > http://mail.python.org/mailman/listinfo/winnipeg > From syd at plug.ca Thu Feb 26 08:15:58 2009 From: syd at plug.ca (Sydney Weidman) Date: Thu, 26 Feb 2009 07:15:58 -0600 Subject: [Python Wpg] Swapping object attribute values Message-ID: <1235654158.9135.13.camel@localhost> I like the way you can swap the values of variables in Python by saying something like: a, b = b, a but suppose I want a function that will swap arbitrary attributes on an object. Could I code that using the tuple unpacking assignment style? I ended up doing this: def transpose(self, from_attr, to_attr): """Transpose the co-ordinates from one axis to another""" to_val = getattr(self,to_attr) setattr(self, to_attr, getattr(self, from_attr)) setattr(self, from_attr, to_val) Is there a more compact, readable way to do this? Regards, Syd From stuartw at mts.net Thu Feb 26 09:38:12 2009 From: stuartw at mts.net (Stuart Williams) Date: Thu, 26 Feb 2009 08:38:12 -0600 Subject: [Python Wpg] Swapping object attribute values In-Reply-To: <1235654158.9135.13.camel@localhost> References: <1235654158.9135.13.camel@localhost> Message-ID: Not knowing the context of your call to transpose, I wonder if instead of writing anObject.transpose('field1', 'field2') why you wouldn't just write this: anObject.field1, anObject.field2 = anObject.field2, anObject.field1 Stuart. On Thu, Feb 26, 2009 at 7:15 AM, Sydney Weidman wrote: > I like the way you can swap the values of variables in Python by saying > something like: > > a, b = b, a > > but suppose I want a function that will swap arbitrary attributes on an > object. Could I code that using the tuple unpacking assignment style? I > ended up doing this: > > def transpose(self, from_attr, to_attr): > """Transpose the co-ordinates from one axis to another""" > to_val = getattr(self,to_attr) > setattr(self, to_attr, getattr(self, from_attr)) > setattr(self, from_attr, to_val) > > Is there a more compact, readable way to do this? > > Regards, > Syd > > > _______________________________________________ > Winnipeg Python Users Group mailing list > http://WinniPUG.ca > Winnipeg at python.org > http://mail.python.org/mailman/listinfo/winnipeg > From syd at plug.ca Fri Feb 27 07:42:53 2009 From: syd at plug.ca (Sydney Weidman) Date: Fri, 27 Feb 2009 06:42:53 -0600 Subject: [Python Wpg] Swapping object attribute values In-Reply-To: References: <1235654158.9135.13.camel@localhost> Message-ID: <1235738573.6276.4.camel@localhost> On Thu, 2009-26-02 at 08:38 -0600, Stuart Williams wrote: > Not knowing the context of your call to transpose, I wonder if instead > of writing > anObject.transpose('field1', 'field2') > why you wouldn't just write this: > anObject.field1, anObject.field2 = anObject.field2, anObject.field1 > > Stuart. Probably makes more sense to do it that way. Simple is better than complex *and* Flat is better than nested. Thanks! - Syd