0

I tried to open python file (say model.py) in jupyter using

! vi model.py

But I was able to view only 25 lines. How to view entire file. I want to view files in jupyter notebook.

Ravikrn
  • 387
  • 1
  • 3
  • 19
  • 1
    The `!` thing won't work well with interactive applications like vi. You can view the entire file with `!cat` . – Thomas K Apr 29 '18 at 19:59

2 Answers2

0

Jupyter notebook is shipped with inbuilt text editor. You can open any .py in text editor from jupyter notebook's File explorer.(Just click model.py to open it)

Also from inside the notebook you can use the following command, to load file in a cell of notebook.
%load filename.py

Edit: If you are a fan of vim or vi editor, try using it from terminal inside jupyter notebook.

Sangram Gaikwad
  • 764
  • 11
  • 21
0

in addition you can open up a ipython console and run

%edit [filename]

or if you don't want the file to execute once you're done working on it.

%edit -x [filename]

running %edit? or %quickref? in the console will provide a ton more information.

fac
  • 101
  • 1
  • 4