modif import in json class
This commit is contained in:
parent
62664cfca0
commit
f1dbacc033
@ -170,7 +170,6 @@ class Interface:
|
|||||||
class JSONfile:
|
class JSONfile:
|
||||||
|
|
||||||
def __init__(self,filename):
|
def __init__(self,filename):
|
||||||
import os,json
|
|
||||||
self.datafilepath=os.path.dirname(os.path.realpath(__file__))+"/"+filename
|
self.datafilepath=os.path.dirname(os.path.realpath(__file__))+"/"+filename
|
||||||
try:
|
try:
|
||||||
with open(self.datafilepath, 'r', encoding='utf-8') as f:
|
with open(self.datafilepath, 'r', encoding='utf-8') as f:
|
||||||
@ -208,7 +207,7 @@ class JSONfile:
|
|||||||
json.dump(liste_chaine, f, indent=4)
|
json.dump(liste_chaine, f, indent=4)
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self.data)
|
return str(self.data)
|
||||||
|
|
||||||
def RepresentsInt(s):
|
def RepresentsInt(s):
|
||||||
try:
|
try:
|
||||||
int(s)
|
int(s)
|
||||||
|
Loading…
Reference in New Issue
Block a user