Skip to main content

look up variables in another python file

Project description

Sometimes need reference other project’s settings to do something, Could use execfile to parse file get variable inside . But something make difficult

  1. Dependency packages are not installed

  2. Relative modue not in sys.path

  3. Local module name confused

Use pylookwhat to solve these

import pylookwhat

what = {}
lookwhat = [ 'A', 'B'  ]
filename = 'what.py'
pylookwhat.lookwhat( filename, what, lookwhat  )

print what

what.py

A = { "Hello": "World" }
B = [ 1, 2, 3 ]

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

pylookwhat-0.0.1.zip (4.4 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