Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

export python functions from files to the command line. Support python3.6+

NotificationsYou must be signed in to change notification settings

alex-testlab/pyrunp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://coveralls.io/repos/vascop/runp/badge.svg?branch=master&service=github

runp exports Python functions from files to the command line.You don't need to change your existing code.

install:

# install from pippip install pyrunp#download souce code and install by commandpython setup.py install

If you have a file named myfile.py with:

def foo():    """beeps a lot"""    print "beep beep"def bar(text):    """Prints things    Args:        text (str): The text to print    """    print text

And you want to run it in the command line just do:

$ runp myfile.py foobeep beep

You can also pass arguments to your functions:

$ runp myfile.py bar:"this is sweet!"this is sweet!

Functions with names starting with _ are hidden.

You can list available functions with:

$ runp myfile.py -lAvailable functions:foo    beeps a lotbar    Prints things

And get info on a specific function:

$ runp myfile.py -d barDisplaying docstring for function bar in module myfilebar(text)    Prints things    Args:        text (str): The text to print

Syntax for calling functions is:

$ runp myfile.py function_name:arg1value,arg2=arg2value

The concept, syntax for commands and initial code are heavily inspired by fabric's task system.

Wiki:https://github.com/alex-testlab/pyrunp/wiki

About

export python functions from files to the command line. Support python3.6+

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python100.0%

[8]ページ先頭

©2009-2025 Movatter.jp