So basically, looking around stack overflow I have been able to find subprocess and try to run the program from Python's side. I guess it worked partially because while the R Studio program pops up, nothing runs it just shows up and does nothing. Is there a way I can modify the code so that the entire R code runs just by using Python? Thank you!
import subprocess
ShowText = input("Please enter your name: ")
myfile = open("logo2.txt","w+")
font = ImageFont.truetype('verdanab.ttf', 24)
size = font.getsize(ShowText)
image = Image.new('1', size, 1)
draw = ImageDraw.Draw(image)
draw.text((0, 0), ShowText, font=font)
myfile.write(f"{size[0]}\t{size[1]}\n")
for row in range(size[1]):
line = []
for col in range(size[0]):
if image.getpixel((col, row)):
line.append('0\t')
else:
line.append('1\t')
myfile.write('\n')
myfile.write(''.join(line))
myfile.close()
subprocess.call([r"C:/Program Files/RStudio/bin/rstudio", '-f', r'C:/Users/Me/Documents/Trials/Plotting.R'])