我试图将列表作为参数传递给pool.map(co_refresh, input_list).但是,pool.map没有触发功能co_refresh.并且没有错误返回.看起来这个过程就在那里.
原始代码:
from multiprocessing import Pool
import pandas as pd
import os
account='xxx'
password='xxx'
threads=5
co_links='file.csv'
input_list=[]
pool = Pool(processes=threads)
def co_refresh(url, account, password, outputfile):
print(url + ' : ' + account + ' : ' + password + ' : ' + outputfile)
return;
link_pool = pd.read_csv(co_links, skipinitialspace = True)
for i, row in link_pool.iterrows():
ln = (row.URL, account, password, os.path.join('e:/', row.File_Name.split('.')[0] + '.csv'))
input_list.append(ln)
pool.map(co_refresh, input_list)
pool.close()
Run Code Online (Sandbox Code Playgroud)
但是,它从未触发过该功能co_refresh.如何将列表作为参数传递给我的函数?
旧问题(简体): …
我试图通过使用Windows任务计划程序自动化VBScript.但是,我尝试使用cscript.exe+ "C:\...\script.vbs"但它没有运行.我也尝试在CMD(cscript.exe "C:\...\script.vbs")中直接运行相同的命令,并且它有效.
可能是什么问题?
编辑:
我只是尝试将设置切换为"Run only when user is logged on","Run whether user is logged on or not"并且工作正常.我想知道是否有办法让我的任务计划运行,即使用户已注销.
当我在Excel VBA中启动字典对象时,我发现了两种方法:
CreateObject("Scripting.Dictionary")(没有"Microsoft Scripting Runtime");Dim dict As New Scripting.Dictionary它们都可以在我的机器上运行.我想知道这两种方法有什么区别吗?
关于new在java语句中使用,我有一个非常基本的问题.例如,最后的return子句new用于String.为什么String需要在这里创建?在什么样的情况下人们会选择使用new?
public class A extends java.lang.Object {
public int number;
public String toString() {
return new String("Value : " + number);
}
}
Run Code Online (Sandbox Code Playgroud) automation ×1
dictionary ×1
excel ×1
excel-vba ×1
java ×1
python ×1
python-pool ×1
return ×1
return-value ×1
scheduler ×1
vba ×1
vbscript ×1
windows ×1