question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dumping the json result into json file

See original GitHub issue

I have two questions.

  1. How can I dump the json output to a json file instead of printing out? I currently have docker run -v $(pwd):/tmp mythril/myth analyze /tmp/simple_int_overflow.sol -o json --solv 0.4.24 --execution-timeout 86400 to print out the json output. I tried adding -j /tmp/test.sol, but it doesn’t seem like the outputs are the same.

  2. If I want to recursively run mythril on the background to scan through a directory of smart contracts and print the results to .json in Python, how can I do that?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
norhhcommented, Jul 7, 2022

You can directly run the cli myth a file.sol -o json > output_file.json through python with something like os.system() or subprocess.call functions

0reactions
chinhongleecommented, Jul 7, 2022

Thank you so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How do I write JSON data to a file?
import json with open('data.json', 'w') as f: json.dump(data, f). On a modern system (i.e. Python 3 and UTF-8 support), you can write a...
Read more >
Reading and Writing JSON to a File in Python
To write JSON contents to a file in Python - we can use json.dump() and json.dumps() . These are separate methods and achieve...
Read more >
Python Tutorial: json.dump(s) & json.load(s) - 2021
dumps ()" returns a string as indicated by the "s" at the end of "dumps". This process is called encoding. Let's write it...
Read more >
Python JSON dump() and dumps() for JSON Encoding
The json.dump() method (without “s” in “dump”) used to write Python serialized object as JSON formatted data into a file. ; The json.dumps() ......
Read more >
Python JSON: Encode(dumps), Decode(loads) & Read ...
What is JSON? JSON is a standard format for data exchange, which is inspired by JavaScript. Generally, JSON is in string or text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found