-1

From within Jupyter, can you make a call to open external software, eg SAS? I have SASpy and SAS. Both work fine. But I want to streamline the process of using SASpy. So, instead of manually opening SAS first, is there a way to insert a command that will result in the software opening?

I have no idea how to go about this. I'm a noob with Python.

Dirk Horsten
  • 3,753
  • 4
  • 20
  • 37
  • Search a more general variation of your question on the internert. There's a lot of posts about opening programs / applications using Python, see [here](http://www.learningaboutelectronics.com/Articles/How-to-launch-computer-programs-using-Python.php#:~:text=Python%20has%20the%20low%2Dlevel,Popen()%20function.) or [here](https://www.geeksforgeeks.org/open-applications-using-python/), for example. Or this [StackOverflow post](https://stackoverflow.com/q/14831716/8508004) or [this SO post](https://stackoverflow.com/a/37241056/8508004). – Wayne Mar 12 '23 at 15:55
  • It sounds like you are saying that for saspy to work you have to have first started a SAS process and so you are looking for a way to do that from within your Jupiter notebook. Is that the issue you are having? – Tom Mar 12 '23 at 17:16

2 Answers2

0

With SASPy or the SAS Kernel you're able to run SAS programs from within Jupyter, so I'm unsure of why you'd want to do this. If you want to programmatically open up SAS 9.4, you can open up any executable in Python with subprocess.run().

import subprocess 

To open SAS Enterprise Guide on Windows:

subprocess.run('C:\\SASHome\\SASEnterpriseGuide\\8\\SEGuide.exe')

To open sas.exe on Windows:

subprocess.run('C:\\SASHome\\SASFoundation\\9.4\\sas.exe')
Stu Sztukowski
  • 10,597
  • 1
  • 12
  • 21
0

Stu Prompted me to find the answer. Their mention of SAS Kernel in the response led me to refine my interwebz search. I found this April 18, 2022 site which resolved the issue Getting started using SASPy® and the SAS® kernel for Jupyter Notebook This method was not previously available to my limited Python and Jupyter knowledge nor within the IT security of my organization.