Questions in topic: "python shutdown script" https://knowledge.亚搏在线safe.com/questions/topics/single/50970.html “python shutdown script”主题的最新问题 如何在shutdown python脚本中进行电子邮件过滤,并将结果导出到SQL Server数据库表中? https://knowledge.亚搏在线safe.com/questions/83189/how-to-do-email-filtering-inside-shutdown-python-s.html


亲爱的各位,我有一个关闭python脚本,它基本上在一个数据下载成功或失败后向管理员发送电子邮件。My existing py script is as follows:


我现在想在电子邮件生成之前施加一个“if”条件,if my user name is "A" and email is "A@nnn.com" then email will not generate..我已经结束了我的剧本,但它不起作用,FME server shows me error.


如果努茨!='A'和用户邮件!= a@ nnn.com:
smtpserver = smtplib.SMTP(smtpServerAdress,smtpPort)
smtpserver.ehlo()。
smtpserver.starttls()。
埃姆洛
smtpserver.sendmail(电子邮件来自,emailTo,msg.as_string())
smtpserver.close()

...............
Did I have done some mistakes?

另一个问题是,I want to also store the result inside sql server DB,how i can write the right script before'send mail?


谢谢

Muqit

关机脚本 python shutdown script FRI,2018年11月23日格林威治标准时间21:22:19 马约德尔普林
How to runarcpy scripts https://knowledge.亚搏在线safe.com/questions/81533/how-to-runarcpy-scripts.html

你好,

我想在加载之后在特性类上运行简单的维护arcpy脚本。不用读那些功能类。


Example of scripts: attribute index,spatial index,extent calculation:


arcpy.AddIndex_management(in_table="C:/Users/xxx/Documents/ArcGIS/Default.gdb/tablename",fields="Name",index_name="name_1",unique="NON_UNIQUE",ascending=“非升序”)

arcpy.recalculateFeatureClassExtent_Management(in_features=“c:/users/xxx/documents/arcgis/default.gdb/tablename”)。


用于文件geodatabase功能类和企业geodatabase。


How do I achieve this with either a shutdown python script or PythonCaller / Creator?


谢谢

巨嘴鸟 arcpy python shutdown script Wed,31 Oct 2018 16:25:25 GMT honkovam
在python关闭脚本上连接并执行Microsoft SQL https://knowledge.亚搏在线safe.com/questions/73255/connect-and-execute-microsoft-sql-on-python-shutdo.html

是否有人在关闭脚本中通过python成功地执行了对SQL数据库的insert\delete SQL语句?

蟒蛇 SQL python shutdown script Microsoft SQL Server空间 shutdown Wed,27 Jun 2018 17:51:22 GMT bhornung
How to solve FME_END_PYTHON failure on FME Server? https://knowledge.亚搏在线safe.com/questions/68779/how-to-solve-fme-end-python-failure-on-fme-server.html

I am trying to bring a workbench to FME Server that has been used on FME Desktop until now.This workbench uses a shutdown python script.它的特殊之处在于,这个工作台使用定制的Python解释器,而不是FME的Python。

The FME server has been installed on a completely other computer than FME Desktop.So first Python and a few packages had to be installed on this computer.此外,我还编辑了cmd中的fme服务器设置,正如以下文章所述:https://docs.safe.com/fme/html/fme_server_documentation/content/adminguide/using-python-with-fme_server.htm“使用自定义python解释器”。亚搏在线

In cmd Python and the import of the new packages work fine but when I run the workbench on FME Server the translation fails.It says not more than "FME_END_PYTHON failure".作业的日志文件没有提供有关该问题的更多提示。最后一行是:

Translation was SUCCESSFUL with 43 warning(s) (6398 feature(s) output)FME Session Duration: 6 minutes 5.6 seconds.(CPU: 233.1s user,15.9s system)END - ProcessID: 12696,peak process memory usage: 2969312 kB,当前进程内存使用:348760 kB

I guess that FME still uses the wrong python interpreter because I also tried to minimize the shutdown script to something like 'print "Test"'.The result is the same.The translation fails.另外,当我在另一台机器上使用FME桌面运行python代码时,它在工作台中工作得很好。

