Здравствуйте, гость ( Вход | Регистрация )
Novak | Дата 14.11.2010, 18:16 |
У объекта модуля и можно спросить. Примерно вот так:
Работает для почти всех случаев. Подробнее в документации: __file__ is the pathname of the file from which the module was loaded, if it was loaded from a file. The __file__ attribute is not present for C modules that are statically linked into the interpreter; for extension modules loaded dynamically from a shared library, it is the pathname of the shared library file. |
|
Litkevich Yuriy | Дата 14.11.2010, 17:59 |
Нужно узнать полный путь к модулю средствами самого питона (с помощью Python/Qt известно как) | |
Просмотр темы полностью (откроется в новом окне) | |
Текстовая версия | Сейчас: 29.3.2024, 12:46 |