[Tutor] Problem with threading

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue May 3 00:26:12 CEST 2005


[Side note: try to just send messages to either tutor at python.org, or
help at python.org, but not both.]


> Someone suggested the use of CRON (I'm working over Linux) but how can I
> built a program to which I can pass an argument???????
>
> I mean in CRON I will have to put one task for each user and each script
> has to check only one user, so I think I have to make something like
> this in cron:
>
> at 5 o clock run python2.2 application_I_build(username)


Hi Alberto,

Would things work for you if the list of usernames was defined externally,
in some sort of text file?  It really sounds like each user has some set
of configuration state, so perhaps it might be useful to do something
like:

    at 5 o clock,
        run python2.2 application_wrapper configuration_file.txt

where configuration_file.txt holds a list of users and other miscellaneous
server-specific variables.  Here, 'application_wrapper' is a simple
wrapper that itself calls the real 'application_I-build' program with the
right command line arguments, for each user in the configuration_file.txt.


Best of wishes!



More information about the Tutor mailing list