Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

359
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda