-1

I've created some .bat scripts and i want to import them into a .py file.

so i can run some imagemagick code from the .bat files because imagemagick doesn't really have coding for .py python scripts.

I want to make it blend with my python script so i just have to run one script

does anyone know how to do this?

if i type it into google all I find is the opposite..

this is the code for the .bat file i'm using now

cd "C:\360\tmp360\original_image"
mogrify convert -virtual-pixel tile -filter point -set option:distort:viewport 1680x720 -distort SRT 0  -path "C:\360\tmp360\tiled_image" *.png

cd "C:\360\tmp360\tiled_image"
mogrify -gravity center -crop 840x360+0+0 *.png


cd "C:\360\tmp360\tiled_image"
mogrify convert -virtual-pixel tile -filter point -set option:distort:viewport 1680x1440 -distort SRT 0  -path "C:\360\tmp360\tiled_image2" *.png

cd "C:\360\tmp360\tiled_image2"
mogrify -gravity northeast -background red -splice 350x150 -path "C:\360\tmp360\tiled_image2" *.png
mogrify -gravity center -crop 840x360+0+0 -path "C:\360\tmp360\tiled_image2" *.png
  • "if i type it into google all I find is the opposite.." [Maybe DuckDuckGo is just better at this?](https://duckduckgo.com/?q=run+batch+file+from+python) It seems to work well enough [with your version of the question, too](https://duckduckgo.com/?q=how+to+import+a+.bat+script+into+a+.py+file%3F). There are irrelevant answers, but I see e.g. [this](https://datatofish.com/batch-file-from-python/) and [this](https://codeigo.com/python/run-batch-file) on the first page of results. – Karl Knechtel May 18 '22 at 02:57
  • "imagemagick doesn't really have coding for .py python scripts." Er? It [certainly does](https://stackoverflow.com/questions/7550900/) ([also](https://stackoverflow.com/questions/7895278)). [Documentation](https://docs.wand-py.org/en/0.6.7/) and [repository](https://github.com/emcconville/wand) and [PyPI listing](https://pypi.org/project/Wand/) for Wand. – Karl Knechtel May 18 '22 at 03:05

0 Answers0