[Tutor] opening multiple connections to a port

2006-05-09 Thread Payal Rathod
Hi, I have to see how many open connection can a particular service handle. So, I want to similuate something like this but using Python. telnet I will be keeping these connections open for around 60 seconds. Can anyone tell me how do I start with this in Python? I read a bit about telnetlib,

[Tutor] Alan Gauld's tut - namespaces

2006-04-26 Thread Payal Rathod
Hi, In Alan's tutorial I haven't got the example of print42() even after reading the explanation. I get 110 if I use it as a function. >>> spam = 42 >>> def print42(): print spam ... >>> spam = 110 >>> print42() 110 Why do you get 42 when you use it as module? I haven't understood the explantai

Re: [Tutor] need to automate connection

2006-04-25 Thread Payal Rathod
On Tue, Apr 25, 2006 at 06:59:29PM +1200, Liam Clarke wrote: > Hi Payal, > > I see you're connecting to an smtp server Any particular reason yoou > can't use smtplib? > http://www.python.org/doc/current/lib/module-smtplib.html Because I don't know it exists :) But I don't want to send any mail.

[Tutor] need to automate connection

2006-04-24 Thread Payal Rathod
Hi, I need to automate connection to a IP like this. The IP (or domain name) is taken from command line or from user (whichever is easier for me to code). It should emulate, telnet 127.0.0.1 25 mail from: 250 ok rcpt to: <[EMAIL PROTECTED]> 250 ok quit Can Python do this for me? How do I star

[Tutor] wanted exercises in python

2006-04-18 Thread Payal Rathod
Hi, As I mentioned I have been reading Python a lot in last 2 months but lack of examples and coding is not getting me anywhere. Can someone give me some exercises or I can try them myself (pythonchallenge.com please excuse). I am reading Alan's tut now and covered Basis set and regex from adv

Re: [Tutor] Alan Gauld Tutorial - OOP

2006-04-18 Thread Payal Rathod
On Tue, Apr 18, 2006 at 03:29:28PM +0100, Alan Gauld wrote: > Have you read through the basics section of the tutor or are you > simply picking topics of intrest? You can do that with the advanced No, I read the tutorial from start. I am not understanding how data, objects, attributes etc. are

Re: [Tutor] Alan Gauld Tutorial - OOP

2006-04-18 Thread Payal Rathod
On Tue, Apr 18, 2006 at 11:19:32AM +0100, Alan Gauld wrote: > I mean the data and the functions that are used to create an object. > As the definition above states, objects are collections of data and > the functions that operate on the data. Another name for a function > inside an object is "oper

Re: [Tutor] functions in Python

2006-04-18 Thread Payal Rathod
On Mon, Apr 17, 2006 at 10:31:04AM -0700, Danny Yoo wrote: > One view that's common is the idea that a function is a box that takes > an input and returns an output: Thanks a lot for the detailed help. Well, I have now got atleast basics of functions, will be doing some more reading on it in nex

[Tutor] Alan Gauld Tutorial - OOP

2006-04-18 Thread Payal Rathod
Hi, I am reading Alan's tut and have stuck on the OOP chapter. What does he mean by, | Objects are collections of data and functions that operate on that |data. These are bound together so that you can pass an object from one |part of your program and they automatically get access to not only

Re: [Tutor] functions in Python

2006-04-17 Thread Payal Rathod
On Mon, Apr 17, 2006 at 05:42:05PM +0100, Steve Nelson wrote: > When you define a function, you are writing a block of code which you > can ask to perform a task. The task may be simple, and not require > any additional information, or it may be more complex and need > information. What is the di

Re: [Tutor] functions in Python

2006-04-17 Thread Payal Rathod
On Mon, Apr 17, 2006 at 05:10:51PM +0100, Robert Schumann wrote: > You could say "I kick" (which is like func(), because you're not > specifying an object to operate on) or your could say "I kick the > ball" (in which case x = "the ball"). > Sorry, but you have confused me more ;) Can you give

Re: [Tutor] functions in Python

2006-04-17 Thread Payal Rathod
On Mon, Apr 17, 2006 at 05:02:07PM +0100, Adam wrote: > The x is a name for a value that you pass in to the function. To call > the first function you would do > >>> func() > > and the second function: > >>> func(5) # 5 is just an example it could be any value depending on > the function. Sorry b

[Tutor] functions in Python

2006-04-17 Thread Payal Rathod
Hi, I am now reading Alan's tut on Python, before that I have read a few other tuts too. But I am not getting functions exactly. I mean what is the difference between, def func(): and def func(x): When to use which? (please do not say "returns a value" for I do not un

Re: [Tutor] failing to learn python

2006-04-12 Thread Payal Rathod
On Tue, Apr 11, 2006 at 07:35:15PM +0100, Alan Gauld wrote: > Python is a general programmjing language great for bigger jobs. If But what does Python excel at. That si my main question. Whatevfer I think of I can already do or know a way to do in shell. I am not getting where would I need Pyt

Re: [Tutor] failing to learn python

2006-04-11 Thread Payal Rathod
On Mon, Apr 10, 2006 at 04:20:37PM -0700, Danny Yoo wrote: > http://gnosis.cx/TPiP/ I will read that and Alan's tutorial too (isn't that MS-Windows specific ???) The reason I am disgrunted with Python is because lack of good documentation. Shell programming has great text and so do sed and

Re: [Tutor] failing to learn python

2006-04-10 Thread Payal Rathod
On Mon, Apr 10, 2006 at 10:05:45AM -0400, Kent Johnson wrote: > You might like to look at "Python Programming for the absolute > beginner". It is oriented to beginners and has many examples and > exercises. I might not be able to afford another book, due to high dollar-to-ruppee rate. > What k

[Tutor] failing to learn python

2006-04-10 Thread Payal Rathod
Hi, I am trying to learn Python seriously for almost 2 months but have not gotten far at all. Infact, it seems I have not understood even the basic concepts itself. I know some shell, sed and awk programming. I have tried reading Learning Python - Mark Lutz Think C Spy A byte of Python Non-Progr