Home > Software design >  the command of !date cannot run from jupyter notebook
the command of !date cannot run from jupyter notebook

Time:10-03

I was trying to using !date to print date-related information in jupyter notebook, but it seems that it just hang around there without running, what might be reason. I am using Anaconda virtual environment on windows.

enter image description here

CodePudding user response:

In IPython syntax, the exclamation mark (!) allows users to run shell commands from inside a Jupyter Notebook code cell.

If you are on Windows, date will show the system data and allows you to set a new one. This doesn't make much sense from inside Jupyter Notebooks.

If you want to see the current date and time in IPython, instead use

import time
time.strftime("%c")
  • Related