No project description provided
Project description
Sometimes when we need to reference other project’s settings to do something, we can use execfile to parse file get variable inside. But a few things can make it difficult:
Dependency package(s) are not installed
Relative module(s) not in sys.path
Local module name confused due to scoping.
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 ]
Patch
Modify variables in script. Backup file will be named with datetime.
python -m pylookwhat patch target.py source.py false
target.py
A="Hello" B=123
source.py
A = "Hello World"
Patched target.py
A = "Hello World" B=123
- 1.0.3
Fix missing text when patch with dict variables
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
pylookwhat-0.0.3.zip
(6.1 kB
view details)
File details
Details for the file pylookwhat-0.0.3.zip.
File metadata
- Download URL: pylookwhat-0.0.3.zip
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7a36cd6d11f13471a2737db266e52dd42cc2072b1f08a296d93f203a02f284f
|
|
| MD5 |
912400e214aa99007716702f0fb1df5f
|
|
| BLAKE2b-256 |
39eaf8560ac2df64c92e46d8cc1651bb5b755b9482435c9d6646fb218f7a023e
|