This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mrabarnett
Recipients David.Edelsohn, jon_irenicus, mrabarnett, pitrou
Date 2013-07-02.22:02:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372802522.65.0.609749350963.issue18286@psf.upfronthosting.co.za>
In-reply-to
Content
> 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| - ")
>         if _answer == "yes":
>             break
>         elif answer == "no":

You have '_answer_', '_answer' and 'answer'.

>             sys.exit("Quitting application")
>         else:
>             print("Invalid input!")
>             time.sleep(1)
>             os.system("CLS")
>
> elif x in range(1,35):

Or:

  elif 1 <= x <= 35:

>     print("Seems fine")
> elif x < 0:
>     print("Warning!")
>     print("Out of range value!")
>     os.system("CLS")
>     time.sleep(5)
>     sys.exit("")
> os.system("CLS")
> time.sleep(5)
> print("Starting now!")
> while x > 0:
>     x = x - 1
>     os.system("start "+content_join)

You're starting up to 35 processes (or possibly more). That's going to slow down your machine.

>
> time.sleep(10)
> os.system("taskkill /f /im chrome.exe")
> os.system("start test.py")

Now you're repeating the whole procedure (I think). That's going to slow down your machine even more.

> sys.exit("restarting")

So it looks like your problem is not the fault of Python itself, but due to what you're doing with it.
History
Date User Action Args
2013-07-02 22:02:02mrabarnettsetrecipients: + mrabarnett, pitrou, David.Edelsohn, jon_irenicus
2013-07-02 22:02:02mrabarnettsetmessageid: <1372802522.65.0.609749350963.issue18286@psf.upfronthosting.co.za>
2013-07-02 22:02:02mrabarnettlinkissue18286 messages
2013-07-02 22:02:02mrabarnettcreate