Cannot run active file in visual studio when connected to linux server - python

I'm currently on the steep part of the learning curve with a Linux server and running into a very frustrating issue.
Initially, I was running python scripts from the root user, then I learned that this was bad and created a new user and am working on migrating everything over to this new user. For some reason, when I set up the new user in exactly the same way that I set up the root I can no longer run the active file. From the root user, I can either click 'run active file' or the small play button in the top right corner but that disappears when I log in as the new user.
I receive the error message '''only files on disk can be run in the terminal'''
Any ideas on where I'm going wrong? Like I said still learning this stuff so if any more detail is needed please let me know.
Thanks!!

Well this was dumb, the Python extension was installed when running the root but had to separately install the extension for the additional user. Fixed the issue.

Related

Problem running a Python GUI application on Mac

I've got a Python CLI tool that I'd like to wrap with the Gooey module to create a nice interface for my users. I'd also like to package the tool using PyInstaller to create a Max OSX app. This works and I can open the GUI app on my Mac, however, if I give the app to someone else they get an error dialog:
"myapp" can't be opened because Apple cannot check it for malicious software.
I've tried a few command line options with PyInstaller, but still no luck. Does anyone have any suggestions or pointers that could help me resolve this problem?
This is due to Apple locking down their hardware, which is both a good and a bad thing. In preferences you can go to the security tab and allow the application to run, but because I’m guessing its not a compiled executable and just a python script it could see it as malicious.
https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac This article might help.
https://support.apple.com/guide/mac-help/apple-cant-check-app-for-malicious-software-mchleab3a043/11.0/mac/11.0 Here is another article that states how to roughly do the same thing.
You could, however, sign the software yourself (although this is probably out of your reach) https://developer.apple.com/developer-id/, which allows you to just sign the software and not give people that warning.
But if all you want is to have people test the app without being suspicious, you can just override the settings for that.

Go to definition is not working with docker and vagrant

I have a project running on a docker container and another running on a vagrant machine, when I try in to go to definition in that two projects, I receive this message ex: "No definition found for 'BaseUserManager'. ", for all plugins that I have installed on that machines I get the same message.
PS: Go to definition just work on my local workspace.
can you guys help me to solve this problem please?, I really like vscode and I don't wanna quit the editor because of this issue.
The source has to be local for the extensions to be able to read the files to analyze the source.

py2app tkinter application built on El capitan not working on a sierra

I built a py2app and Tkinter based application, and sent it to a friend, it does not seem to be working on the friends laptop that runs OSX sierra. Is there anything I can do?
When I try to open the application on my friends computer it just says Hook Error (name of the application is hook).
So if some one else is facing the same issue, the best way to figure out what is wrong is to run the console version of the app by going to the MacOS folder. In this specific case, sierra was not letting my app create a log file, siting lack of permissions, which was wierd, it seems like sierra has some extra security feature that doesnt let 3rd party apps create new files (just a guess, could be some other reason too), so when I opened the app from terminal with 'sudo', the problem was fixed. I had to do this only once though, even after restarts double clicking the icon opened up the application and updated the log file too. Hope this helps if you came in search of answers here.

Can't run coursebuilder in google app engine

It is really weird that after clicking run button, it does nothing and also no log and show a clock sign on the first column.
It works normally before. However, after I messed up my python environment, the google coursebuilder can't run web application. That's my guessing. When I run which python.it only shows:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
These let me feel like I have no way to solve it!Are there anyone who came across this problem before? Any ideas or suggestions?
Updated: I follow suggestions to use command line to run web application on GAE. It reminds me here:
Update: The error message shows that GAE can't get the allocated port and domain. The reason why it happens is that when I use command line to run the web application, I also open GAE GUI to run a web app with the same port number.
So the way to solve it is to close the GAE GUI and free the port. Or we also could designate another kind of port number with command line.(--port=XXXX and --admin_port=YYYY). Or take a look at the doc:
Again thanks for the help of Mihail R!
The OP had multiple issues with GAE setup which were resolved by simply reinstalling the GAE Launcher and making sure the app was first copied into Applications from the .dmg file, then ran from the Applications instead of from inside the .dmg file, and appropriate permissions were suppose to be given so that GAE Launcher created the symlinks it needed to work properly.
More instructions on proper GAE SDK installation can be found here: https://cloud.google.com/appengine/downloads after clicking on the needed SDK and then the OS the SDK will be installed on.

Registering a Python program as a Windows Server 2003 R2 Service

I wrote a Python script that I need to have installed on Windows Server 2003 R2, that will run when a specific directory is changed in any way (new files, deleted files, etc). I believe I need to register this as a system service, in order to listen for that, but I'm really not sure.
So, my question is this: does such a script need to be registered as a service, and if so, how do I go about doing that?
Thanks.
I believe your program will have to watch the directory for changes and act according. Alternatively, you could have a separate program watch the directory and then invoke your script, but this is essentially the same.
Tim Golden has an article here which discusses directory watching using python and the win32 api.
After you get that working, it would be very appropriate to have your program run as a service. This has been covered before.

Categories