Guest User

Untitled

a guest
Feb 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. # char.py
  2.  
  3. import cv2
  4.  
  5. #######################################################################################################################
  6. class Char:
  7.  
  8. # constructor #####################################################################################################
  9. def __init__(self):
  10. self.contour = None
  11. self.centerOfMassX = None
  12. self.centerOfMassY = None
  13. # end def
  14.  
  15. # end class
  16.  
  17. # char_user.py
  18.  
  19. import os
  20. import cv2
  21.  
  22. # I've tried this various ways, see more comments below
  23. from .char import Char
  24.  
  25. #######################################################################################################################
  26. def main():
  27.  
  28. char = Char()
  29.  
  30. char.centerOfMassX = 0
  31. char.centerOfMassY = 0
  32.  
  33. print("finished main() without error")
  34. # end main
  35.  
  36. #######################################################################################################################
  37. if __name__ == "__main__":
  38. main()
  39.  
  40. ModuleNotFoundError: No module named '__main__.char'; '__main__' is not a package
  41.  
  42. from .char import Char
  43. from . import Char
  44. import Char
  45. import char
Add Comment
Please, Sign In to add comment