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,660 points
61 views

2 answers to this question.

0 votes
Hey, please mention the version of python you are using.
answered Aug 13, 2018 by Omkar
• 68,860 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
• 68,860 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,810 points
96 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,660 points
27 views
0 votes
1 answer

Web3j v3.3.1 : Error while generating compiled solidity smart contracts which returns array of struct

Solidity does not support returning structs in ...READ MORE

answered Jun 19, 2018 in Blockchain by Aryya
• 7,340 points
274 views
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,260 points
605 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,660 points
368 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,810 points
205 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
• 68,860 points
44 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
• 68,860 points
98 views