Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python library 'json' prints everything twice

Tags:

python

json

I decided to make a very simple program to get started with json in Python 3.4.3

However, it seemed I only write two lines before I encountered something weird; it prints everything twice. The program is just this:

import json

jsonFile = open('TODO.json','r').read()
print(jsonFile)

This prints the string twice. If I remove the 'import json' it works just fine. Any suggestions?

Thanks in advance

like image 709
LaughingMan Avatar asked Oct 19 '25 10:10

LaughingMan


1 Answers

Okay, so I named py file json.py. Did not think that through

like image 151
LaughingMan Avatar answered Oct 21 '25 23:10

LaughingMan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!