473,770 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ipython instrospection like editor,ide


Hi,i wonder if there is an editor or ide that has similar dinamic
instrospection features as ipython? ,since i have failed to find one, i
spend more time coding in ipython than in my editor.

Well the feature i need the most is tab introspection since python has so
many libraries and functions that is imposible to remember all of them.For
example when i type urllib2.<tab> i get:

urllib2.Abstrac tBasicAuthHandl er urllib2.__class __
urllib2.mimetoo ls
urllib2.Abstrac tDigestAuthHand ler urllib2.__delat tr__
urllib2.mimetyp es
urllib2.Abstrac tHTTPHandler urllib2.__dict_ _
urllib2.noheade rs
urllib2.BaseHan dler urllib2.__doc__
urllib2.os
urllib2.CacheFT PHandler urllib2.__file_ _
urllib2.parse_h ttp_list
urllib2.CustomP roxy urllib2.__getat tribute__
urllib2.parse_k eqv_list

<skip>..

I also made a function that gives me a quickly overview of an objects,for
example when i type h(urllib2) i get :

AbstractBasicAu thHandler <c> : Non
AbstractDigestA uthHandler <c> : Non
AbstractHTTPHan dler <c> : Non
BaseHandler <c> : Non
CacheFTPHandler <c> : Non
CustomProxy <c> : Non
CustomProxyHand ler <c> : Non
socket <m> : This module provides socket operations and some related
splitattr <f> : splitattr('/path;attr1=valu e1;attr2=value2 ;...') ->
splitgophertype <f> : splitgophertype ('/Xselector') --> 'X', 'selector'
splithost <f> : splithost('//host[:port]/path') --> 'host[:port]', '/path'
splitpasswd <f> : splitpasswd('us er:passwd') -> 'user', 'passwd'
splitport <f> : splitport('host :port') --> 'host', 'port'
splitquery <f> : splitquery('/path?query') --> '/path', 'query'
splittype <f> : splittype('type :opaquestring') --> 'type', 'opaquestring'
splituser <f> : splituser('user[:passwd]@host[:port]') --> 'user[:passwd]',
unquote <f> : unquote('abc%20 def') -> 'abc def'
unwrap <f> : unwrap('<URL:ty pe://host/path>') --> 'type://host/path'
url2pathname <f> : Non
urlopen <f> : Non
urlparse <m>
Well,i would like similar functionality in the enviroment that i am coding
in, i hate having to go to the interactive shell every 7 seconds to type
'h(<class name>)' for example.

The code for my help function (is sucky since i have had so much trouble
finding the types of some objects and doesnt work for some modules):

import sgmllib
import types

def h(name,display= 'all',allow_her encia=False):
'''name-> any object name that is not an instance(module ,attr,func)
display-> all | m | f | c | a ie : m = module
allow_Herencia True | False

Display object's information for a quick overview
'''

if allow_herencia == True : iter = dir(name)
else :
iter = name.__dict__.k eys()
iter.sort()

for x in iter:

attr = getattr(name,x)

try: ## can be better with hasattr() builtin
doc = str(attr.__doc_ _)
except:
print ' %s %s' % (x,attr)
continue
else :

limit = doc.find('\n')
doc = doc[:limit]
membertype = __gettype(attr)

if display is membertype or display is 'all': print ' %s <%s> : %s'
% (x,membertype,d oc)
def __gettype(attr) :
## needs reworking
t = type(attr)
#print t

if t is types.ModuleTyp e : return 'm'

elif t is type(str.isuppe r) or\
t is types.BuiltinFu nctionType or\
t is types.FunctionT ype or\
t is types.UnboundMe thodType or\
t is '<type \'instancemetho d\'>' :

return 'f'

elif t is type(str.__eq__ ) : return 'w' #wraper

elif t is types.TypeType or t is type(sgmllib.SG MLParser): return 'c'

else: return 'a'

Jul 18 '05 #1
1 1514
>>>>> "Ismael" == Ismael Herrera <is************ *****@hotmail.c om> writes:

Ismael> Hi,i wonder if there is an editor or ide that has similar
Ismael> dinamic instrospection features as ipython? ,since i have
Ismael> failed to find one, i spend more time coding in ipython
Ismael> than in my editor.

Eclipse + pydev has code completion, i.e if you type

"os."

It gives you the list of all the stuff in os.

--
Ville Vainio http://tinyurl.com/2prnb
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1284
by: Fernando Perez | last post by:
Hi all, The IPython team is happy to release version 0.7.2, with a lot of new enhancements, as well as many bug fixes. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? ----------------
0
1405
by: James Stroud | last post by:
Hello, I found this page: http://projects.scipy.org/ipython/ipython/wiki/CookBook#Usinggviminservermode But it does not seem to work for me. I set the editor in ipythonrc to gvim. Then I followed the instructions, step by step. To needlessly paraphrase the instructions:
1
4832
by: Karlo Lozovina | last post by:
Based on the idea from 'Open Command Window Here' utility from MS - add a context menu item, which allows you to open IPython in selected directory. ---cut-here--- Windows Registry Editor Version 5.00 @="IPython here"
2
2358
by: Greg Donald | last post by:
Anyone know what's up with environment variables when using ipython? When I type 'env' and hit return I get a dictionary full of useful information (trimmed for brevity): In : env Out: {'EDITOR': '/usr/bin/vim', '_': '/Library/Frameworks/Python.framework/Versions/Current/bin/ipython',
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.