Shared script does not execute - python

A .pyw script to present a small GUI (TkInter) to the user. From a Windows Server Terminal server, it does not run for others.
I wrote a .pyw script to present a small GUI (TkInter) to the user. On my windows desktop, with Python installed, it runs well. I uploaded the script to a Windows Server Terminal server, from where I want a number of users to run it. I can run it when I log onto the terminal server. Other users, however, cannot run it, and it does not display any error messages.
I have ensured that everyone on the server has full access to the script.
The code is running perfectly

Uhm... This was rather simpler than I thought.
Because it is a .pyw file, an error did not show up. I did not make use of Python's errror catching tools.

Related

Run PyCharm with command on PC Startup

I am using PyCharm in two instances for crypto-trading. Currently when my computer starts up, I would have to open both projects on PyCharm manually and enter two different commands manually.
Is there a way to run these projects with the commands needed automatically right after starting my computer?
A better way to start your bot on startup is to add your python script or something in a startup or run your python script as a service.
Check out this article

Sikuli Scripts not running if RDC is minimized

I have a sikuli script which does the Siebel Tools incremental Compilation Task on a Windows Box from Jenkins.
The problem is: When i run the task i always have to open the RDC window open for the task to be executed.As soon i minimize the window the script fails.
Hence if the Sikuli script is running i will not able to use my local system for any other task.
I found some posts on launchpad.net.
this is one reference: https://answers.launchpad.net/sikuli/+question/213636
But it did not work.
Can anyone help on this.
This solution has helped me out:
Close all open Remote Desktop sessions.
Launch the Registry editor (regedit.exe).
Navigate to one of the following Registry keys, depending on whether you wish to modify the Remote Desktop settings only for the current user or for all users on the computer:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
Create a DWORD value named RemoteDesktop_SuppressWhenMinimized and set it to 2.
Close the Registry Editor.
After these steps are done RDC when minimized will not be suppressed and sikuli will work.
Answer taken from:
https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/in-minimized-window.html
Other solution is to use VNC connection instead of RDC. RealVNC for example.
You setup VNC server on machine that sikuli scripts are running on and connect from your other machine. You should even be able to close the connection window and scripts should still be able to run.
You could just keep the RDC session running in the background. Just don't minimize it. I am doing the same with my tests.

Linux - Open chromium from a script that runs on startup

I have a bash script that I've defined to run in startup, which runs a python script that waits for a command from another process, and when it gets it, it should open a chromium window with a certain URL.
When I run this script manually it works fine, but when the script runs from startup, I get an error (displayed in syslog):
Gtk: Can't open display
I guess that's because it's running in a startup mode so it doesn't actually have a display to "lean" on...
I was wondering if there's any way to get this work, anyway?
Thanks in advance
In your script that runs on startup try DISPLAY=:0 <command> &
To clarify DISPLAY=:0 simply sets which monitor your window opens on with 0 representing the first monitor of the local machine.

jenkins wouldn't execute python script correctly

I set up a job that want to execute an action that open the local browser. I write it use the python script:
import webbrowser
if __name__=="__main__":
webbrowser.open("http://www.example.com")
Then,i click Build now button on jenkins dashboard, it can execute successful and show successful as a result at last. But nothing happen for browser.It's very wierd that other python script could execute correctly, I have no idea why?
Addition:This jenkins(Jenkins ver. 1.524) is installed on my laptop and my laptop's OS is Win7, i start jenkins as a Windows Service. Do u have any idea?
If you are running Jenkins as a Windows service, by default it runs as user Local System. Did you check the box titled "Allow service to interact with desktop"?. If that does not help you may have to set the service to log on as an actual user, instead of Local System. This is a common problem with running any process with a GUI from Jenkins.

Running a Python script saved on a Windows 7 server... on a Mac?

We have a server running Windows 7 Pro. I have several Python script I'd like to save to the server and have it so that client computers can run them by simply double-clicking. The client computers are all running OSX. This is proving to be... problematic.
First I tried to simply make the Python scripts executable, but this doesn't seem to be possible on a Windows server -- since you can't set the 'executable' flag, double-clicking on a file will always open it in an editor (unless I were to go to every single computer and make .py files open with Python). Trying to create a shell script has the same problem -- there's no way to make them executable from the server.
My solution was to just make a simple AppleScript app that sends a command to launch the script. Unfortunately, as soon as I copy the app to the server, it stops working. It seems that OSX apps refuse to execute properly when saved to the server -- if you run the file, nothing happens at all.
Is there a simple solution I'm overlooking?
This is probably what you're looking for: http://oreilly.com/catalog/samba/chapter/book/ch05_03.html says that Samba clients (that OS X uses to connect to Windows shares) can map archive/hidden/system file attributes to owner/group/world executable bits respectively.
Try setting those attributes on the script file and make sure its first line is #!/usr/bin/python. If this mapping is enabled by default, the script will run by double-click.
actually the issue is that windows has no equivalent of the execute bit for files.
the solution is to change the mount options on the share so that all the files have their execute bit set.

Categories

Resources