所以最近我想尝试在我的工作脚本中使用多重处理,所以我做了这个假人只是为了看看我是否可以使其与一个类一起使用并且出现错误。
谁能告诉我如何解决这个问题?
maxDate
错误:
$('#date').datepicker({
language: 'en',
range : true,
minDate : -7, /* 7 days ago */
maxDate : -1, /* Yesterday */
multipleDates: true,
multipleDatesSeparator: " - "
});
感谢您的提前答复。
答案 0 :(得分:0)
您的问题与this one非常相似,您将在此处找到详细的答案。简短地说,替换
def login(self, auth_user, auth_pass):
使用
def login (event):
该错误消息消失了,但是我收到另一条错误消息,指出未定义time
。但是我怀疑它是在代码的其他地方定义的。
答案 1 :(得分:0)
您正在调用函数-您必须将其提供给流程:
import time
if __name__ == '__main__':
a = A()
auth = { 'username': 'jnk', 'password': 'test' }
# provide the functions - DO NOT CALL THEM - do not place () after them:
p1 = Process(target=a.login, args=(auth['username'], auth['password'],))
p2 = Process(target=a.say_hello, args=(5,))
p1.start()
p2.start()
p1.join()
p2.join()
输出:
Starting
Username: jnk
Password: test
Times: 0
Times: 1
Times: 2
Times: 3
Times: 4