From: Mauro Scomparin Date: Wed, 12 Apr 2017 00:11:01 +0000 (+0200) Subject: Modificato path in home. X-Git-Url: https://git.scompo.it/?a=commitdiff_plain;h=8aaf2c4b5a73988dc660e7e57e945aa1aee21edc;p=money.git Modificato path in home. --- diff --git a/money.py b/money.py index 66d1341..009f2a6 100755 --- a/money.py +++ b/money.py @@ -1,8 +1,7 @@ #!/data/data/com.termux/files/usr/bin/python from time import localtime, strftime - -path = 'dati.dat' +from os.path import expanduser, join def leggiTipo(): t = input('tipo (+/-) [-]: ') @@ -54,8 +53,11 @@ def scriviMovimento(path, m): return print("money 0.0.1") -print('file output:', path) +home = expanduser('~') +out_file_name = 'movimenti.dat' +out_file = join(home, 'dati', out_file_name) +print('file output:', out_file) m = leggiMovimento() -scriviMovimento(path, m) +scriviMovimento(out_file, m) print('scritto:', m) print('grazie.')