{"action":"created","issue":{"url":"https://api.github.com/repos/agronholm/apscheduler/issues/31","labels_url":"https://api.github.com/repos/agronholm/apscheduler/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/agronholm/apscheduler/issues/31/comments","events_url":"https://api.github.com/repos/agronholm/apscheduler/issues/31/events","html_url":"https://github.com/agronholm/apscheduler/issues/31","id":120576281,"number":31,"title":"Unable to pass value to function","user":{"login":"agronholm","id":130003,"avatar_url":"https://avatars.githubusercontent.com/u/130003?v=3","gravatar_id":"","url":"https://api.github.com/users/agronholm","html_url":"https://github.com/agronholm","followers_url":"https://api.github.com/users/agronholm/followers","following_url":"https://api.github.com/users/agronholm/following{/other_user}","gists_url":"https://api.github.com/users/agronholm/gists{/gist_id}","starred_url":"https://api.github.com/users/agronholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agronholm/subscriptions","organizations_url":"https://api.github.com/users/agronholm/orgs","repos_url":"https://api.github.com/users/agronholm/repos","events_url":"https://api.github.com/users/agronholm/events{/privacy}","received_events_url":"https://api.github.com/users/agronholm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-05T17:57:33Z","updated_at":"2015-12-05T17:57:34Z","closed_at":null,"body":"Using Python 2.7.2  -Trying to pass a value to the function that add_cron_job calls. Errors out.\n\n    \n    #!python\n    from apscheduler.scheduler import Scheduler\n    \n    sched = Scheduler()\n    sched.start()\n    \n    jobid=2\n    \n    def run_job(n):\n    \tprint \"Running Job: \", n\n    \n    def run_job2():\n    \tprint \"Running Job without passing ID \"\n    \n    # Trying to pass a value to the function fails with \"TypeError: func must be callable\"\n    sched.add_cron_job(run_job(jobid),  minute='*/5')\n    \n    # Not passing a value\n    sched.add_cron_job(run_job2,  minute='*/5')\n    \n    sched.print_jobs()\n    \n    \n\nError:\nTraceback (most recent call last):\n  File \"schedual.py\", line 17, in <module>\n    sched.add_cron_job(run_job(2),  minute='*/5')\n  File \"c:\\sw_nt\\python27\\lib\\site-packages\\apscheduler\\scheduler.py\", line 347,\n in add_cron_job\n    return self.add_job(trigger, func, args, kwargs, **options)\n  File \"c:\\sw_nt\\python27\\lib\\site-packages\\apscheduler\\scheduler.py\", line 258,\n in add_job\n    options.pop('coalesce', self.coalesce), **options)\n  File \"c:\\sw_nt\\python27\\lib\\site-packages\\apscheduler\\job.py\", line 44, in __i\nnit__\n    raise TypeError('func must be callable')\nTypeError: func must be callable\n\n----------------------------------------\n- Bitbucket: https://bitbucket.org/agronholm/apscheduler/issue/15\n- Originally reported by: Anonymous\n- Originally created at: 2011-09-26T21:37:33.061\n"},"comment":{"url":"https://api.github.com/repos/agronholm/apscheduler/issues/comments/162231008","html_url":"https://github.com/agronholm/apscheduler/issues/31#issuecomment-162231008","issue_url":"https://api.github.com/repos/agronholm/apscheduler/issues/31","id":162231008,"user":{"login":"agronholm","id":130003,"avatar_url":"https://avatars.githubusercontent.com/u/130003?v=3","gravatar_id":"","url":"https://api.github.com/users/agronholm","html_url":"https://github.com/agronholm","followers_url":"https://api.github.com/users/agronholm/followers","following_url":"https://api.github.com/users/agronholm/following{/other_user}","gists_url":"https://api.github.com/users/agronholm/gists{/gist_id}","starred_url":"https://api.github.com/users/agronholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agronholm/subscriptions","organizations_url":"https://api.github.com/users/agronholm/orgs","repos_url":"https://api.github.com/users/agronholm/repos","events_url":"https://api.github.com/users/agronholm/events{/privacy}","received_events_url":"https://api.github.com/users/agronholm/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T17:57:34Z","updated_at":"2015-12-05T17:57:34Z","body":"Hello Alex,\r\n\r\nI'm new to APScheduler... and I'm encountering the same issue that \"anonymous\" is attempting to overcome.\r\n\r\nI had the same line of thinking... However it is obviously wrong.\r\n\r\nCan you please explain how you'd go about passing parameters to  a job_function; or point me to the appropriate documentation?\r\n\r\nThank you.\r\n\r\n--Mike\n\n----------------------------------------\nOriginal comment by: Michael  Bogucki\n"}}