Created
September 3, 2016 22:44
-
-
Save emanuelhfarias/f5506d7da9da528fc825fa26dec93c01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----> Ruby File: hi.rb | |
# Importing code from Python to Ruby | |
p obj = eval(`python hi.py`.chomp) | |
# Exporting code from Ruby to Python | |
p my_array = [[1,2,3],["hi", 1.5]] | |
# Executing Python code 'inside' Ruby passing args from ruby variables to python | |
p obj = eval(`python hi.py '#{my_array}'`.chomp) | |
# ---> Python file: hi.py | |
# Exporting code from Python to Ruby | |
my_array = [[1,2,3],["hi", 1.5]] | |
print(my_array) | |
# Importing code from Ruby to Python | |
import subprocess | |
obj = eval(subprocess.check_output("ruby hi.rb", shell=True).rstrip('\n')) | |
print(type(obj)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment