hapy/generate_py.py
def py_import(tok):
        """paste import statement in code
        Importing in Hapy. You can import:
        - Another .hapy "module"
        - A "custom" builtin module, see popo and test lol
        - Actual Python builtin modules, no restrictions for now!

        It was challenging at first, but thank God we achieved it.
        :)
        """

        status, imp_type, result = get(tok["module"]["value"], is_local=local)

        if status and imp_type in (1, 2):
            # this means it's a hapy builtin or
            # another local module
            # this adds a statement that makes that module available in the code
            # I haven't tested it for multiple embedded imports. I'm afraid :]

            o = result + "\n"
        elif status and imp_type == 3:
            # this means it's neither a Hapy module nor a local module...
            # and it starts with 'py_*' this is how we differentiate Python
            # modules in Hapy. For now...
            o = "import {module}\n".format(**{"module": result})
        elif not status:
            # this module is neither a hapy builtin, custom local module
            # or even a python module that starts with 'py_'
            # return an error!
            o = "# !!! Hapy cannot import {module}. Sorry :/ !!!\n".\
                format(**{"module": tok["module"]["value"]})

        return o
paste import statement in code
        Importing in Hapy. You can import:
        - Another .hapy "module"
        - A "custom" builtin module, see popo and test lol
        - Actual Python builtin modules, no restrictions for now!

        It was challenging at first, but thank God we achieved it.
        :)
        
paste import statement in code
Importing in Hapy. You can import:
Another .hapy "module"
A "custom" builtin module, see popo and test lol
Actual Python builtin modules, no restrictions for now!

It was challenging at first, but thank God we achieved it.
paste import statement in code Importing in Hapy . You can import : Another . hapy " module " A " custom " builtin module see popo and test lol Actual Python builtin modules no restrictions for now! It was challenging at first but thank God we achieved it .
def py_import(tok):
        status, imp_type, result = get(tok["module"]["value"], is_local=local)
        if status and imp_type in (1, 2):
            o = result + "\n"
        elif status and imp_type == 3:
            o = "import {module}\n".format(**{"module": result})
        elif not status:
            o = "# !!! Hapy cannot import {module}. Sorry :/ !!!\n".\
                format(**{"module": tok["module"]["value"]})
        return o
def py_import ( tok ) : status , imp_type , result = get ( tok [ "module" ] [ "value" ] , is_local = local ) if status and imp_type in ( 1 , 2 ) : o = result + "\n" elif status and imp_type == 3 : o = "import {module}\n" . format ( ** { "module" : result } ) elif not status : o = "# !!! Hapy cannot import {module}. Sorry :/ !!!\n" . format ( ** { "module" : tok [ "module" ] [ "value" ] } ) return o
paste import statement in code
Importing in Hapy.
paste import statement in code Importing in Hapy .
"""paste import statement in code
        Importing in Hapy. You can import:
        - Another .hapy "module"
        - A "custom" builtin module, see popo and test lol
        - Actual Python builtin modules, no restrictions for now!

        It was challenging at first, but thank God we achieved it.
        :)
        """ # this means it's a hapy builtin or # another local module # this adds a statement that makes that module available in the code # I haven't tested it for multiple embedded imports. I'm afraid :] # this means it's neither a Hapy module nor a local module... # and it starts with 'py_*' this is how we differentiate Python # modules in Hapy. For now... # this module is neither a hapy builtin, custom local module # or even a python module that starts with 'py_' # return an error!
tok