Created
September 1, 2019 06:36
-
-
Save Cheejyg/c4e2d41edee0edb00cd0a4ddbb2ca30c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
inputFilename = input("File: ") | |
with open(inputFilename, "rt") as input_file: | |
inputs = json.load(input_file) | |
source = "" | |
for x in range(len(inputs["cells"])): | |
for string in inputs["cells"][x]["source"]: | |
source += string | |
source += "\n\n" | |
with open(inputFilename.replace(".ipynb", ".py"), "wt") as output_file: | |
output_file.write(source) | |
output_file.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment