Re: [Tutor] Guess the number

2015-05-11 Thread Kewal Patel
i don't know if this is efficient but i think it works just fine import random # input a number from user input_number = input("Enter a number") #function defination def guess_number(start,stop): global input_number try: g_number = random.randrange(start,stop) if g

[Tutor] TCP server/client application failing. Need some help with the basics!

2015-05-11 Thread Anubhav Yadav
I am very new to python. I have been a very mediocre programmer, but now I have decided that I want to level up as a programmer. I wanted to write a simple TCP client/server (where in the server acts as a simple TCP Listener). I searched on the forums and I saw that people advised using frameworks

Re: [Tutor] TCP server/client application failing. Need some help with the basics!

2015-05-11 Thread Alan Gauld
On 11/05/15 21:07, Anubhav Yadav wrote: I wanted to write a simple TCP client/server (where in the server acts as a simple TCP Listener). I searched on the forums and I saw that people advised using frameworks like twisted and sync.io for client server applications to take advantage of asynchron

[Tutor] reading lines from a list of files

2015-05-11 Thread Alex Kleider
Is there a better (more 'Pythonic') way to do the following? for f_name in f_names: with open(f_name, 'r') as f: for line in f: As always, thank you, tutors, for all you are doing. AlexK ___ Tutor maillist - Tutor@python.org

Re: [Tutor] reading lines from a list of files

2015-05-11 Thread Peter Otten
Alex Kleider wrote: > Is there a better (more 'Pythonic') way to do the following? > > for f_name in f_names: > with open(f_name, 'r') as f: > for line in f: There's the fileinput module but persona