Python syntax error because of version conflicts.

0 votes

I found a python script on the internet and try to run it like this

python py-exmple.py

I get this error:

File "py-exmple.py", line 93

    print json.dumps(evaluate(), indent=4)

             ^

SyntaxError: invalid syntax

I have python installed.

Aug 13, 2018 in Blockchain by digger
• 26,550 points
46 views

2 answers to this question.

0 votes
Hey, please mention the version of python you are using.
answered Aug 13, 2018 by Omkar
• 67,660 points
I am using version 3.6.5
0 votes

As mentioned in the reply to my question, you are using version 3.6.5. 

In python 3.x, you have to add braces for your code.

Change your code to this syntax and it will work.

print( json.dumps(evaluate(), indent=4) )
answered Aug 13, 2018 by Omkar
• 67,660 points

Related Questions In Blockchain

0 votes
1 answer

Blockchain Python Syntax Error

Look here:  print('Block #{} has been added to ...READ MORE

answered Jul 13, 2018 in Blockchain by Christine
• 15,790 points
70 views
0 votes
1 answer

Syntax Error running on Python

You are missing the closing parenthesis: hashlib.sha256(self.index + ...READ MORE

answered Sep 21, 2018 in Blockchain by digger
• 26,550 points
19 views
0 votes
1 answer
0 votes
1 answer

How to solve “More than one instance of bitcore-lib found” error?

There is a temp solution here. ~/bitcore-explorers/node_modules/bitcore-lib/index.js line 7: bitcore.versionGuard ...READ MORE

answered Jul 25, 2018 in Blockchain by slayer
• 29,170 points
528 views
+2 votes
1 answer
0 votes
1 answer

Python request module for bitcoin json rpc

This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 26,550 points
284 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
169 views
0 votes
1 answer

Ethereum generating genesis Python Syntax

print in python3 is a method not a ...READ MORE

answered Oct 10, 2018 in Blockchain by Omkar
• 67,660 points
30 views
0 votes
1 answer

Blockchain: Installing an earlier version of ethereum using apt-get on

geth does not make the previous version available ...READ MORE

answered Oct 10, 2018 in Blockchain by Omkar
• 67,660 points
70 views