diff --git a/Readme-python.txt b/Readme-python.txt index 4bad544c2ed2e18a5c160d5aadd069f9be778cd9..c5ec3e0dd84ed6e768fd7febd7b807b41c5b136e 100644 --- a/Readme-python.txt +++ b/Readme-python.txt @@ -8,8 +8,12 @@ Successfully installed pip-19.0.3 [ntird-us191-jg4:jgrelet]/c/git/python/pirata Sous Linux Ubuntu 16.04, l'upgrade de pip failed ! +--------------------------------------------------- +voir: https://askubuntu.com/questions/1025793/running-pip3-importerror-cannot-import-name-main Utiliser: > python3 -m pip install --user <package> # instead + +A tester: Then I recommend adding the following aliases to your .bashrc: pip() ( python -m pip "$@" ) pip3() ( python3 -m pip "$@" ) @@ -77,7 +81,7 @@ In setting.json: "python.autoComplete.addBrackets": true, "editor.formatOnPaste": true -Modules pYthon à intaller: +Modules Python à intaller: -------------------------- Autoformatting ---------------------- diff --git a/roscop/roscop.py b/roscop/roscop.py index 19297be918d51ee9414de5fdcab7497df0513514..d811dd70f4676c37c6bb9503da7c5424fdc0f63f 100644 --- a/roscop/roscop.py +++ b/roscop/roscop.py @@ -20,9 +20,9 @@ class Roscop: def __str__(self): return 'Class Roscop, file: %s, size = %d' % (self.file, len(self.hash)) - def __getattr__(self, name): + def __getitem__(self, name): ''' - overload r.key + overload r[key] ''' return self.hash[name] @@ -31,7 +31,7 @@ class Roscop: def disp(self, theKey): print("%s :" % theKey) - print(self.hash[theKey]) + print(self[theKey]) # read code roscop file def read(self): @@ -87,6 +87,5 @@ if __name__ == "__main__": for k in key: r.disp(k) - # print(r.TEMP) # r.disp('TEMP') # print(r[key])