Thank you Peter for your example. I have the code working now and will post
soon for eveyones benefit.
Thank you all who took the time to help.
Bo
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.pyt
Bo Morris wrote:
> Thank you all for the helpful criticism. I wish I was able to catch on to
> what you are suggesting more quickly.
>
> Based on your recommendations, I have come up with the following so far,
> however I just dont see it as easily as I did while using the if/elif
> statements.
>
Thank you all for the helpful criticism. I wish I was able to catch on to
what you are suggesting more quickly.
Based on your recommendations, I have come up with the following so far,
however I just dont see it as easily as I did while using the if/elif
statements.
This is what I have so far. I
out = stdout.read()
if '3102EHD-Lanka-1108' in out:
s.exec_command('export DISPLAY=:0.0; cd /Downloads/Hourly/win.sh')
sftp = s.open_sftp()
sftp.get('/Downloads/Hourly/3102EHD-01108/3102EHD-01108.png',
'/Downloads/Hourly/3102EHD-01108.png')
sftp.close()
print
Bo Morris wrote:
> "...Regarding your program, instead of writing long sequences of
> repetitive if
> conditions, I would write one function for each of the different
> operations and store them in a dict, mapping each host name to a function
> (and multiple host names may map to the same function
"...Regarding your program, instead of writing long sequences of repetitive
if
conditions, I would write one function for each of the different operations
and store them in a dict, mapping each host name to a function (and
multiple host names may map to the same function). Then, look up the host
na
Bo Morris schrieb am 24.10.2014 um 14:03:
> May I please get a little instructional criticism. The code below works. It
> logs into 9 different Linux computers, runs a couple commands, and then
> transfers a file back to the server. I want to become a better Python
> coder; therefore, I was hoping