[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

python from within irb :

Brad Tilley

9/22/2006 6:48:00 PM

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>

--
Posted via http://www.ruby-....

1 Answer

MonkeeSage

9/22/2006 7:27:00 PM

0

Brad Tilley 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