I am not able to execute the following code in python: (Sorry if this is a noob question, but I'm new)
def main(jsonIn):
print("MAIN")
print(data["host"])
if __name__ == '__main__':
logger.log("Loading configuration File.")
with open('untitled_1.json') as configFile:
data = json.load(configFile) #HAS 3 TAB SPACES(1[IF STATEMENT]+2[WITH])
print(data)
main(data)
else:
print("This code does not support being imported as a module")
It gives me the following error:
File "file.py", line 14
with open('untitled_1.json') as configFile:
^
TabError: inconsistent use of tabs and spaces in indentation
What is the reason for this? How can I resolve this?
-tab-tabCODE and -space-spaceCODE
– Benoît P