Ask Your Question
1

how to Load in Jupyter

asked 2019-10-07 08:01:41 +0100

Cyrille gravatar image

updated 2019-10-07 09:11:19 +0100

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 ?

edit retag flag offensive close merge delete

Comments

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

ortollj gravatar imageortollj ( 2019-10-07 08:31:08 +0100 )edit

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

ortollj gravatar imageortollj ( 2019-10-07 15:53:24 +0100 )edit

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.

Cyrille gravatar imageCyrille ( 2019-10-07 20:23:36 +0100 )edit

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.

ortollj gravatar imageortollj ( 2019-10-07 23:13:30 +0100 )edit

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.

Cyrille gravatar imageCyrille ( 2020-06-07 14:02:02 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2019-10-07 16:19:06 +0100

dsejas gravatar image

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:

  1. 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.

  2. 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.

  3. 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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-10-07 08:01:41 +0100

Seen: 867 times

Last updated: Oct 07 '19