Hello, and thank you for taking the time to look into helping me with this issue.
I'm trying to automate PyCharm's inspection tool to run in the background while people are coding as a way to collect information about the person's syntax errors and such as they work. In order to do this, I have two separate PyCharm installations on the computer to be used: PyCharm Edu 2018.1.2 and PyCharm Community Edition 2018.3.3.
The computers I would like to run this program on are computers at a public University. Needless to say, there are multiple shared accounts and such that are accessible from each computer and do not save any changes when logged out. I want to run this program while students are using the PCs to gain information about their coding habits (as part of my Thesis, and yes, I have gone through all the steps necessary to do human research, IRB, CITI Training, etc.).
I am using a module called subprocess which can be used to execute commands, such as the inspect.bat command, from within Python. Here is the way I am currently setting up the command via Python (this is after substituting in the values of the variables I am using):
subprocess.Popen(['runas', '/user:Administrator', 'C:\\"Program Files (x86)"\\JetBrains\\"PyCharm Edu 2018.1.2"\\bin\\inspect.bat',
What this code is supposed to do is run the inspection using the default inspection profile and output the XML files to a folder I generated in the code above this line. This code will run fine on my personal computer/account (which is the admin account) without the need of the "runas /user:Administrator". I will say that my other computer has older versions of PyCharm (but only like CE 2018.3.2). I do also stdin.write the password immediately after this and communicate it. It does not write anything to the console, and it does not produce any XML files in the folder specified.
If I do not include the "runas /user:Administrator" phrase in the call, I get the following error:
File "D:/InspectCode/src/Inspections.py", line 186, in do_inspects
output_directory + "/" + project_name], stdin=subprocess.PIPE)
File "C:\Program Files\Python37\lib\subprocess.py", line 756, in __init__
File "C:\Program Files\Python37\lib\subprocess.py", line 1155, in _execute_child
PermissionError: [WinError 5] Access is denied
Is anyone able to tell me what I'm doing wrong or how to troubleshoot this? I don't believe it has anything to do with the way the paths are written (forward/backward slashes, etc.) as I've fiddled with those a lot. I'm thinking it may be because of administrator privilege issues or because of PyCharm's new versions.
I'm open to all ideas and suggestions, even if they require taking a completely different route!
Thanks in advance!