A
A
alexvarder2015-12-21 22:12:19
Python
alexvarder, 2015-12-21 22:12:19

Global module import in Python?

Hello, I'm a beginner python programmer, I'm facing the same problem. I have several files in the project, the approximate structure of the project is:
install.py
app (folder):
- output.py
- check.py
- pars.py
in all these files I need to use Cyrillic and several standard python modules (os, math etc.), how to make it so that it would be possible to connect all these modules only once in one file in which my modules will be connected (check, pars, etc.) i.e. that the os module, for example was available everywhere and at the same time not to write import os every time and also with encoding.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2015-12-21
@alexvarder

This is not the pythonic way. Everything that you use third-party in the code should be written in imports.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question