Skip to content

Commit

Permalink
#45 python examples reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
myselfhimself committed Sep 24, 2020
1 parent e604d00 commit aedcd6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/hello-world/hello_world.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See accompanying tutorial https://discuss.pixls.us/t/developing-and-fiddling-with-the-gmic-python-binding/20406/2
import gmic

gmic.run("200,200,1,3 text \"HELLO WORLD\",50%,50%,13,1,255,147,23 display")
gmic.run('200,200,1,3 text "HELLO WORLD",50%,50%,13,1,255,147,23 display')

# Use the 'output' command for outputting to a file
gmic.run("200,200,1,3 text \"HELLO WORLD\",50%,50%,13,1,255,147,23 output helloworld.png")
gmic.run('200,200,1,3 text "HELLO WORLD",50%,50%,13,1,255,147,23 output helloworld.png')
10 changes: 7 additions & 3 deletions examples/picsum-photos-montage/make_photo_montage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
max_images = 70
filenames = []
for a in range(max_images):
url = "https://picsum.photos/{}/{}".format(random.randint(50, 200), random.randint(50,200))
url = "https://picsum.photos/{}/{}".format(
random.randint(50, 200), random.randint(50, 200)
)
filename = "picsum{}.png".format(a)
filenames.append(filename)
myfile = requests.get(url, allow_redirects=True)
with open(filename, 'wb') as f:
with open(filename, "wb") as f:
f.write(myfile.content)

gmic_command = "{} frame 3,3,0 frame 3,3,255 montage A display output {}".format(" ".join(filenames), output_filename)
gmic_command = "{} frame 3,3,0 frame 3,3,255 montage A display output {}".format(
" ".join(filenames), output_filename
)

gmic.run(gmic_command)

0 comments on commit aedcd6b

Please sign in to comment.