python - file is uploaded in jupyter notebook but not accessible -
i not sure why can see first 5 lines in uploaded file in jupyter notebook though file uploads:
import io ipython.display import display import fileupload def _upload(): _upload_widget = fileupload.fileuploadwidget() def _cb(change): decoded = io.stringio(change['owner'].data.decode('utf-8')) filename = change['owner'].filename print('uploaded `{}` ({:.2f} kb)'.format( filename, len(decoded.read()) / 2 **10)) _upload_widget.observe(_cb, names='data') display(_upload_widget) uploaded_file = _upload() uploaded `plot.r` (3.00 kb) %%bash pwd head -5 uploaded_file head -5 "/home/jalal/plot.r" head -5 plot.r %%bash pwd head -5 uploaded_file head -5 "/home/jalal/plot.r" head -5 plot.r /home/jalal head: cannot open ‘uploaded_file’ reading: no such file or directory head: cannot open ‘/home/jalal/plot.r’ reading: no such file or directory head: cannot open ‘plot.r’ reading: no such file or directory
also tried this:
_upload
and then
head -5 filename
i error:
head: cannot open ‘filename’ reading: no such file or directory
Comments
Post a Comment