Re: [Tutor] Obtaining result from a sendline

2012-10-30 Thread eryksun
On Tue, Oct 30, 2012 at 9:47 PM, Dave Wilder wrote: > > However, all I get back is a numerical value. I am looking to get the > actual output from the “ls /var/tmp” That would be the number of bytes sent. > ssh = sshClient.pxssh() > ssh.login(server=ip_addr, username=user, password=pswd) > str

Re: [Tutor] running multiple concurrent processes

2012-10-30 Thread Dave Angel
On 10/30/2012 05:10 PM, richard kappler wrote: > Oscar, thanks for the link, though I must say with all due respect, if it > was "obvious" I wouldn't have had to ask the question. Good link though. I > suspect the reason I didn't find it is I did my searches under threading as > opposed to multi-pr

[Tutor] Obtaining result from a sendline

2012-10-30 Thread Dave Wilder
Okay, file this under RTFM, but even after research, I cannot figure out the answer to this simple question. When I do an ssh in python (version 2.7.3) to a device, I am trying to capture the output of the command. However, all I get back is a numerical value. I am looking to get the actual

Re: [Tutor] running multiple concurrent processes

2012-10-30 Thread Oscar Benjamin
On 30 October 2012 21:10, richard kappler wrote: > Oscar, thanks for the link, though I must say with all due respect, if it > was "obvious" I wouldn't have had to ask the question. Good link though. I > suspect the reason I didn't find it is I did my searches under threading as > opposed to multi

Re: [Tutor] changing name value with function return

2012-10-30 Thread Steven D'Aprano
On 31/10/12 03:56, richard kappler wrote: If I have a variable and send it's value to a function to be modified and returned, how do I get the function return to replace the original value of the variable? spam = function(spam) passes the value of "spam" to the function, then assigns the res

Re: [Tutor] running multiple concurrent processes

2012-10-30 Thread richard kappler
Oscar, thanks for the link, though I must say with all due respect, if it was "obvious" I wouldn't have had to ask the question. Good link though. I suspect the reason I didn't find it is I did my searches under threading as opposed to multi-processing. Dave, no offense taken, great write-up. Now

Re: [Tutor] running multiple concurrent processes

2012-10-30 Thread Dave Angel
On 10/30/2012 03:18 PM, richard kappler wrote: > As I sit through the aftermath of Sandy, I have resumed my personal quest > to learn python. One of the things I am struggling with is running multiple > processes. I read the docs on threading and am completely lost so am > turning to the most excel

Re: [Tutor] running multiple concurrent processes

2012-10-30 Thread Prasad, Ramit
richard kappler wrote: > As I sit through the aftermath of Sandy, I have resumed my personal quest to > learn python. One of the things I > am struggling with is running multiple processes. I read the docs on > threading and am completely lost so am > turning to the most excellent tutors here (an

Re: [Tutor] running multiple concurrent processes

2012-10-30 Thread Oscar Benjamin
On 30 October 2012 19:18, richard kappler wrote: > As I sit through the aftermath of Sandy, I have resumed my personal quest to > learn python. One of the things I am struggling with is running multiple > processes. I read the docs on threading and am completely lost so am turning > to the most ex

[Tutor] running multiple concurrent processes

2012-10-30 Thread richard kappler
As I sit through the aftermath of Sandy, I have resumed my personal quest to learn python. One of the things I am struggling with is running multiple processes. I read the docs on threading and am completely lost so am turning to the most excellent tutors here (and thanks for all the help, past, pr

Re: [Tutor] changing name value with function return

2012-10-30 Thread Dave Angel
On 10/30/2012 12:56 PM, richard kappler wrote: > If I have a variable and send it's value to a function to be modified and > returned, how do I get the function return to replace the original value of > the variable? > > Example: > > import random > > x = 50 > > def rndDelta(x): > d = random.un

Re: [Tutor] changing name value with function return

2012-10-30 Thread Timo
Op 30-10-12 17:56, richard kappler schreef: If I have a variable and send it's value to a function to be modified and returned, how do I get the function return to replace the original value of the variable? Example: import random x = 50 def rndDelta(x): d = random.uniform(-10, 10)

[Tutor] changing name value with function return

2012-10-30 Thread richard kappler
If I have a variable and send it's value to a function to be modified and returned, how do I get the function return to replace the original value of the variable? Example: import random x = 50 def rndDelta(x): d = random.uniform(-10, 10) x = x + d return x When I call rndDelta, it