Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Are there any unconventional ways to launch Stata?

    In my set up, I have a host machine and two VMS. Both VMs have Stata installed on them. I need to be able to somehow launch Stata on VMs without tracing back to the host machine. I am able to do this for vbs scripts. For example, when I invoke a vbs script on one of the VMs from Stata installed on the host, the vbs script uses the Operating System on the VM as long as I have Office installed on that VM. However, I could not figure out a way to do the same with do files. My intuition tells me that if I utilize a windows command using Stata then the windows command invokes the Stata on the VM it would be run on the Stata installed on VM (without tracing back to the host OS) but I dont know of any such windows command to achieve that end. Any ideas? BTW shell and winexec does not work for this. Also, task scheduler is not suitable as the timing needs to be on demand rather than at a set time.
    Last edited by Oscar Ozfidan; 11 May 2021, 23:46.

  • #2
    I think the answer to my question boils down to whether there is another software (python comes to mind first) that has launch functionality similar to Stata's shell or winexec commands. I think the use of a non-Stata software as an intermediate step would achieve the intended goal.

    Comment


    • #3
      Aha! looks like it is doable Now I need to figure out the implementation and post my solution here

      from https://www.stata.com/python/
      Second, in Stata 17 or higher, Stata can be invoked from a standalone Python environment via the pystata Python package. It includes three IPython (interactive Python) magic commands and a suite of API functions for interacting with Stata from within Python. With these tools, you can access Stata and Mata conveniently in an IPython kernel-based environment (for example, Jupyter Notebook and console, and Jupyter Lab and console), in other environments that support the IPython kernel (for example, Spyder IDE and PyCharm IDE), or when accessing Python from a command line (for example, Windows Command Prompt, macOS terminal, Unix terminal, and Python's IDLE). See [P] PyStata module for more details about calling Stata from within Python.

      Whether you are integrating Python into Stata or Stata into Python, you can use the sfi (Stata Function Interface) module to interact Python’s capabilities with Stata’s core features. Within the module, classes are defined to provide access to Stata’s current dataset, frames, macros, scalars, matrices, value labels, characteristics, global Mata matrices, and more. Refer to Stata’s Python API documentation for more details.

      Comment


      • #4
        You can also try working with text editors like Sublime Text3 (with StataEditor) or VS Code (with StataEnhanced and runadolines). Although i am not sure if these solutions can work in your case. You can also use Stata Kernel with a Python installation for Stata 16 and below.

        Comment

        Working...
        X