簡體   English   中英

我們可以在執行python腳本時運行pylint,以便在pylint通過代碼時執行該代碼,否則將顯示pylint錯誤?

[英]Can we run pylint while executing python script, such that when the pylint passes the code will execute else it will show pylint errors?

例如:假設我有一個python腳本test.py,所以當我運行python test.py腳本時,pylint應該首先執行,如果pylint成功執行,則應該執行tesy.py,否則應該給出pylint錯誤。

@falsetru:謝謝您的回答,另一個解決方案是我們可以編寫一個腳本,在其中將運行兩個命令,即。 pylint test.py ,如果代碼(pylint的輸出)的速率大於x (假設x = 8),則會運行python test.py,否則將顯示pylint錯誤。

即代替python test.py我們將運行my_script test.py

my_script是包含上述代碼的腳本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM