os.system, IIS6.0

2005-10-23 Thread David Duerrenmatt
Hi there

Since we migrated from Windows 2000 Server to Windows 2003 Server, we 
encountered some problems with the Python scripts calling os.system(). 
They either copy files (permissions on files properly set) or run local 
programs. While using Win 2K, everything was alright. I assume, it's 
caused by stronger security settings for the IUSR-Account (the programs 
do their work if they are run from the command prompt by the system 
administrator).

Does anybody know how to change the permissions of the IUSR account to 
allow the execution of system commands or external programs? Or is it 
another issue which creates these problems?

Some system details:
- Windows 2003 Web Edition
- IIS 6.0
- Python 1.5.2 (has to be this outdated version because of pyd files 
which depend on Python15.dll)


Thanks
dave
-- 
http://mail.python.org/mailman/listinfo/python-list


func(*params)

2005-11-18 Thread David Duerrenmatt
Hi there

For some reasons, I've to use Python 1.5.2 and am looking for a workaround:

In newer Python versions, I can call a function this way:

func = some_function
func(*params)

Then, the list/tuple named params will automatically be "expanded" and 
n=len(params) arguments will be submitted.

Python 1.5.2 doesn't support this kind of function call. I could use 
some workaround like:

func(params[0],params[1]...)

but since the number of items in params varies and depends on the mapped 
function "some_function", this isn't a good solution.

Another idea is to use exec(), don't know whether this is safe...

Any recommondations or tricks?


Thanks,
david
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: func(*params)

2005-11-18 Thread David Duerrenmatt
Great, this is exactly what I was looking for.

Thanks all of you for your immediate answer!




Nick Smallbone schrieb:
> David Duerrenmatt wrote:
> 
>>Hi there
>>
>>For some reasons, I've to use Python 1.5.2 and am looking for a workaround:
>>
>>In newer Python versions, I can call a function this way:
>>
>>func = some_function
>>func(*params)
>>
> 
> 
> I think the "apply" function is what you want:
> 
> apply(object[, args[, kwargs]]) -> value
> 
> Call a callable object with positional arguments taken from the tuple
> args, and keyword arguments taken from the optional dictionary kwargs.
> Note that classes are callable, as are instances with a __call__()
> method.
> 
> Deprecated since release 2.3. Instead, use the extended call syntax:
> function(*args, **keywords).
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


Migrate PYD Files

2005-09-08 Thread David Duerrenmatt
Is there a way to use old pyd files (Python 1.5.2) with a newer version
of Python without recompiling them?

Because the source code is not available anymore, I'm wondering whether
it's possible or not to change few bytes with a hex editor (version
number?). I'd like to give it a try since the modules don't use too
critical functions.

Thanks
dd
-- 
http://mail.python.org/mailman/listinfo/python-list