473,287 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Python Threads

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

Expand|Select|Wrap|Line Numbers
  1. def Kub(x):
  2.     a=x*x*x
  3.     return a
  4.  
  5. print("Unesite broj veci od 10 i manji od 150000")
  6. i=0
  7. x=int(input())
  8. while i!=x:
  9.     if x>10 and x<150000:
  10.         i=x
  11.         print(i)
  12.     else:
  13.         print("Unesite drug broj u dadeni interval")
  14.         x=int(input())
  15. y=i/3
  16. z=y+y
  17. start = time.perf_counter()
  18. t1 = threading.Thread(target=Kub, args=(0, y))
  19. t2 = threading.Thread(target=Kub, args=(y, z))
  20. t3 = threading.Thread(target=Kub, args=(z, i))
Jun 12 '21 #1
1 2899
Banfa
9,065 Expert Mod 8TB
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.

Expand|Select|Wrap|Line Numbers
  1. ti.start()
Jun 14 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.