Takes pictures of code!
Project description
This package takes pictures of source code
Example code:
from sshot import shot
from PIL import Image
code='''
print('Hello World!')
'''
image=shot(code,lang='python')
Image.fromarray(image).save('code.png')
The code above will create something like:
Use in command line:
sshot -i test.py -l python -o code.png
It is also supported to set the background image of code, like:
from sshot import shot
from PIL import Image
from sshot.background import Background
import numpy as np
code='''
print('Hello World!')
'''
bg=np.array(Image.open('bg.png'))
image=shot(code,lang='python',background=Background(bg))
Image.fromarray(image).save('code.png')
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
sourceshot-1.0.0.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file sourceshot-1.0.0.tar.gz
.
File metadata
- Download URL: sourceshot-1.0.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3e9b6b855e793eb12465f801773ca563269fca9365cdcc6df525dc60f0652ee |
|
MD5 | 52eacbdc135578fe9cb32b20145d310e |
|
BLAKE2b-256 | 49c1b307ad294cfb0ad5800d9573f03f2d84c764a055b86355fde900bffc9a46 |
File details
Details for the file sourceshot-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: sourceshot-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 984b8cab783d282d894d360c9147f16d3c705d7ab2367b219ffdaff3821a14b9 |
|
MD5 | 9a70dfd08fd8303c7d524095cbe8cd96 |
|
BLAKE2b-256 | be8c4e3e7544120bf99ff6e00bde953d96c147b7eeb0c48b5ab22965108238a3 |