473,425 Members | 1,885 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,425 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 2903
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

1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.