#đź”’ Simultaneously Launch A Server And Browser

8 messages · Page 1 of 1 (latest)

twilit moss
#

I have a service that runs with python, currently I start it in a terminal, then go to a different terminal and launch a python browser that is set to the local host and port of the server.

How can I launch the server at the same time I launch the browser from same python file?

stray burrowBOT
#

@twilit moss

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

red bloom
stray burrowBOT
#

webbrowser.open(url, new=0, autoraise=True)```
Display *url* using the default browser. If *new* is 0, the *url* is opened in the same browser window if possible. If *new* is 1, a new browser window is opened if possible. If *new* is 2, a new browser page (“tab”) is opened if possible. If *autoraise* is `True`, the window is raised if possible (note that under many window managers this will occur regardless of the setting of this variable).

Returns `True` if a browser was successfully launched, `False` otherwise.

Note that on some platforms, trying to open a filename using this function, may work and start the operating system’s associated program. However, this is neither supported nor portable...
red bloom
#

you might want new=1

twilit moss
stray burrowBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.