在 Linux 或 Windows 机器上为 Mac 编写 Python 脚本
我为朋友编写了一个 python 脚本,以简化工作任务。现在她的公司想付钱给我另一个剧本(哇!)。不过她在 Mac 上工作,而我只有一台 Windows 电脑和一台 Ubuntu 电脑。虽然 python 是多平台的,但我在第一个脚本中遇到了一个问题,该问题仅发生在她的 Mac 上。那么有没有一种(希望是免费的)方法可以在 Windows PC 或 Ubuntu 上模拟 OS X,这样我就可以事先在 Mac 上测试我的脚本,而不必把它交给她并说“好吧,这可能有效”。
I wrote a python script for a friend to make a job task easier. 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. While python is multi-platform, I ran into a problem with the first script that was only happening on her 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'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只要您坚持使用通用接口和 POSIX/UNIX 接口,它就可以在 Ubuntu 和 OS X 上同样正常工作,除非有任何深奥的魔法。由于您还没有描述问题,这是可以给出的唯一建议。
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. Since you haven't described the problem, that's the only advice that can be given.
有关操作系统模拟器的问题可能最好放在 http://superuser.com 上(但我很确定没有免费的 OS X 模拟器大约)。
您遇到了什么问题?只要您不使用特定于操作系统的功能,就应该没问题。也许可能会出现一些编码问题(windows-1252 与 UTF-8),但在您更详细地描述您的问题之前,所有这些都只是猜测。
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).
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.