Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SSH Botnet??
#3
Next time, when posting your code, trying using the combination "Ctrl + Shift + V" and see if that works.

As to your questions, the second 'pxssh' is an attribute of the class pxssh and is explained here : pxssh doc

The s = pxssh.pxssh() is just a shortcut to save some keystrokes.  You will, however, rile up the villagers by using single letter variables such as 's'.  Python encourages the use of 'descriptive' names, whether it be variables, functions or classes.

As to why not make it global? A better question is "Why make it global".  Again, Python prefers you use local variables rather than global, if possible.  In this case, 's' is only being used locally in the 'connect' function.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
SSH Botnet?? - by Kaos_Method - Jun-29-2017, 06:17 PM
RE: SSH Botnet?? - by DeaD_EyE - Jun-29-2017, 08:43 PM
RE: SSH Botnet?? - by sparkz_alot - Jun-29-2017, 08:44 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020