Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
problème d'importation
-
indeed the main script is in the same directory with the module .
import mdp ...... generateur = mdp.Generator(mdp.Test()) .......
the error message is :
'module mdp has no attribute Generator'PS: Generator is a Class defined in mdp Module
-
@philippe sure there is no mix lower/upper case? Is it possible to post the mdp module or at least the class definition.
-
Is your module https://pypi.org/project/MDP ??
-
@ccc
I didn’t know this module
I’ll try to change my module’s name
Do you really think that it may be confusion between lower and upper case ? -
@philippe said
Do you really think that it may be confusion between lower and upper case
Python is
case sensitive
, thus generator is not the same as Generator. That's why I asked you to post the mdp module classes definitionI’ll try to change my module’s name
Not yet sure it is necessary. Did you write yourself the mdp module? If yes, no need to play with the other one.
-
@cvp
It does work now !
I have changed the name ; so it may appear , in that case , that case is insensitive?!
Thanks for your advices -
@philippe said
I have changed the name ; so it may appear , in that case , that case is insensitive?!
Sorry, I don't understand. Which name did you change?
-
@cvp
I’ve change the name of my module (mdp)
Module that I’ve implemented
It’s a module composed with classes and functions; it’s purpose is to generate passwords -
@philippe Yes, I understand that. My question was "what did you change"
Example: your module was MDP and you changed into mdp
Your class was Generator and you changed into generator
Both examples showing that case is importantAnyway, most important is that it works now.
-
@cvp
My module’s name was ‘mdp’
I rename it ‘myModule’I didn’t change any of my classe names
Is that clear enough
-