Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

362
Views
IPython.notebook.kernel.execute in the same cell

I have a follow up question to Can a Jupyter / IPython notebook take arguments in the URL?

There is an assumption here that the HTML object should be the last one in the cell and the print URL is in the next one. Is it possible to get the URL directly without these assumptions? I need it in an app that runs through a package voila. A snippet of code(like below from the other query on stackoverflow) in a single cell would be ideal.

*from IPython.display import HTML
HTML('''
    <script type="text/javascript">
        IPython.notebook.kernel.execute("URL = '" + window.location + "'")
    </script>''')
print(URL)*
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

you can insert a div and print the url into this div:

from IPython.display import HTML
HTML('''
    <div id="url_output"></div>
    <script type="text/javascript">
        document.getElementById("url_output").innerHTML = window.location
    </script>
''')
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!