我制作了包含以下代碼的文件'DWDfunctional.py':def ForecastDownloader(system,ModelName,year,Month): import cdsapi c = cdsapi.Client() c.retrieve( 'seasonal-monthly-single-levels', { 'originating_centre': ModelName, 'system': system, 'variable': 'total_precipitation', 'product_type': 'monthly_mean', 'year': year, 'month': Month, 'area' : [40, 44, 24, 64], 'leadtime_month': [ '1', '2', '3', '4', '5', '6', ], 'format': 'netcdf', }, 'dwd.nc')然后我在另一個文件中調用了該函數:from DWDfunctional.py import ForecastDownloaderForecastDownloader('2','dwd',2020,2)我想知道,當我運行上面兩行代碼時,python 在另一個文件夾中執行另一個舊代碼?。?!并以錯誤的文件名下載錯誤的文件,沒有錯誤!
Python 執行另一個文件
慕工程0101907
2022-10-06 16:49:51