Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. from os import system
  2. from PIL import Image
  3. from PIL import ImageDraw
  4.  
  5. def clear_screen():
  6.     system("cls")
  7.  
  8. clear_screen()
  9.  
  10. print("\nDas Programm befindet sich noch in der Testphase!!")
  11. print("\n\n(Anstatt Komma bitte einen Punkt eingeben!!!)")
  12.  
  13. SchaftDurchmesser = float(input("\n\nSchaftDurchmesser > "))
  14. TD                = float(input("TD                > "))
  15.  
  16. step_mm   = round((SchaftDurchmesser - TD) / 2, 3)
  17. step_inch = round(step_mm / 0.0254, 1)
  18.  
  19. print ("Step in mm ist gleich " + str(step_mm))
  20. print (step_inch)
  21.  
  22. text_step_mm    = "Step in mm = " + str(step_mm)
  23. text_step_inch  = "Step für Blade = " + str(step_inch)
  24.  
  25. size = width, height = 600,400
  26. img = Image.new( "RGB", size , "white")
  27.  
  28.  
  29. img = Image.open("testpic.png")
  30.  
  31. draw = ImageDraw.Draw(img)
  32. BLACK = 0,0,0
  33.  
  34. draw.text((10,20), text_step_mm, BLACK)
  35. draw.text((10,40), text_step_inch, BLACK)
  36. img.save("testpic.png")
  37.  
  38. img.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement