Je souhaite désactiver "return" pour l'impression de tout objet retourné dans shell Python.Désactiver l'instruction de retour Python de l'objet d'impression retourné
Un script par exemple python exemple test.py ressemble:
def func1():
list = [1,2,3,4,5]
print list
return list
Si je ne suit:
python -i test.py
>>>func1()
Cela me donne toujours deux impressions sur shell python. Je veux juste imprimer et obtenir l'objet retourné.
+1: Redresser la « coquille » par rapport à la confusion Python –