Bonjour,
Petit code supplémentaire, inutile mais qui fonctionne sous tux.
Juste pour finir ce dimanche dans la bonne humeur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 import os.path import traceback import sys def getpath(): try: 1/0 except ZeroDivisionError as err: exc_type, exc_value, exc_tb = sys.exc_info() trace = traceback.format_exception(exc_type, exc_value, exc_tb) for elem in trace: if "File" in elem: return os.path.dirname(os.path.abspath(elem.split("\"")[1])) print(getpath())
@+
Partager