Computer Science Canada

Split lines in python 2.7

Author:  AndresDM [ Mon Feb 10, 2014 7:40 pm ]
Post subject:  Split lines in python 2.7

I need to attach the following statement:

print urls

Out:
code:

   htt://www.myweb0.com
 
   htt://www.myweb1.com
 
   htt://www.myweb2.com

   htt://www.myweb3.com

....

Converter In out:

a = urls

a = ["htt://www.myweb0.com", "htt://www.myweb1.com", "htt://www.myweb2.com" "htt://www.myweb3.com", "....","....." ]

print(random.choice([a]))

Thanks for your help.

Author:  Raknarg [ Mon Feb 10, 2014 9:32 pm ]
Post subject:  RE:Split lines in python 2.7

I don't really get what you're asking for


: