Re: [Tutor] 6 random numbers

2011-10-16 Thread Stefan Behnel
ADRIAN KELLY, 16.10.2011 21:43: anyone know how i would go about printing 6 random numbers print(75, 45, 6, 35, 36472, 632) Numbers were generated by typing randomly on my keyboard. Sorry-for-taking-it-all-too-literally-ly, Stefan ___ Tutor ma

Re: [Tutor] 6 random numbers

2011-10-16 Thread Steven D'Aprano
ADRIAN KELLY wrote: hello all, anyone know how i would go about printing 6 random numbers, i know i could copy and paste 6 times (which would work) but i was thinking about a while loop, ie. while lottery_numbers.count is <7. Is it possible to code this? is it possible to count random variables?

Re: [Tutor] httplib2.RelativeURIError: Only absolute URIs are allowed. uri

2011-10-16 Thread Steven D'Aprano
pierre dagenais wrote: Isn't "file:///home/pierre/bookmarks.html" a valid URI? It works fine with urllib, why not with httplib2? "file://..." is not a HTTP resource. -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subs

Re: [Tutor] 6 random numbers

2011-10-16 Thread Robert Sjoblom
>> hello all, >> anyone know how i would go about printing 6 random numbers, i know i could >> copy and paste 6 times (which would work) but i was thinking about a while >> loop, ie. while lottery_numbers.count is <7. >> Is it possible to code this? is it possible to count random variables? i am

Re: [Tutor] Randrange [was: Re: Tutor Digest, Vol 92, Issue 77]

2011-10-16 Thread Alan Gauld
On 16/10/11 21:10, Max S. wrote: On Sun, Oct 16, 2011 at 3:44 PM, mailto:tutor-requ...@python.org>> wrote: Send Tutor mailing list submissions to tutor@python.org When replying, please edit your Subject line so it is more specific than "Re: Conte

[Tutor] httplib2.RelativeURIError: Only absolute URIs are allowed. uri

2011-10-16 Thread pierre dagenais
Hi, I'm running python 3.2 on Ubuntu 11.04 and have a problem with httplib2. I'm not sure if it's my ignorance or a bug in the code. This code works: #! /usr/bin/python3.2 import urllib.request sock = urllib.request.urlopen("file:///home/pierre/bookmarks.html") htmlSource = sock.read() sock.

Re: [Tutor] 6 random numbers

2011-10-16 Thread शंतनू
On 17-Oct-2011, at 1:13 AM, ADRIAN KELLY wrote: > hello all, > anyone know how i would go about printing 6 random numbers, i know i could > copy and paste 6 times (which would work) but i was thinking about a while > loop, ie. while lottery_numbers.count is <7. > Is it possible to code this? is

Re: [Tutor] Tutor Digest, Vol 92, Issue 77

2011-10-16 Thread Max S.
an > >> > > > >Alright, I'm not going to pretend to be an expert on this one, a bit > >of this is speculation and inference from what I know about dynamic > >linking. In short, I don't think you can modify LD_LIBRARY_PATH on the > >fly and have it actua

[Tutor] 6 random numbers

2011-10-16 Thread ADRIAN KELLY
hello all, anyone know how i would go about printing 6 random numbers, i know i could copy and paste 6 times (which would work) but i was thinking about a while loop, ie. while lottery_numbers.count is <7. Is it possible to code this? is it possible to count random variables? i am trying to ke

Re: [Tutor] Socket and Ports

2011-10-16 Thread Jacob Bender
Thank you, and I'm not planning on executing any data I receive from anybody. So I should be pretty safe... On Sun, Oct 16, 2011 at 10:48 AM, Hugo Arts wrote: > On Sun, Oct 16, 2011 at 4:20 PM, bob gailer wrote: > > On 10/16/2011 8:28 AM, Jacob Bender wrote: > >> > >> Dear Tutors, > >> > >>

Re: [Tutor] Can I set LD_LIBRARY_PATH within a .py file?

2011-10-16 Thread Albert-Jan Roskam
Hi Hugo,   You are absolutely right. Thank you! It took me a lot of reading and tinkering to find out that typing the following in the terminal works: export LD_LIBRARY_PATH=\path\to\the\lib python main.py # contains import to my program + calls to the functions in it.   I find it strange though,

Re: [Tutor] Bounded Linear Search

2011-10-16 Thread toganm
Peter Otten wrote: > To verify that the algorithm is correct now you could walk through > increasingly more complex sample data, which may be possible in this case, > but rarely ever for an entire script. Instead the common approach is to > pick a few samples along with the expected outcomes, feed

Re: [Tutor] Socket and Ports

2011-10-16 Thread Hugo Arts
On Sun, Oct 16, 2011 at 4:20 PM, bob gailer wrote: > On 10/16/2011 8:28 AM, Jacob Bender wrote: >> >> Dear Tutors, >> >>     I've been having an issue with socket. I wanted to use it for >> transmitting strings over the Internet. > > That's good, because strings is all you can transmit. > >> The p

Re: [Tutor] Bounded Linear Search

2011-10-16 Thread Peter Otten
tog...@users.sourceforge.net wrote: > Hi, > I am trying to learn programming and python and one of the books I use has > an exercise for "Bounded Linear Search algorithm" under the heading in > Accumulating Unique Values at >

Re: [Tutor] Socket and Ports

2011-10-16 Thread bob gailer
On 10/16/2011 8:28 AM, Jacob Bender wrote: Dear Tutors, I've been having an issue with socket. I wanted to use it for transmitting strings over the Internet. That's good, because strings is all you can transmit. The problem is that my friend insists that allowing python to transmit and

[Tutor] Bounded Linear Search

2011-10-16 Thread toganm
Hi, I am trying to learn programming and python and one of the books I use has an exercise for "Bounded Linear Search algorithm" under the heading in Accumulating Unique Values at I have coded the

[Tutor] Socket and Ports

2011-10-16 Thread Jacob Bender
Dear Tutors, I've been having an issue with socket. I wanted to use it for transmitting strings over the Internet. The problem is that my friend insists that allowing python to transmit and receive information via an Internet port is a bad idea. He claimed that I could(and probably would) rec

Re: [Tutor] Python Job Scheduling package

2011-10-16 Thread Rafael Durán Castañeda
And what about celery??? 2011/10/16 Steven D'Aprano > bod...@googlemail.com wrote: > >> Have you thought about writing your own? Others have posted some >> useful links, but in all honesty you could hack something together to >> achieve that in next to no time >> > > Anyone can "hack something to

Re: [Tutor] Running a loop

2011-10-16 Thread Peter Otten
Jason Barry wrote: > I am using Windows 7 and python 3.1. This is a block from a slot machine > code. It takes the random generated words and indicates if it wins or > loses. I can't figure out why it wants to print the last print statement > 'Loser' no matter if the elif statements are true. > >