Thx for your suggestions.
T
First some more info: some time ago I have installed Python 3.7.4 and all the “packages” that I need using the standard installation (“Install Now” without customizing folder names). I selected the “Install Launcher” and “Add PATH” as recommended.
I have tried, as you suggested, with “solution 3”, but it definitely looks as if my Python does not “follow the book”.
I have documented both modules with some more comments here”)
T
First some more info: some time ago I have installed Python 3.7.4 and all the “packages” that I need using the standard installation (“Install Now” without customizing folder names). I selected the “Install Launcher” and “Add PATH” as recommended.
I have tried, as you suggested, with “solution 3”, but it definitely looks as if my Python does not “follow the book”.
I have documented both modules with some more comments here”)
# main.py # # is stored in G:\\UserData\\actname\\Documents\\Programmas\\Python_3-7-4\\ # import sys from selfwrittenmodule import f1, f2 def if1(x): a = f1(x);return(a) def if2(x): a = f2(x);return(a) b = 2 a = if1(b) c = if2(b) print (a, c)
# selfwrittenmodule.py # # is stored in C:\\Users\\actname\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib\\generaluse\\ # def f1(x): x = x + 1 def f2(x) x = x + 10When I “edit” main with IdleX and press F5 (run), then I receive this error msg:
Error:Traceback (most recent call last):
File "G:\UserData\actname\Documents\Programs\Python_3-7-4\main.py", line 6, in <module>
from selfwrittenmodule import f1, f2
ModuleNotFoundError: No module named 'selfwrittenmodule'
Then I renamed the foldername from C:\\Users\\actname\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib\\generaluse\\ to C:\\Users\\actname\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib\\selfwrittenmodule\\, and executed “main” again with IdleX. Then I get this error message:Error:Traceback (most recent call last):
File "G:\UserData\actname\Documents\Programs\Python_3-7-4\main.py", line 6, in <module>
from selfwrittenmodule import f1, f2
ImportError: cannot import name 'f1' from 'selfwrittenmodule' (unknown location)
>>>
Please tell me what I did wrong.