我也很奇怪,python安装在32位(也是FME服务器)中,但是python27.dll在sysw64目录中,而不是在system32目录中。所以我的问题是是否可以找到更多关于这个问题的信息并调试关闭脚本。Or is it possible to debug whether the right python interpreter is used.I tried to copy the python27.dll from another python installation (also 32 bit) into the System32 directory and edit the FME Server settings in the cmd ( Server/fme/fme.exe APPLY_SETTINGS SYSTEM "Python/Python Interpreter" C:/Windows/System32/python27.dll") but also that does not work.

蟒蛇 FMESER python shutdown script interpreter 周一,2018年4月23日12:34:13格林尼治标准时间 菲利克得胶
fmeobjects导致停机时崩溃 https://knowledge.亚搏在线safe.com/questions/66875/fmeobjects-causes-crash-in-shutdown.html

The following lines of code work when run as an independent python script,ie python script.py.在脚本的启动部分运行时,这些行也可以工作。The exact same lines however do not run when run in a shutdown script.在关闭脚本中运行时,fme.exe进程崩溃,在fme日志中出现以下错误:

stfconf.cpp:798处的前置条件失败。表达式:实例\!= 0

The lines of code I am trying to run read a static .ffs file.他们是:

ffsFile = r'
       
        'import fmeobjects# The following line never completes.reader = fmeobjects.FMEUniversalReader('FFS',错误的,[])reader.open(ffsFile,[])feature = reader.read()featureCnt = 0while feature != None:    featureCnt += 1    feature = reader.read()print 'featureCnt:',featurecntreader.close()功能
       

在脚本完成后,我试图通过报告未通过的功能的数量来自动报告失败的功能,可能还有更多的信息。为了做到这一点,我需要上面的代码在关闭过程中工作。

Any suggestions welcome.Please and thanks!

蟒蛇 FME桌面 崩溃 python shutdown script FMEObjEC 周一,2018年3月26日23:55:55格林尼治标准时间 古亚拉夫勒
使用shutdown python脚本调用S3uploader转换器 https://knowledge.亚搏在线safe.com/questions/63171/calling-the-s3uploader-transformer-using-a-shutdow.html

Hi,

Is it possible to call the s3Uploader transformer using a python shutdown script?My 亚搏在线workflow currently uses a python shutdown script to convert the FME output data into a number of proprietary formats and now I would like to upload these proprietary files to AWS S3.我宁愿使用一个工作台来完成这一切,而不安装额外的python模块(即boto3)。

谢谢

python shutdown script Thu,2018年2月1日15:34:13格林尼治标准时间 阿龙索恩
FME Python - Can't find module (ArcPy) https://knowledge.亚搏在线safe.com/questions/54849/fme-python-cant-find-module-arcpy.html

Hi,

我正在运行64位的FME桌面,并尝试运行一个python关闭脚本。The script utilizes ArcGIS Pro tools and is written in 3.5.

我得到“Python Exception : DLL load failed: The specified module could not be found. “我把范围缩小到arcpy模块。

The initial arcpy that comes with ArcGIS Desktop is 32bit,however,Pro comes with arcpy as well and is contained in C:\Program Files\ArcGIS\Pro\Resources\ArcPy.这是我要用的那个。My script is below.

导入操作系统
进口弧度

打印(os.path.abspath(arcpy.uuuu文件)

The above script runs successfully in Sublime and IDLE (ArcGIS Pro),but the error occurs in FME.Here are the things I've tried already:

  • 将FME解释程序更改为与Sublime相同的解释程序(C:\Program Files\arcgis\pro\bin\python\envs\arcgis pro-py3\python35.dll文件
  • Change interpreter toESRI Arcgis Pro 1.4/2.0+python(3.5+)
  • 将arcpy文件夹从pro/resources复制到C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\arcpy
  • 在pythoncrator中运行相同的脚本
  • Running an alternate script substituting "json" for "arcpy".结果是成功的,并显示了JSON模块在C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\json.

所以,I know it can see the location,它只是在识别arcpy时遇到问题。任何帮助都将不胜感激。This job will eventually be published to FME Server once I get it to work on Dekstop.

蟒蛇 python shutdown script Thu,2017年10月5日14:44:16格林尼治标准时间 jburroughs
My Shutdown Python Script is calling arcpy to run the Arc Extend and Trim tools on my dataset,is there a way to have inspector display the results? https://knowledge.亚搏在线safe.com/questions/50971/my-shutdown-python-script-is-calling-arcpy-to-run.html

inspector arcpy 关机脚本 python shutdown script python script calling Thu,17 Aug 2017 22:18:02 GMT 阿帕迪拉