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
• 27,620 points
31 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,120 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,120 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
48 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
• 27,620 points
10 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,050 points
387 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
• 27,620 points
174 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
104 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,120 points
18 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,120 points
42 views