I have anaconda python and use the spyder IDE. I am trying to figure out how I can use relative imports for the bottom or F5.
Suppose I have pkg / A / foo1.py, pkg / A / foo2 / py, and foo1.py has "from. Import foo2", if I click on start it will report a relative import error.
I know how to do this in a command line environment where I can print, for example. msgstr "python -m pkg.A.foo1". How to do it in spyder IDE?
Thanks jq
pkg/A/__init__.py i.e, pkg.A - Python, from . import foo2 . , IDE spyder, emacs; .
pkg/A/__init__.py
pkg.A
from . import foo2
, Python spyder IDE.
, .. python pkg/A/foo1.py. , Python . . python -m pkg.A.foo1 .
python pkg/A/foo1.py
python -m pkg.A.foo1
, F5, IDE spyder.
F5
Source: https://habr.com/ru/post/1539718/More articles:Jeet Grid vs. Singularity - cssHow to make ABCPdf automatically write to a new page when the text requires more than 1 page? - dynamicDisable Sort option - javascriptАбсолютный модуль импорта в том же пакете - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1539717/copy-constructor-destructor-and-assignment-operator-for-class-storing-pointers-to-another-class&usg=ALkJrhjwas9jTabUc4UoJmS5lM72A-DBUwКак я могу настроить возвышенное, чтобы всегда использовать 4 пробела? - sublimetextCannot open Angular application using file protocol in Chrome. - javascriptInitialize ArrayList with pairs - javaDeprecated nodes left with animation classes in angularjs application - angularjslaravel 4 persistent data - jquery ajax submit - jqueryAll Articles