Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # char.py
- import cv2
- #######################################################################################################################
- class Char:
- # constructor #####################################################################################################
- def __init__(self):
- self.contour = None
- self.centerOfMassX = None
- self.centerOfMassY = None
- # end def
- # end class
- # char_user.py
- import os
- import cv2
- # I've tried this various ways, see more comments below
- from .char import Char
- #######################################################################################################################
- def main():
- char = Char()
- char.centerOfMassX = 0
- char.centerOfMassY = 0
- print("finished main() without error")
- # end main
- #######################################################################################################################
- if __name__ == "__main__":
- main()
- ModuleNotFoundError: No module named '__main__.char'; '__main__' is not a package
- from .char import Char
- from . import Char
- import Char
- import char
Add Comment
Please, Sign In to add comment