简体   繁体   中英

Python and R interaction

I need to call an R script from Python, but my challenge is to call a specific R environment (32bit) is this possible?

A bit more color on my issue. I use python 64 bit and need to connect to a 32 bit teradata dns, unfortunately I can not change the odbc drivers, thus not able to run my teradata from python 64bit. I already have R 32 and 64 bit, and would like to be able to call my script on my R32bit. Is this possible?

Unfortunately,I am not allowed to install Python 32bit.

I currently use Windows 7 with Python 64 and R 64 and 32bit version.

Regards, Aksel

As suggested by the two complementing comments, the solution is to use python's subprocess to call the R script using the relevant built.

import subprocess
subprocess.call(["FullPath/R3.4.3/bin/i386/Rscript.exe","FullPathe/test.R"])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM