我目前正在研究一个使用win32service和win32serviceutil作为Windows服务运行的python程序.该服务按预期运行,甚至在使用py2exe之后,一切都很好(服务监视目标文件夹,并自动将FTP新创建的文件移动到指定的FTP位置).但是,我想添加一些命令行参数(除了安装,删除,启动,停止等...)以指定本地和FTP目录.关于这个的唯一文档是我在以下网站找到的:http: //www.py2exe.org/old/
"或者,您可以为py2exe指定'cmdline-style'属性,有效值为'py2exe'(默认值),'pywin32'或'custom'.'py2exe'指定py2exe始终支持的传统命令行. 'pywin32'支持与pywin32支持的完全相同的命令行参数(即,从.py文件运行服务时支持相同的参数.)'custom'意味着您的模块应该提供'HandleCommandLine'功能,这是负责所有命令行处理."
任何帮助将被赞赏指向正确的方向.如果需要明确的代码,请告诉我.
谢谢,扎克
我正在尝试为我的SSRS报告实现一个函数,该函数将根据三个日期的值返回颜色值:
Function SetBoxColor(dateOne As Date, dateTwo As Date, dateThree As Date) As String
' Determine colors for text box
If (dateOne Is Nothing) Then
SetBoxColor = "Blue"
Else
If (dateThree Is Nothing) Then
If dateOne >= Date.Now Then
If DateDiff("d",dateOne,Date.Now) < 90
SetBoxColor = "Yellow"
Else
SetBoxColor = "White"
End If
Else
SetBoxColor = "Orange"
End If
Else
If dateThree <= dateOne Or (Month(dateThree) = Month(dateOne) And Year(dateThree) = Year(dateOne)) Then
SetBoxColor = "Green"
Else
SetBoxColor = "Red"
End If …Run Code Online (Sandbox Code Playgroud)