Issue 18286: Python 3.3 - Slowing down computer (original) (raw)

Created on 2013-06-22 19:14 by jon_irenicus, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (8)
msg191661 - (view) Author: Jon Irenicus (jon_irenicus) Date: 2013-06-22 19:14
Python's really slowing my computer down. After running my script, the computer grinds to a halt and it's performance drops. Even after a reboot, the problem still persists.
msg191662 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-06-22 19:18
You're not giving enough information to help us make sense of your problem. If you don't know how to describe the problem precisely, you should try the mailing-list: http://mail.python.org/mailman/listinfo/python-list
msg191664 - (view) Author: Jon Irenicus (jon_irenicus) Date: 2013-06-22 19:32
The problem is when i run my python script, it somehow slows the whole computer down. I checked my cpu usage, ram usage and disk usage, but nothing comes up. The script isn't big, it's only about 10kb big.
msg191666 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-06-22 19:37
We can't make anything useful of such a bug report. At a minimum, please post your entire script and explain how you are running it. Also explain what your system configuration is (operating system, etc.). That said, it's highly unlikely that Python is responsible for slowing your computer down *after* it has finished running.
msg191672 - (view) Author: David Edelsohn (David.Edelsohn) * Date: 2013-06-22 20:49
Is the script changing any configuration settings in your system that reduces available system resources without occupying CPU, RAM or disk?
msg191673 - (view) Author: Jon Irenicus (jon_irenicus) Date: 2013-06-22 20:56
#David Edelsohn It's not changing anything. with open('url_list.txt') as f: content = f.readlines() content = ''.join(content) content = list(content) if content[0] == 'h' and content[1] == 't' and content[2] =='t': print("Make sure that you remove http:/ !") time.sleep(1) sys.exit("") elif content[0] != 'w' and content[1] != 'w' and content[2] != 'w': print("Make sure that you have the www. at the start!") print(content[0],content[1]) time.sleep(1) sys.exit("") os.system("CLS") else: print("Configuration looks fine!") time.sleep(1) with open('url_list.txt') as f: content_url = f.readlines() content_join = ''.join(content_url) print("You will load video url",content_join,".") time.sleep(1) os.system("CLS") print("Processing...") time.sleep(1) global x x = 0 time.sleep(1) if x > 35: print("Warning! Your computer could go unstable!") time.sleep(1) os.system("CLS") print("Are you sure you want to select that many? - yes - no") while "1" == "1": _answer_ = input("|yes no
msg192218 - (view) Author: Matthew Barnett (mrabarnett) * (Python triager) Date: 2013-07-02 22:02
> with open('url_list.txt') as f: > > content = f.readlines() > content = ''.join(content) > Why are you reading all of the lines and then joining them together like that? Why not just do: content = f.read() > content = list(content) Why are you making a list? You could just as easily index the string. > if content[0] == 'h' and content[1] == 't' and content[2] =='t': If 'content' is a string, then that can be: if content.startswith('htt'): > print("Make sure that you remove http:/ !") > time.sleep(1) > sys.exit("") > elif content[0] != 'w' and content[1] != 'w' and content[2] != 'w': If 'content' is a string, then that can be: elif content.startswith('www'): > print("Make sure that you have the www. at the start!") > print(content[0],content[1]) > time.sleep(1) > sys.exit("") > os.system("CLS") > else: > print("Configuration looks fine!") > time.sleep(1) > with open('url_list.txt') as f: Now you're reading it for a second time! > content_url = f.readlines() > content_join = ''.join(content_url) > print("You will load video url",content_join,".") > time.sleep(1) > os.system("CLS") > print("Processing...") > time.sleep(1) > > > global x 'global' has no effect outside a function. > x = 0 > time.sleep(1) > if x > 35: > print("Warning! Your computer could go unstable!") > time.sleep(1) > os.system("CLS") > print("Are you sure you want to select that many? - yes - no") > while "1" == "1": Or: while True: > _answer_ = input("|yes no
msg192236 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2013-07-03 12:44
The problem is with OP's code; not Python. Please close this bug as invalid. OP can ask on the Python mailing list to fix his code.
History
Date User Action Args
2022-04-11 14:57:47 admin set github: 62486
2013-07-03 13:57:27 pitrou set status: open -> closedresolution: not a bugstage: resolved
2013-07-03 12:44:53 Ramchandra Apte set nosy: + Ramchandra Aptemessages: +
2013-07-02 22:02:02 mrabarnett set nosy: + mrabarnettmessages: +
2013-06-22 20:56:34 jon_irenicus set messages: +
2013-06-22 20:49:22 David.Edelsohn set nosy: + David.Edelsohnmessages: +
2013-06-22 19:37:21 pitrou set messages: +
2013-06-22 19:32:10 jon_irenicus set status: pending -> openmessages: +
2013-06-22 19🔞31 pitrou set status: open -> pendingnosy: + pitroumessages: +
2013-06-22 19:14:48 jon_irenicus create