vascop / runp Goto Github PK
View Code? Open in Web Editor NEWexport python functions from files to the command line
export python functions from files to the command line
When I try to run runp from crontab, e.g. with 50 * * * * runp hello.py test >> hello.txt 2>&1
it fails and I get the following error: /bin/sh: 1: runp: not found
How can I fix this?
I am trying to use runp with a python script that runs the camera on a raspberrypi with picamera. Although this works with python and in the script, I always get an error with runp:
picamera.exc.PiCameraRuntimeError: Cannot query frame information when camera is not recording
The script is as simple as
from picamera import PiCamera
from time import sleep
def test():
camera = PiCamera()
camera.start_preview()
camera.start_recording('/home/pi/video.h264')
sleep(10)
camera.stop_recording()
camera.stop_preview()
and the code I run: runp test.py test
I could install runp
using pip
, but it did not work right away. Besides the need to add parentheses to print
statements, I found this error message:
Traceback (most recent call last):
[...]
File "[...]/lib/python3.6/site-packages/runp/runp.py", line 15, in filter_vars
methods = inspect.getmembers(obj(), predicate=inspect.ismethod)
... for which a solution was to change obj()
to obj
. I am not knowledgeable enough to say this is the right solution, perhaps someone else could shed some light. With the above changes runp
seems to work okay and continues to be a nifty little tool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.