"Pythoner",Wish me luck!

H

Hendrik van Rooyen

Good luck!

Don't forget to...

This is better advice than what you may think,
because the interactive interpreter is your very
best friend when studying the language.

You get there by typing "python" at the command
line, and pressing enter.

Using it, you will save yourself many hours of
misunderstanding.

- Hendrik
 
B

barisa

This is better advice than what you may think,
because the interactive interpreter is your very
best friend when studying the language.

You get there by typing "python" at the command
line, and pressing enter.

Using it, you will save yourself many hours of
misunderstanding.

- Hendrik

Hi,
I'm also begginer in python;
i did few basic programs about graph etc..

my question is : what benefit is using interactive intrepreter ?

i come from java backround, so I use eclipse for python as well.
I start my program, it does it's job, and that's it. (after some
debugging ofc)
 
N

nrballard

Hi,
I'm also begginer in python;
i did few basic programs about graph etc..

my question is : what benefit is using interactive intrepreter ?

i come from java backround, so I use eclipse for python as well.
I start my program, it does it's job, and that's it.  (after some
debugging ofc)

I'm also a beginner in Python, but from my own experience the
interactive interpreter is great for experimenting with new modules
and output formatting because it allows you to see the immediate
output of a function before you write it into your program. The
immediate result is that you'll see any errors and be able to fix them
before they end up in your script.

Nick Ballard
http://90daysofpython.blogspot.com
 
B

barisa

I'm also a beginner in Python, but from my own experience the
interactive interpreter is great for experimenting with new modules
and output formatting because it allows you to see the immediate
output of a function before you write it into your program.  The
immediate result is that you'll see any errors and be able to fix them
before they end up in your script.

Nick Ballardhttp://90daysofpython.blogspot.com

thanks, i'll give it a try
 
K

Krishnakant

hello all,
I am thinking of using the doctest module for my unit testing code in
python.
I have no problems doing this in usual classes but I am a bit confused
with my twisted based rpc classes.

given that I directly take the output of running functions on a python
prompt for the dockstrings, how do I get them for my twisted class which
has a published object?

What I mean is that in normal classes I would just start the python
prompt, import the module, create the object and run the methods to get
the output.

Then I take the output and put it into a file and then use those
dockstrings for my tests.
As you all know an rpc server app can't be run like this. To my
knowledge an rpc server is a service that listens on a port on the given
ip address.

So how do I extract the dockstrings from the functions inside my xmlrpc
class?
obviously it is not run on a python prompt, so what is the solution?

happy hacking.
Krishnakant.
 
G

George Sakkis

thanks, i'll give it a try

Or even better, install IPython [1], a python interpreter on steroids.
It's the first 3rd party python package I install on every new system
I work on; it's so powerful and versatile, it has almost displaced the
regular linux shell for me. I highly recommend it.

George

[1] http://ipython.scipy.org/
 
H

Hendrik van Rooyen

barisa said:
Hi,
I'm also begginer in python;
i did few basic programs about graph etc..

my question is : what benefit is using interactive intrepreter ?

i come from java backround, so I use eclipse for python as well.
I start my program, it does it's job, and that's it. (after some
debugging ofc)
The Interactive Interpreter is not intended to be a development
environment, (although you can use it like that for small things)
but it is very handy to do simple tests in when you are not sure
that you understand what some new (to you) language feature
does exactly.
In this way you can "test bench" small snippets of code, which
makes subsequent debugging of your program less onerous,
and makes it more likely that the "job" your program does is
in fact the "job" that you imagined it should do when you started
to write it.
So, for instance, lets say that it is the first time that you use
the append method of the built in list class, and you are not sure
what it returns.
you have two basic options - you can either go look for the
documentation and RTFM, or you can go into your active
interpreter and just try it.
The second alternative is often the quickest, and it is definitely
the safest, because what happens is the definitive behaviour
of your installation.
Reading the manual carries the following risks:
- It could be the wrong manual
- The manual and the code may not be congruent

Another reason for using the II is to help you discover stuff.
Calling dir(something) can teach you quite a lot that is of
practical import.

And then there is the help system too.

hth - Hendrik
 
J

Jeroen Ruigrok van der Werven

-On [20090403 20:35] said:
my question is : what benefit is using interactive intrepreter ?

Install ipython.

It's an extension wrapper around the interactive shell and allows a lot of
very nice features in additional to the standard shell, such as tab
completion.

The benefit is easily testing code snippets, inspecting the contents of
various variables, modules, classes, and so on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top