Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8133491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:37:08+00:00 2026-06-06T09:37:08+00:00

Please, I need help with my code: def start(): def start_tkinter(): global main,l main.destroy()

  • 0

Please, I need help with my code:

def start():
   def start_tkinter():
      global main,l
      main.destroy()
      main=Tk()
      l=Listbox(main)
      f1=Frame(main)
      e=Entry(f1)
      b1=Button(main,text="Stop",command=parar)
      l.pack(side=TOP)
      f1.pack(side=BOTTOM)
      e.pack(side=LEFT)
      b1.pack(side=RIGHT)
      main.update()
      start_server()

    def start_server():
     HOST, PORT = "localhost", 9999
     server = SocketServer.UDPServer((HOST, PORT), MyUDPHandler)
     server.serve_forever()
    start_tkinter()

When I start the loop, Tkinter freezes and I can’t use it. Please, I need a solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:37:11+00:00Added an answer on June 6, 2026 at 9:37 am

    You are correct. In essence, you need two infinite loops running in parallel: you need one to service the GUI, and another to service the socket server. Your only option is to use two threads or two processes.*

    The main thing to keep in mind is that Tkinter needs to run in the main thread, and you can’t directly access Tkinter objects from the other thread since Tkinter isn’t thread safe. You will need to introduce some sort of message passing mechanism if you want the socket thread to interact with the Tkinter

    *those aren’t your only options, but they are the most practical. When I need to read data from a socket I usually write some Tcl code to run in the underlying Tcl interpreter since Tcl’s fileevent model is so powerful. You lose the complexity of a threaded implementation, at the expense of having to do a little Tcl programming. But I digress.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help, PLEASE LOOK AT EDIT 2 This is code of huffman:
Please I need help with this code: >>> t = Transaction.objects.filter(paid=True) >>> t [<Transaction:
please i need you help with my script.. I'm trying to echo some content
Please I need your help with my script. I'm trying to insert values into
Please i need your help with how to include INDEXES in my tables, i've
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
I need some help! Please. I am trying to develop a very very simple
I need some help with a LINQ query in VB.Net, please. I have this
I need some with help with PowerShell, please. It should be pretty easy: I
Please help! I need to produce a Crystal Report with multiple data columns, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.