开发者

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

开发者 https://www.devze.com 2023-04-01 11:52 出处:网络
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 a

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 sol开发者_运维百科ution 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消