久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 Windows 上通過批處理調度 Python 腳本(使用 Ana

Schedule a Python script via batch on windows (using Anaconda)(在 Windows 上通過批處理調度 Python 腳本(使用 Anaconda))
本文介紹了在 Windows 上通過批處理調度 Python 腳本(使用 Anaconda)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個每天運行的腳本并想為它制定一個時間表,我已經嘗試了一個批處理文件:

I have a script that i run every day and want to make a schedule for it, i have already tried a batch file with:

啟動 C:Users ameMiniconda3python.exe C:script.py

start C:Users ameMiniconda3python.exe C:script.py

我可以在其中運行一些基本的python命令,問題是我的實際腳本使用了一些隨Anaconda一起安裝的庫,我無法在腳本中使用它們,因為Anaconda不會加載.

And im able to run some basic python commands in it, the problem is that my actual script uses some libraries that were installed with Anaconda, and im unable to use them in the script since Anaconda will not load.

我在 Windows 上工作,但找不到啟動 Anaconda 并每天在那里自動運行我的腳本的方法.

Im working on windows and can't find a way to start Anaconda and run my script there automatically every day.

推薦答案

在直接通過環境調用 python 時我會小心一點,因為永遠不知道激活函數的內部是否發生了變化.

I would be a bit careful in calling python directly through environment as one never knows if the internals for activate function has changed.

我只是在使用基本的 bat 腳本來幫助我.

I'm just using basic bat-script to help me out.

SET log_file=%cd%logfile.txt
call C:Anaconda3Scriptsactivate.bat
cd script_directory
python script.py arg1 arg2 > %log_file%

此腳本會在運行 bat 的任何位置保存日志文件,通過 activate(在本例中為標準)調用正確的環境并將所有標準輸出定向到日志文件中以供進一步調查.

This script saves the log-file wherever the bat is run from, calls the right environment through activate (in this case the standard) and directs all the stdout into log-file for further investigation.

然后只需將您的 Windows 任務計劃程序指向腳本并設置您希望日志文件出現的主目錄.

Then just point your Windows Task Scheduler to the script and set the home directory where you want the log-file to appear.

這篇關于在 Windows 上通過批處理調度 Python 腳本(使用 Anaconda)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件時出現問題)
Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按屬性查找所有節點)
Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 響應并將元素值存儲在變量中?)
How to get XML tag value in Python(如何在 Python 中獲取 XML 標記值)
How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正確解析 utf-8 xml?)
Parse XML from URL into python object(將 XML 從 URL 解析為 python 對象)
主站蜘蛛池模板: 免费一区二区在线观看 | 亚洲欧美视频 | 99综合| 欧美999| 久草热8精品视频在线观看 午夜伦4480yy私人影院 | 亚洲视频在线看 | 亚洲欧美日韩中文字幕一区二区三区 | 黄色在线观看网站 | 人人九九精 | 亚洲成人精品一区 | 亚洲精品乱码久久久久久按摩观 | 天天干干| 草逼网站 | 99久久久无码国产精品 | 婷婷在线视频 | 二区成人| 精品三区 | 久久在视频 | 国产精品一区二区不卡 | 在线视频成人 | 欧美日韩中文字幕在线 | 亚洲精品亚洲人成人网 | 一区二区三区亚洲精品国 | 91视频麻豆 | 高清一区二区视频 | 毛片久久久| 成人免费视频 | 国产高清在线精品一区二区三区 | 激情视频一区 | 国产偷录视频叫床高潮对白 | 成人av网页 | 久久国产欧美日韩精品 | 日韩中文字幕视频 | 国产欧美视频一区二区三区 | 日韩伦理一区二区 | 毛片一级网站 | 亚洲国产aⅴ成人精品无吗 亚洲精品久久久一区二区三区 | 国产露脸国语对白在线 | 日韩中文字幕免费在线 | 欧美一区成人 | 亚洲一二视频 |