Python笔记之——ipython

1、ipython安装:

$apt-get install python-ipython

2、ipython是*nux下增强的python shell工具,支持TAB补全 羡慕、集成部分linux命令如ls、cd,执行ipython直接运行:

root@ubuntu:~# ipython
Python 2.7.2+ (default, Oct  4 2011, 20:03:08) 
Type "copyright", "credits" or "license" for more information.

IPython 0.10.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: ls
Desktop/    Downloads/	NetBeansProjects/  Public/     Videos/
Documents/  Music/	Pictures/	   Templates/

In [2]: cd D
Desktop/    Documents/  Downloads/  

In [2]: cd Documents/
/root/Documents

In [3]: !ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0c:29:d1:2d:f9  
          inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed1:2df9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34853 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21183 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:32258139 (32.2 MB)  TX bytes:5295207 (5.2 MB)
          Interrupt:19 Base address:0x2000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1106 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:188776 (188.7 KB)  TX bytes:188776 (188.7 KB)


In [4]: %
%Exit            %debug           %logstop         %prun            %runlog
%Pprint          %dhist           %lsmagic         %psearch         %save
%Quit            %dirs            %macro           %psource         %sc
%alias           %doctest_mode    %magic           %pushd           %store
%autocall        %ed              %p               %pwd             %sx
%autoindent      %edit            %page            %pycat           %system_verbose
%automagic       %env             %paste           %quickref        %time
%bg              %exit            %pdb             %quit            %timeit
%bookmark        %hist            %pdef            %r               %unalias
%cd              %history         %pdoc            %rehash          %upgrade
%clear           %logoff          %pfile           %rehashx         %who
%color_info      %logon           %pinfo           %rep             %who_ls
%colors          %logstart        %popd            %reset           %whos
%cpaste          %logstate        %profile         %run             %xmode

In [4]: import p
pango               pildriver           posix               pyatspi
pangocairo          pilfile             posixfile           pyclbr
papyon              pilfont             posixpath           pycurl
paramiko            pilprint            pprint              pydoc
parser              pipes               problem_report      pydoc_data
pcardext            piston_mini_client  profile             pyexpat
pdb                 pkg_resources       pspersistence       pygst
pexpect             pkgutil             pstats              pygtk
pickle              platform            pty                 pyinotify
pickleshare         plistlib            pwd                 pynotify
pickletools         popen2              pxssh               pyparsing
pilconvert          poplib              py_compile          

In [4]: import paramiko

In [5]: c = paramiko.SSHC
paramiko.SSHClient  paramiko.SSHConfig  

In [5]: c = paramiko.SSHClient()

In [6]: c.
c.__class__                    c.__setattr__                  c._transport
c.__delattr__                  c.__sizeof__                   c.close
c.__dict__                     c.__str__                      c.connect
c.__doc__                      c.__subclasshook__             c.exec_command
c.__format__                   c.__weakref__                  c.get_host_keys
c.__getattribute__             c._agent                       c.get_transport
c.__hash__                     c._auth                        c.invoke_shell
c.__init__                     c._host_keys                   c.load_host_keys
c.__module__                   c._host_keys_filename          c.load_system_host_keys
c.__new__                      c._log                         c.open_sftp
c.__reduce__                   c._log_channel                 c.save_host_keys
c.__reduce_ex__                c._policy                      c.set_log_channel
c.__repr__                     c._system_host_keys            c.set_missing_host_key_policy


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值