I want to convert a string which represents a jupyter notebook to a string representing python program. And I met a problem that in jupyper, something like
data = pd.read_csv("tmp.csv")
data.head()
will output something, while in python program, we need to use print, like
print(data.head())
Therefore, I wonder if there any way to add 'print'.
I have a simple idea that parameters in python are consisted of 'a-zA-Z' and '_', so by checking whether the line consists only these chars, I can solve a small part of the problem. However, it's just not enough to deal with all situations.