Skip to content

Instantly share code, notes, and snippets.

@liluo
Created June 11, 2012 01:37
Show Gist options
  • Save liluo/2908037 to your computer and use it in GitHub Desktop.
Save liluo/2908037 to your computer and use it in GitHub Desktop.
rubypython test
1.9.2p320 :001 > require 'rubypython'
=> true
1.9.2p320 :002 > RubyPython.start
=> true
1.9.2p320 :003 > sys = RubyPython.import('sys')
=> <module 'sys' (built-in)>
1.9.2p320 :004 > sys.path.append('/var/shire')
=> None
1.9.2p320 :005 > user = RubyPython.import('luzong.user')
=> <module 'luzong.user' from '/var/shire/luzong/user/__init__.pyc'>
1.9.2p320 :006 > me = user.get_user('51789002')
=> User(id='51789002', uid='urllib2', name='\xe8\xbd\xae\xe6\xbb\x9101\xe5\x8f\xb7\xe9\x80\x89\xe6\x89\x8b')
1.9.2p320 :007 > me.url()
=> 'http://www.douban.com/people/urllib2/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment