Makes scripts feel like functions.
Project description
callscript
Want to add a GUI, CLI, or simply test your script, but you don't want to modify your code? Call a script as though it were a function!
Usage:
If you label your script with the "input" or "output" comments, callscript
can call it!
# examples/script.py
x = 3 # input
y = 5 # input
z = x + y # output
Then from your other code, you can call it with the callscript()
function:
>>> from callscript import callscript
>>> callscript('examples/script.py', x=10, y=20)
{'z': 30}
Want to change your variable names? You can do that, too!
# examples/script2.py
x = 3 # input:FirstWeek
y = 5 # input:SecondWeek
z = x + y # output:sum
>>> from callscript import callscript
>>> callscript('examples/script2.py', FirstWeek=10, SecondWeek=20)
{'sum': 30}
Installation
pip install callscript
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
callscript-0.1.dev7.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for callscript-0.1.dev7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4aed203037a7f8bf62b65e5aee5cd4c67842b672322f00c22c712a092125686 |
|
MD5 | 5553e0d04d58ae646aad442daac4f600 |
|
BLAKE2b-256 | c990dee31f804e3fad13b9e865bdb89fc3bc453937c02486115b164fda98924d |