Skip to content
Advertisement

Tag: python

Paramiko return code127 against command that actually exist

During automating SSH routine using paramiko to linux pc, I am encountering an issue where for the existing command, I am not able to execute it successfully as “command not found” 127 response code is received on command execution. I have tried all sort of ways exec_command(), crosschecking manually (the command work fine), change directory to the path of command

OSError: [Errno 19] Failed to open the uinput device: No such device

I am pretty new to raspberry and Linux. I am trying to run basic example of python library uinput on Raspbian (r Pi 3 B) with following code: I get the error: Traceback (most recent call last): File “/home/pi/Desktop/t1.py”, line 7, in uinput.REL_Y, File “/home/pi/.local/lib/python3.5/site-packages/uinput/init.py”, line 178, in init self.uinput_fd = fd or fdopen() File “/home/pi/.local/lib/python3.5/site-packages/uinput/__init.py”, line 84, in fdopen

python way to find unique version of software

I’ve multiple components of a software (let’s call it XYZ) installed on my linux (RHEL 6.2) server running python 3.3. I’m trying to covert my install/upgrade script from shell to python. For that I need to fetch the version number, but only once. In my python script I’ve added the below code I want to use python based commands instead

Python installation in custom directory (Linux): PIP not working

I have installed Python3.6.4 in a Linux machine, under a user directory, lets say /drive/username/Python3.6.4 I’ve setup my path and aliases, and Python is working properly (i.e. executing python3 puts me in the correct environment, which python3 produces: /drive/username/Python3.6.4/bin/python3) The problem is with pip! When i execute pip3, i am getting: -bash: /username/Python3.6.4/bin/pip3: /usr/local/bin/python3.6: bad interpreter: No such file or

One way communication over TCP Socket [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago. Improve this question I am trying to send some data to a remote Raspberry Pi over TCP socket from a GUI that I designed with Python. I’ve implemented

How to access python return value from bash script

I’m trying to understand how to access from a bash script the return value of a python script. Clarifying through an example: foo.py start.sh If I run the bash script, this prints the message “exec main..”. How can I store in script_output the return value (execution ok)? If I direct execution ok to stdout, the script_output will capture all the

How to create a system-wide file lock?

I am trying to have a number of independent processes coordinate their writing to file using a system-wide lock (see here: Concurrent file accesses from different scripts python) The lock needs to span the whole system, because the processes are spawn independently and at different times. Here: System-wide mutex in Python on Linux I read that fcntl.lockf should do what

Advertisement