from typing import IO


def open_python_file(file_name: str) -> IO:
    """
        Creates or opens the file if exists. And starts writing on it.

        If the file was already on the system, it will rewrite it.

        Args:
            file_name {str}: name of the file, no extension

        Returns:
            IO: file object
    """
    python_file = open(file_name + ".py", "w")
    python_file.write("# -*- coding: utf-8 -*-\noui = {\n")

    return python_file