jacexh / pyautoit

Python binding for AutoItX3.dll
MIT License
269 stars 74 forks source link

no way to set/get environment variables #7

Closed sn6uv closed 9 years ago

sn6uv commented 9 years ago

The EnvSet and EnvGet methods are not implemented.

I tried to implement them, e.g.:

@api.check(1, "set environment variable failed")
def env_set(variable, value=None):
    """

    :param filename:
    :param work_dir:
    :param show_flag:
    :return:
    """
    if value is None:
        ret = AUTO_IT.AU3_EnvSet(LPCWSTR(variable))
    else:
        ret = AUTO_IT.AU3_EnvSet(LPCWSTR(variable), LPCWSTR(value))
    return ret

see b2611d47a8, but it seems like they're not included in the DLL:

AttributeError: function 'AU3_EnvSet' not found

Unsure on how to move forward with this.

jacexh commented 9 years ago

hi, AU3_EnvSet did not offered in AutoItX3.dll, you could call os.environ in python to instead of.

sn6uv commented 9 years ago

I see, I guess this is related to what you said in #6 (the differences between AutoIt and AutoItX). Thanks!