login|Register
Forum > Python
Post|
看13019|回4|Favorite
LucasBSC 看全部
2017-9-15 10:16:16
Edited by LucasBSC at 2017-9-15 10:20

Hi everybody,

I am getting started with OPi 2G-Iot and just got to install the "python-periphery library" through Wi-Fi connection successfully established but I do not know exactly how to work with the library and the board. I saw on another post code examples but it is not clear for me how I get there or how I get started at all programming Python on OPi 2g IoT. Note: I am using the Ubuntu distro through PuTTy SSH Terminal
I am creating this thread for those who have the same issue as I do and for the ones who have the knownledge to maybe share a step-by-step to get this done smoothly.

Many thanks!

Lucas

sm2345110 看全部
2018-1-3 15:02:39
import pxssh
s = pxssh.pxssh()
if not s.login ('localhost', 'myusername', 'mypassword'):
    print "SSH session failed on login."
    print str(s)
else:
    print "SSH session login successful"
    s.sendline ('uptime')
    s.prompt()         # match the prompt
    print s.before     # print everything before the prompt.
    s.logout()
   
#We can also execute multiple command like this:
s.sendline ('uptime;df -h')
Get to touch with Python Training in Noida
Rohit 看全部
2018-8-3 14:23:25
I am also having problem in using python-Periphery. I am not able to execute the python code on 2G-iot.
LakraRohit 看全部
2018-8-6 13:23:57
How to compile .c code on orangepi 2G-iot?
william4882 看全部
2023-8-13 00:39:07
However, concerns about the company's impact on smaller businesses and its control over the market raise ethical considerations. Competitive prices and fast shipping with Amazon Prime make it a go-to choice for many readers, but alternatives are worth exploring. https://buylocalbooks.com/great-falls/

OrangePi En

Powered by Discuz! X3.4

homepage|Simple edition|Touch edition|PC