Questions tagged [rpython]

RPython (Restricted Python) is a restricted subset of the Python programming language

RPython (Restricted Python) is a restricted subset of the programming language used to write the PyPy Python interpreter. Unlike standard Python, RPython is statically typed, to allow efficient compilation.

More information about RPython can be found in the Pypy coding guide, especially regarding the restrictions when using RPython compared to Python.

63 questions
0
votes
0 answers

How to use rpython translator to convert my python script into pypy?

I am using python 3.7 in windows 10 64-bit platform. My python script contains mainly pyopengl graphics. My application works okay with python but I want to speed it up so I am trying to use pypy3 interpreter but while running it shows below…
0
votes
0 answers

rPython can't find Pandas

I seem to be having trouble with running a python app on my shiny server with rPython. I set my python sys path, Sys.setenv(PATH = paste("/Users/timmcwilliams/anaconda2/bin/", Sys.getenv("PATH"),sep=":")) Then I checked if it worked with, …
0
votes
1 answer

Calling Python code from R

I am trying to call my python code from R. This is a simple code i have tried. import tensorflow as tf a1=tf.constant(23) b1=tf.constant(25) s1=tf.Session() with tf.Session() as s1: out=s1.run(a1+b1) print (out) Using rPython (R-library)…
9113303
  • 852
  • 1
  • 16
  • 30
0
votes
1 answer

RPython: Is it possible to specify/enforce a type on a variable?

I'm using os.read() to read a files' binary contents into a list. PyPy seems to have determined that all elements of the list will be of type int. Would it be possible to explicitly annotate the variable such that all elements will be considered to…
2080
  • 1,223
  • 1
  • 14
  • 37
0
votes
1 answer

Using the rPython package for creating and "getting" a numpy array

I am trying to create a Rpackage that uses some python in it, in an attempt to better understand the rPython package I tried creating and getting back a Numpy Array: This part works library(rPython) python.exec( "import os" ) python.exec( "import…
Derek Corcoran
  • 3,930
  • 2
  • 25
  • 54
0
votes
1 answer

Using rPython import numpy with python 3.5

My R version is 3.4.1, python version is 3.5.2 , and OS is Ubuntu 16.04.2 I have set RPYTHON_PYTHON_VERSION=3.5 when installing rPython, which is my default python version for rPython. ♥ python.exec('import sys') ♥…
Yao Lin
  • 3
  • 2
0
votes
1 answer

Unable to locate to the right version of python on Mac

The big picture: I am trying to let rPython package run python scripts that have packages such as numpy, scipy, and scikit-learn. Now, if that is an impossible task, please let me know right away, because I have spent over 10 hours on this problem…
Waht
  • 301
  • 4
  • 14
0
votes
1 answer

How do you import a Python library within an R package using rPython?

The basic question is this: Let's say I was writing R functions which called python via rPython, and I want to integrate this into a package. That's simple---it's irrelevant that the R function wraps around Python, and you proceed as usual. e.g. #…
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
0
votes
1 answer

Python code integration in R: works while development but not after release

I am developing a R package on RStudio platform. I have many functions written in python which I want to call using R. For now I just implemented a simple reverse complement function for a DNA sequence. While writing and building the project on…
0
votes
1 answer

R rPython remote computer's python

I want to build a Shiny app and control some hardware through it by using a raspberry pi's GPIO pins. If I install R on pi itself and use code like library(rPython) python.exec(" import RPi.GPIO as GPIO import time …
anonR
  • 849
  • 7
  • 26
0
votes
1 answer

Transforming a checkboxGroupInput object into a vector

After a long time searching for a possible answer I am still unable to create a character vector out of a user input (specifically checkboxGroupInput). My ultimate purpose is to pass the user selected entries from checkboxGroupInput into a python…
0
votes
2 answers

Random String generator python

I made a simple program in Python to generate a random string with 5 numbers in it: import random numcount = 5 fstring = "" for num in range(19): #strings are 19 characters long if random.randint(0, 1) == 1: x = random.randint(1, 26) …
KnightOfNi
  • 770
  • 2
  • 10
  • 17
0
votes
2 answers

RPython ord() with non-ascii character

I'm making a virtual machine in RPython using PyPy. My problem is, that I am converting each character into the numerical representation. For example, converting the letter "a" provides this result, 97. And then I convert the 97 to hex, so I get:…
user3566150
  • 233
  • 1
  • 3
  • 10
0
votes
1 answer

Stack Machine with Strings

I'm making a stack based virtual machine in RPython using the PyPy toolchain to convert the RPython to C. So far I have 4 instructions. EOP - End of Program EOI - End of Instruction PUSH - Push item onto the stack PRINT - Print the top of the…
user3452305
  • 27
  • 1
  • 4
0
votes
2 answers

rpy2 module is invisible from python 2.7 on Mac 10.6.8

I am a bit of a noob on Mac and my python installation is refusing to acknowledge the existence of the rpy2 module on my mac. It looks like it only sees it as a Python 2.6 module. How do I make it visible in 2.7 ? Do I need to downgrade my python ?…
crogg01
  • 2,446
  • 15
  • 35