In <[EMAIL PROTECTED]>, el chupacabra wrote:
>>Your problem is that the def statement reassignes the name "toHPU" to a
>>function instead of a string. So when the code runs, you're passing a
>>function object to s.copy2.
>
> So...how do fix it?
Don't give two different objects the same name!?
>Your problem is that the def statement reassignes the name "toHPU" to a
>function instead of a string. So when the code runs, you're passing a
>function object to s.copy2.
So...how do fix it?
>> import shutil
>>
>> #variables
>> s = shutil
>>
>> toHPU = "/etc/sysconfig/network/toHPU.wifi"
>
> import shutil
>
> #variables
> s = shutil
>
> toHPU = "/etc/sysconfig/network/toHPU.wifi"
> wlan = "/etc/sysconfig/network/ifcfg-wlan-id-00:0e:38:88:ba:6d"
> toAnyWifi = "/etc/sysconfig/network/toAny.wifi"
> wired = "/etc/sysconfig/network/ifcfg-eth-id-00:0b:db:1b:e3:88"
>
>
> def toHPU():
>
>
>
PROBLEM: for some reason, the variables won't work outside the function.
I tried fix it by converting the variables to str and unicode and still no
joy.
The only way it works is by typing each source and
destination file by hand on the shutil.copy2() method.
Or by specify