Python Threads

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kmladenovski
    New Member
    • Jun 2021
    • 1

    Python Threads

    Hi everyone, i am stuck with Threads in python.
    Can someone help me?

    Code:
    def Kub(x):
        a=x*x*x
        return a
    
    print("Unesite broj veci od 10 i manji od 150000")
    i=0
    x=int(input())
    while i!=x:
        if x>10 and x<150000:
            i=x
            print(i)
        else:
            print("Unesite drug broj u dadeni interval")
            x=int(input())
    y=i/3
    z=y+y
    start = time.perf_counter()
    t1 = threading.Thread(target=Kub, args=(0, y))
    t2 = threading.Thread(target=Kub, args=(y, z))
    t3 = threading.Thread(target=Kub, args=(z, i))
    Last edited by Niheel; Jun 13 '21, 01:49 AM.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You haven't said what the problem you are having is, you have just posted code. You need to explain what you were expecting to happen and also what actually happened.

    However you do not start any of the treads you create e.g.

    Code:
    ti.start()

    Comment

    Working...