Python可以作为Windows Server环境的有效脚本语言吗?
我目前正在制定管理多个运行 SQL Server 2000 - 2008 的 Windows Server 2003 到 2008 的策略,并且我想要/需要一个统一的脚本平台来自动执行任务。我正在成为 Python 的忠实粉丝,因此我想知道 Python 是否已被有效地用作脚本语言来管理各种 Windows Server 安装以及运行各种作业的各种 SQL Server 安装。 我熟悉 IronPython,它针对 .Net 框架执行,但我不确定 IronPython 使用什么语法版本的 Python。
编辑:仅供参考:我熟悉 Powershell,但我对它及其语法了解得越多,我就越不喜欢它。
编辑:如果可以的话,我想知道您在 Windows 上实现 Python 作为脚本解决方案的成功故事。
I'm currently working on a strategy for managing multiple Windows Server 2003 to 2008 running SQL Server 2000 - 2008 and I want/need a unified scripting platform for automating tasks. I'm becoming a big fan of Python and as such I'd like to know if Python has been used effectively as a scripting language for administering a various set of Windows Server installations with various SQL Server installations running various jobs.
I'm familiar with IronPython which executes against the .Net framework but I'm unsure what syntax version of Python IronPython uses.
EDIT: FYI: I am familiar with Powershell but the more I know about it and it's syntax the more I don't like it.
EDIT: Please, if you can, I'd like to know of your success story of implementing Python as a script solution on Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
尽管我喜欢
Python
,但我认为PowerShell
更适合。来自 维基百科:
Notwithstanding my love of
Python
, I thinkPowerShell
fits more.From Wikipedia:
使用 Python 在 Windows 上工作的 2 个要素是:
Tim Golden 的 WMI 模块:
* http://timgolden.me.uk/python/wmi/cookbook.html
Mark Hammond 的 PyWin32 软件包:
* http://docs.activestate.com/activepython/2.4/pywin32/PyWin32。 HTML
2 essentials for working on Windows with Python are:
Tim Golden's WMI module:
* http://timgolden.me.uk/python/wmi/cookbook.html
Mark Hammond's PyWin32 package:
* http://docs.activestate.com/activepython/2.4/pywin32/PyWin32.HTML
我不确定 Windows 是否如此,但 Python 在 Linux 中被大量用于管理脚本,并且它比本机 Windows shell 更好。我认为 Python 非常适合您的任务。
作为另一个选择,您可以看看 cygwin 和 bash。
I'm not sure about Windows, but Python is used a lot in Linux for administrative scripts and it is way better that a native Windows shell. And I think that Python is quite good for your tasks.
As another option you can take a look at cygwin and bash.
IronPython 的语法目前与 Python 2.6 处于同一级别。
IronPython 与 .NET 和 COM 和 IMO,比 Powershell 更适合程序员的思维方式(我不太喜欢 Powershell 语法)。然而,Powershell 无疑是更安全的选择,因为它得到了 Microsoft 的积极支持。
IronPython's syntax is currently at the same level as Python 2.6.
IronPython integrates very well with .NET and COM and IMO, fits the programmer mindset better than Powershell (I'm not really a fan of the Powershell syntax). However, Powershell is certainly the safer option because it's actively supported by Microsoft.
我自己从来没有用 Python 做过复杂的 Windows 系统管理(无论如何也不涉及 SQL 服务器),但我认为你可以看看 winsys 项目。
I've never done complex Windows system administration in Python myself (not involving SQL server anyway), but i think you could take a look at the winsys project.