Python Forum
new window in separate thread - flask website
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
new window in separate thread - flask website
#1
Hello,
I need to launch new window/tab on my flask website, which will be in separate thread and do its own job, with the ability to close/stop that thread/browser tab from the main page/thread.

Could someone give me an example how to achieve this?
I am running flask website using apache's wsgi.


Thanks
Reply
#2
I don't understand what you're asking. What makes you think you have any control over how the browser uses threads?

In any case, if you just want to open a new window, obviously that's done client-side. As such, you'll need to find the appropriate JavaScript (or whatever you're writing on the frontend) function to do it.
Reply
#3
(Sep-15-2021, 06:41 AM)Notabene Wrote: Hello,
I need to launch new window/tab on my flask website, which will be in separate thread and do its own job, with the ability to close/stop that thread/browser tab from the main page/thread.

Could someone give me an example how to achieve this?
I am running flask website using apache's wsgi.

Do you mean Flask? It executes in a server, correct? Browser windows execute in the client, right? Usually a different computer; the country might even be different.
Reply
#4
If you want a link to open in a new page then you need to change the HTML in your Flask function.

<a href = "">Normal Link </a>
<a href = "" target="_blank">This will open the link on a new tab</a>
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  My flask website not working properly Aggam 2 741 Nov-03-2020, 09:53 AM
Last Post: Aggam
  Create .exe file for Python flask website. vintysaw 4 11,057 Nov-18-2019, 07:56 AM
Last Post: tonycstech
  sqlite objects in thread can only be used in the same thread darktitan 5 9,691 Oct-24-2019, 05:00 PM
Last Post: darktitan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020