diff options
author | TinWoodman92 <chrhodgden@gmail.com> | 2023-04-05 15:52:16 -0500 |
---|---|---|
committer | TinWoodman92 <chrhodgden@gmail.com> | 2023-04-05 15:52:16 -0500 |
commit | f09553ec2061291b8b709d1e289f8a1ca6c2bc08 (patch) | |
tree | c491e5f8150ff0ef6b2142b999106a1c7a383c31 |
Initial commit
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | launcher.py | 26 |
2 files changed, 28 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7fa322a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*demo* +notes.txt
\ No newline at end of file diff --git a/launcher.py b/launcher.py new file mode 100644 index 0000000..31713f4 --- /dev/null +++ b/launcher.py @@ -0,0 +1,26 @@ +import idlelib +import os +from subprocess import * + +# If I can't find the R path, I could have a dedicated r procedure that finds R.home() and puts that into a text file. + +print(os.getcwd()) + +#open demp.py +# demo_fil = os.path.join(os.getcwd(),'demo.py') +# if os.path.exists(demo_fil): +# idle_bat = idlelib.__file__.replace('__init__.py','idle.bat') +# Popen(f'{idle_bat} "{demo_fil}"') + +tar_fil = os.path.join(os.getcwd(),'demo.r') +print(tar_fil) +if os.path.exists(tar_fil): + rscript_exe = 'C:/Program Files/R/R-4.2.2/bin/Rscript.exe' + rscript_exe = 'Rscript' + print(os.path.exists(rscript_exe)) + run( + f'{rscript_exe} "{tar_fil}"', + cwd = os.getcwd(), + start_new_session = True + ) + |