Diez B. Roggisch wrote:
> J schrieb:
>> On Mon, Dec 7, 2009 at 16:57, Diez B. Roggisch
>> wrote:
>>
if I put the import at the beginning of the class, it just dawned on
me that perhaps I still have to explicitly call the function by class:
> I'm not annoyed. I just wonder from what
J schrieb:
On Mon, Dec 7, 2009 at 16:57, Diez B. Roggisch wrote:
if I put the import at the beginning of the class, it just dawned on
me that perhaps I still have to explicitly call the function by class:
sysinfo.py
class myclass():
import os
def findDMIDecode(self):
for r,d,f i
On Mon, 07 Dec 2009 16:53:46 -0500, J wrote:
> A little more education and playing around and I'm still not quite sure
> how to do this...
>
> for the class i'm writing, I want to import os, sys and wmi globally for
> the class...
The best advice is Do Not Do It That Way. Just do your imports at
On Mon, 07 Dec 2009 22:18:49 -, J wrote:
On Mon, Dec 7, 2009 at 16:57, Diez B. Roggisch
wrote:
if I put the import at the beginning of the class, it just dawned on
me that perhaps I still have to explicitly call the function by class:
sysinfo.py
class myclass():
import os
def f
On Mon, Dec 7, 2009 at 16:57, Diez B. Roggisch wrote:
>> if I put the import at the beginning of the class, it just dawned on
>> me that perhaps I still have to explicitly call the function by class:
>>
>> sysinfo.py
>>
>> class myclass():
>> import os
>> def findDMIDecode(self):
>>
On Mon, 07 Dec 2009 21:13:25 -, J wrote:
Just a little newbie confusion about OS imports...
Why does this give me an error:
It's generally helpful to say *what* error you get, including the
traceback. Fortunately the source code is enough this time.
class Windows:
def __init__
J schrieb:
On Mon, Dec 7, 2009 at 16:13, J wrote:
But why does importing in the init not make os available to every
other function in the class? Do I have to import OS into every
function like this:
class ClassA():
def func1(self):
import os
def func2(self):
import os
On Mon, Dec 7, 2009 at 16:13, J wrote:
> But why does importing in the init not make os available to every
> other function in the class? Do I have to import OS into every
> function like this:
>
> class ClassA():
>
> def func1(self):
> import os
>
> def func2(self):
> import
J schrieb:
Just a little newbie confusion about OS imports...
Why does this give me an error:
class Windows:
def __init__(self):
'''
Constructor
'''
import os
self.dmidecodePath="" #final path to dmidecode binary
def parseDMI(self):
# Fi
Just a little newbie confusion about OS imports...
Why does this give me an error:
class Windows:
def __init__(self):
'''
Constructor
'''
import os
self.dmidecodePath="" #final path to dmidecode binary
def parseDMI(self):
# First, find dmi
10 matches
Mail list logo