[IronPython] dir and urllib (utter newbie questions)

2007-07-14 Thread David Seruyange
I'm very new to Python and had a few questions.  Does dir() only work from the 
ipy interpreter?  If I attempt the following: 

 from System import *
 dir()

It sucesssfully prints everything available but when I try the two lines of 
code from a script and run:

ipy test.py 

Nothing prints.

One more question: does urllib come with Iron Python?  I'm aware that I can use 
.NET classes such as System.Net.WebClient but I guess I was trying to be 
pythonic.

Thanks much, 

David 




   

Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] dir and urllib (utter newbie questions)

2007-07-14 Thread Curt Hagenlocher

On 7/14/07, David Seruyange [EMAIL PROTECTED] wrote:


I'm very new to Python and had a few questions.  Does dir() only work from
the ipy interpreter?  If I attempt the following:

 from System import *
 dir()

It sucesssfully prints everything available but when I try the two lines
of code from a script and run:

ipy test.py

Nothing prints.



That's because dir() doesn't print anything.  It merely returns a list of
values that the interpreter prints.  When you run it from the file, there
isn't a command line interpreter printing the results of any expressions.
If you said print dir() instead of just dir(), your program would do
what you expect.

One more question: does urllib come with Iron Python?




None of the standard Python library comes with IronPython, but the intent
for IronPython is that it should support the standard Python library, so you
could just download CPython and try to use it.  Alternatively, check out
http://fepy.sourceforge.net/ as a one-stop-shop.

--
Curt Hagenlocher
[EMAIL PROTECTED]
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com