Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [perl-python] 20050120 find functions in modules

Reply
Thread Tools

[perl-python] 20050120 find functions in modules

 
 
Xah Lee
Guest
Posts: n/a
 
      01-20-2005
# -*- coding: utf-8 -*-
# Python

# once a module is loaded
# import mymodule
# one can find all the names it
# export with dir()

import sys
print dir(sys)

# without argument it gives the names
# you've defined
print dir()

# to find a list of built-in names
# import the module __builtin__
# and use dir on it.
import __builtin__
print dir(__builtin__)

# see
# http://python.org/doc/2.3.4/tut/node8.html

----------------
# in Perl, Perl experts can achieve
# similar functionality by, for example:

use Data:umper ('Dumper');
print Dumper \%Data:umper::;

# it has to do with understanding the inner
# mechanisms of Perl's module system.

---------------

Note: this post is from the Perl-Python
a-day mailing list at
http://groups.yahoo.com/group/perl-python/
to subscribe, send an email to
perl-python-subscribe @ yahoogroups.com if
you are reading it on a web page,
program examples may not run because
html conversion often breaks the code.

Xah
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://xahlee.org/PageTwo_dir/more.html

 
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 to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 0 02-10-2011 05:18 PM
Find.find does not find orphaned links? Wybo Dekker Ruby 1 11-15-2005 02:50 PM
[perl-python] 20050120 find functions in modules Xah Lee Perl Misc 0 01-20-2005 07:50 AM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM



Advertisments