https://github.com/mezantrop/salpy
Self-altering Python code class
https://github.com/mezantrop/salpy
python self-modifying-code
Last synced: about 2 months ago
JSON representation
Self-altering Python code class
- Host: GitHub
- URL: https://github.com/mezantrop/salpy
- Owner: mezantrop
- License: bsd-2-clause
- Created: 2023-06-27T21:44:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T19:10:15.000Z (over 2 years ago)
- Last Synced: 2025-08-18T23:02:45.672Z (about 2 months ago)
- Topics: python, self-modifying-code
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Python class to help creating self-altering code
## Usage
```Python
import salpy# Changeme
new_code = """
print("Hello world!")
exit(0)
"""slp = salpy.Salpy()
slp.read()#
# slp.find_line(...)
# slp.find_block(...)
# slp.del_line(...)
# slp.insert_line(...)
# slp.replace_line(...)
# slp.insert_lines(...)
#entry_point = slp.replace_line(old_string='Changeme', new_string=new_code)
slp.write()
```Early stage of development, don't expect everything to work properly. If you have an idea, a question, or have found
a problem, do not hesitate to open an issue or mail me: Mikhail Zakharov zmey20000@yahoo.com