Python from within irb :)

Welcome to Darwin!
my-mac-mini:~ rbt$ irb
irb(main):001:0> puts RUBY_PLATFORM
powerpc-darwin8.0
=> nil
irb(main):002:0> system(‘python’)
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import sys
print sys.platform
darwin

exit
‘Use Ctrl-D (i.e. EOF) to exit.’

^D
=> true
irb(main):003:0>

Brad T. wrote:

[stuff]

Yeah, works the other way too…

$ python
Python 2.5 (r25:51908, Sep 19 2006, 22:49:50)
[GCC 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.9)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import os
print os.sys.platform
linux2

os.system(‘irb’)
irb(main):001:0> RUBY_PLATFORM
i686-linux
irb(main):002:0> exit
0

Regards,
Jordan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs