how to Load in Jupyter
This doesn't works (latex_milp.py is on my desktop) on Windows10
load("latex_milp.py")
load("/latex_milp.py")
load("c:/latex_milp.py")
load("c:\latex_milp.py")
What can I test ?
This doesn't works (latex_milp.py is on my desktop) on Windows10
load("latex_milp.py")
load("/latex_milp.py")
load("c:/latex_milp.py")
load("c:\latex_milp.py")
What can I test ?
Hello, @Cyrille! I am not completely sure if there are differences between Windows and Linux (I use Linux), but I think the following three procedures are OS-independent:
If you launch the Sage Notebook from the terminal (command line), you can move first to the same directory where your latex_milp.py
file is, and then launch the Sage Notebook with sage -n jupyter
.
When you open the Sage Notebook, the first screen that is shown to you has a tree of folder through which you can navigate on your computer. Just move to the folder where your latex_milp.py
is, and then open a new notebook with the "new
" menu on you right.
When I am feeling a little lazy, I look for the file, I make right click on it, and select the "copy" option. Then I move to my Sage Notebook, write load("")
, and in the middle of the quotation marks, I make right click and give the "paste" command. That copies the complete location of my file. For example, suppose I have my file on "/home/user/Documents/latex_milp.py". Exactly that location should appear in the middle of the load
command. (I am not completely sure that this works on Windows.)
I hope this helps! If not, you should follow @ortollj's suggestion, and give us a little bit of additional info on the location of your file, so we can help.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2019-10-07 08:01:41 +0100
Seen: 867 times
Last updated: Oct 07 '19
Hi Cyrille
on which OS do you work?,, but I do not know your userName and the dir of your ipynb is surely not the same as mine(you need to double the \ , i did it but it disseapear when the message is displayed:
on my W10 OS:
"C:\Users\Username\Documents\SageMath\IPYNB\"+”latex_milp.py"
on my UBUNTU OS (do not double the /):
"/home/userName/Downloads/SageMath/work/IPYNB/"+”latex_milp.py"
if you do not want to have to add the full path , then simply copy your file in the directory where you code is (the file *.ipynb)
to know the Desktop path on W10/8 open an explorer and click right on the Desktop icon in the tree, and look at the path in the general tab.
On Ubuntu :/home/userName/Desktop
it would be nicer, Cyrille, to say when someone answers your question if it helped to solve your problem or not.
if that's not the case can you tell us what's wrong
Sorry Ortollj, I have a very busy day because of courses but also because I must taught tomorrow with S&ageMAth and I cannot obtain what I espect. Of course there are some difference in the managment of path between windows 10 and linux. In my case if I put the file in the good directory there is no problem but for all the other case not one of the suggestion works. And sincerely I appreciate your help.
Ok >Cyrille ,But what is your OS ? if it is W10/8 did you think about doubling slashes ? , \\
but I imagine that as you are overwhelmed, the option to put the file in the code folder is enough. Good luck for tomorrow. but if you have time tick the @dsejas answer below in a way to pass this question solved the tick just under the 1 answer below.
sorry I forget this question. I have found, but I do not know where that insertig a r before the " works for windows10 which is my os. But I do not know why. I have found no references.