Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Beginners question about debugging (import)

Reply
Thread Tools

Beginners question about debugging (import)

 
 
Albert van der Horst
Guest
Posts: n/a
 
      01-22-2008
I'm starting with Python. First with some interactive things,
working through the tutorial,
then with definitions in a file called sudoku.py.
Of course I make lots of mistakes, so I have to include that file
time and again.

I discovered (the hard way) that the second time you invoke
from sudoku.py import *
nothing happens.

There is reload. But it only seems to work with
import sudoku

Now I find myself typing ``sudoku.'' all the time:

x=sudoku.sudoku()
y=sudoku.create_set_of_sets()
sudoku.symbols

Is there a more convenient way?

(This is a howto question, rather difficult to get answered
from the documentation.)

Groetjes Albert



~

--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      01-22-2008
Albert van der Horst schrieb:
> I'm starting with Python. First with some interactive things,
> working through the tutorial,
> then with definitions in a file called sudoku.py.
> Of course I make lots of mistakes, so I have to include that file
> time and again.
>
> I discovered (the hard way) that the second time you invoke
> from sudoku.py import *
> nothing happens.
>
> There is reload. But it only seems to work with
> import sudoku
>
> Now I find myself typing ``sudoku.'' all the time:
>
> x=sudoku.sudoku()
> y=sudoku.create_set_of_sets()
> sudoku.symbols
>
> Is there a more convenient way?
>
> (This is a howto question, rather difficult to get answered
> from the documentation.)


import sudoku as s

However, I find it easier to just create a test.py and run that from the
shell. For the exact reason that reload has it's caveats and in the end,
more complex testing-code isn't really feasible anyway. If you need to,
drop into the interactive prompt using

python -i test.py

Diez
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I skip debugging Ajax when debugging my code? AAaron123 ASP .Net 3 07-28-2009 04:07 PM
Debugging C vs debugging C++ jacob navia C Programming 11 10-27-2006 07:19 PM
Beginners Question CHAZDG Wireless Networking 2 11-10-2005 12:29 AM
Beginners question about DataGrid and page selection Alex ASP .Net 1 04-19-2004 08:36 PM
No Debugging of C# Server-Side Script, but Code-Behind Debugging Works Johann Blake ASP .Net 1 01-05-2004 03:01 PM



Advertisments