[英]Writing python script for a Mac on a linux or windows machine
I wrote a python script for a friend to make a job task easier. 我为朋友写了一个python脚本,使工作任务变得容易。 Now her company wants to pay me for another script (woot!).
现在她的公司想付钱给我另一个剧本(哇!)。 However she works on a Mac and I have only a Windows pc and an Ubuntu pc.
但是她在Mac上工作,而我只有Windows PC和Ubuntu PC。 While python is multi-platform, I ran into a problem with the first script that was only happening on her Mac.
尽管python是多平台的,但我遇到的第一个脚本问题仅发生在她的Mac上。 So is there a (hopefully free) way to emulate OS X on a Windows PC or Ubuntu, so I can test my script on a mac before hand, without having to give it to her and say 'ok this might work'.
因此,有一种(希望是免费的)方法可以在Windows PC或Ubuntu上模拟OS X,因此我可以事先在Mac上测试脚本,而不必将脚本交给她并说“确定,这可能有用”。
As long as you stick to the common and POSIX/UNIX interfaces, it will work equally fine on both Ubuntu and OS X barring any deep magic. 只要您坚持使用通用和POSIX / UNIX接口,只要没有任何深奥的技巧,它就可以在Ubuntu和OS X上正常工作。 Since you haven't described the problem, that's the only advice that can be given.
由于您尚未描述问题,因此这是唯一可以提供的建议。
Questions about OS emulators are probably better placed at http://superuser.com (but I'm pretty sure there isn't a free OS X emulator around). 有关OS模拟器的问题最好放在http://superuser.com上 (但我很确定周围没有免费的OS X模拟器)。
What issues did you encounter? 您遇到了什么问题? As long as you're not using OS-specific functions, you should be fine.
只要您不使用特定于操作系统的功能,就可以了。 Maybe some encoding issues (windows-1252 vs. UTF-8) could arise, but all of this is speculation until you describe your problem in greater detail.
可能会出现一些编码问题(windows-1252与UTF-8),但这只是推测,直到您更详细地描述问题为止。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.