1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Python relative Import

Discussão em 'Python' iniciado por Stack, Setembro 8, 2025.

  1. Stack

    Stack Membro Participativo

    I’m currently adding an example file to a package for managing the relationship between hexagonal tiles.
    My brain probably being mush, I can’t seem to get the import of a function called testgrp_generator from hexlogic_unittest.py into example.py right.
    I’ve tried various things and gotten various errors, for brevity's sake I’m not going to list them here. (init, sys path etc.)

    The folder structure is shown in the diagram below.

    HexLogic/
    ├── LICENSE
    ├── pyproject.toml
    ├── README.md
    ├── src/
    │ ├── example.py
    │ └── hexlogic.py
    └── tests/
    ├── __init__.py
    └── hexlogic_unittest.py


    The project can be found at the following addresses.
    https://pypi.org/project/hexlogic/
    https://github.com/MaximilianHauser/HexLogic

    Please tell me what to do like your talking to a 5 year old, thanks.

    Continue reading...

Compartilhe esta Página