Skip to main content

Load module, function from string

Project description

Load python module, or member of module from string.

Example Usage

Load module, or member of module from string.

from dynamic_load import dynamic_load
dattime_module =  dynamic_load("datetime") # Load datetime module
dattime_module.datetime.now()
time_function = dynamic_load("time.time")
time_function()

Execute functionn of module from string.

from dynamic_load import dynamic_execute
answer =  dynamic_execute("datetime.datetime.now")
answer = dynamic_execute("time.sleep", 10) # execute(time.sleep(10))

Convert function as string.

from dynamic_load immport dynamic_string
string = dynamic_string(datetime.datetime.now)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic_load-0.0.4.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page