← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #258335]: Windows path variables

 

Question #258335 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/258335

    Status: Solved => Open

fordox is still having a problem:
Where did I go wrong?

import os

localappdata = os.environ("LOCALAPPDATA")
programfiles = os.environ("PROGRAMFILES")
var1 = r"%s\test1" % localappdata
var2 = r"%s\test2\launcher.exe" % programfiles

if os.path.exists(var1) or os.path.exists(var2):
    popup ("Yes")

[error] AttributeError ( _Environ instance has no attribute '__call__' )

I tried to insert an attribute os.environ.get, but then an error occurs:

[error] TypeError ( coercing to Unicode: need string, type type found )

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.