473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to wrap a class's methods?

I want to subclass an IMAP connection so that most of the
methods raise an exception if the returned status isn't 'OK'.
This works, but there's got to be a way to do it that doesn't
involve so much duplication:

class MyImap4_ssl(imaplib.IMAP4_SSL):

def login(*args):
s,r = imaplib.IMAP4_SSL.login(*args)
if s!='OK':
raise NotOK((s,r))
return r

def list(*args):
s,r = imaplib.IMAP4_SSL.list(*args)
if s!='OK':
raise NotOK((s,r))
return r

def search(*args):
s,r = imaplib.IMAP4_SSL.search(*args)
if s!='OK':
raise NotOK((s,r))
return r

[and so on for another dozen methods]

--
Grant Edwards grante Yow! I OWN six pink
at HIPPOS!!
visi.com
Jul 18 '05 #1
14 1849
Grant Edwards wrote:
I want to subclass an IMAP connection so that most of the
methods raise an exception if the returned status isn't 'OK'.
This works, but there's got to be a way to do it that doesn't
involve so much duplication:

class MyImap4_ssl(imaplib.IMAP4_SSL):

def login(*args):
s,r = imaplib.IMAP4_SSL.login(*args)
if s!='OK':
raise NotOK((s,r))
return r

def list(*args):
s,r = imaplib.IMAP4_SSL.list(*args)
if s!='OK':
raise NotOK((s,r))
return r

def search(*args):
s,r = imaplib.IMAP4_SSL.search(*args)
if s!='OK':
raise NotOK((s,r))
return r

[and so on for another dozen methods]


You could try something like (Untested!):

class Wrapper(object):
def __init__(self, func):
self.func = func
def __call__(*args, **kwargs):
self, args = args[0], args[1:]
s, r = self.func(*args)
if s != 'OK':
raise NotOK((s, r))
return r

for func_name in ['login', 'list', 'search']:
func = Wrapper(getattr(imaplib.IMAP4_SSL, func_name))
setattr(imaplib.IMAP4_SSL, func_name, func)

STeVe
Jul 18 '05 #2
Grant Edwards wrote:
I want to subclass an IMAP connection so that most of the
methods raise an exception if the returned status isn't 'OK'.
This works, but there's got to be a way to do it that doesn't
involve so much duplication:

class MyImap4_ssl(imaplib.IMAP4_SSL):

def login(*args):
s,r = imaplib.IMAP4_SSL.login(*args)
if s!='OK':
raise NotOK((s,r))
return r

def list(*args):
s,r = imaplib.IMAP4_SSL.list(*args)
if s!='OK':
raise NotOK((s,r))
return r

def search(*args):
s,r = imaplib.IMAP4_SSL.search(*args)
if s!='OK':
raise NotOK((s,r))
return r

[and so on for another dozen methods]


A more tested version of my other email:

py> class C(object):
.... def f(self, *args):
.... print "f:", args
.... def g(self, *args):
.... print "g:", args
....
py> class D(C):
.... pass
....
py> class Wrapper(object):
.... def __init__(self, func):
.... self.func = func
.... def __call__(self, *args):
.... print "wrapped"
.... return self.func(*args)
....
py> for name in ['f', 'g']:
.... wrapper = Wrapper(getattr(C, name))
.... setattr(D, name, new.instancemethod(wrapper, None, D))
....
py> C().f()
f: ()
py> C().g(1)
g: (1,)
py> D().f()
wrapped
f: ()
py> D().g(1)
wrapped
g: (1,)
Jul 18 '05 #3
On 2005-02-17, Steven Bethard <st************@gmail.com> wrote:
py> class C(object):
... def f(self, *args):
... print "f:", args
... def g(self, *args):
... print "g:", args
...
py> class D(C):
... pass
...
py> class Wrapper(object):
... def __init__(self, func):
... self.func = func
... def __call__(self, *args):
... print "wrapped"
... return self.func(*args)
...
py> for name in ['f', 'g']:
... wrapper = Wrapper(getattr(C, name))
... setattr(D, name, new.instancemethod(wrapper, None, D))


Thanks. The stuff provided by the "new" module is what I was
missing.

--
Grant Edwards grante Yow! Wait... is this a FUN
at THING or the END of LIFE in
visi.com Petticoat Junction??
Jul 18 '05 #4
Steven Bethard wrote:
Grant Edwards wrote:
I want to subclass an IMAP connection so that most of the
methods raise an exception if the returned status isn't 'OK'.
This works, but there's got to be a way to do it that doesn't
involve so much duplication:

class MyImap4_ssl(imaplib.IMAP4_SSL):

def login(*args):
s,r = imaplib.IMAP4_SSL.login(*args)
if s!='OK':
raise NotOK((s,r))
return r
def list(*args):
s,r = imaplib.IMAP4_SSL.list(*args)
if s!='OK':
raise NotOK((s,r))
return r
def search(*args):
s,r = imaplib.IMAP4_SSL.search(*args)
if s!='OK':
raise NotOK((s,r))
return r
[and so on for another dozen methods]

You could try something like (Untested!):

class Wrapper(object):
def __init__(self, func):
self.func = func
def __call__(*args, **kwargs):
self, args = args[0], args[1:]
s, r = self.func(*args)
if s != 'OK':
raise NotOK((s, r))
return r

for func_name in ['login', 'list', 'search']:
func = Wrapper(getattr(imaplib.IMAP4_SSL, func_name))
setattr(imaplib.IMAP4_SSL, func_name, func)


You could probably also do this as a factory function, rather than as
a class (also untested!):

def Wrapper(func):
def wrapped(self, *args, **kwargs):
s, r = func(self, *args, **kwargs)
if s != 'OK':
raise NotOK((s,r))
return r
return wrapped

I believe that this will be semantically almost equivalent, but
conceptually slightly simpler.

Jeff Shannon
Jul 18 '05 #5
Grant Edwards wrote:
I want to subclass an IMAP connection so that most of the
methods raise an exception if the returned status isn't 'OK'.
This works, but there's got to be a way to do it that doesn't
involve so much duplication:

class MyImap4_ssl(imaplib.IMAP4_SSL):

def login(*args):
s,r = imaplib.IMAP4_SSL.login(*args)
if s!='OK':
raise NotOK((s,r))
return r

def list(*args):
s,r = imaplib.IMAP4_SSL.list(*args)
if s!='OK':
raise NotOK((s,r))
return r

def search(*args):
s,r = imaplib.IMAP4_SSL.search(*args)
if s!='OK':
raise NotOK((s,r))
return r

[and so on for another dozen methods]


How about using a delegator:

class Wrapper:
funcs = ("login", "list", "search")
def __init__(self, classobj):
self.__wrapped = classobj()
def __getattr__(self, attr):
if attr in Wrapper.funcs:
def f(*args):
f1 = getattr(self.__wrapped, attr)
s,r = f1(args)
if s != 'OK': raise NotOk((s,r))
return r
return f
# raise some exception here
imap = Wrapper(imaplib.IMAP4_SSL)

If you wrap all methods you can ignore the if-test. Instead of the
class object you can pass instances to the wrapper if you need
special arguments for initialization.

I don't like subclassing;)

Mathias

PS: note that we're wrapping the instance's methods, not the class's
methods!
Jul 18 '05 #6
On Thu, Feb 17, 2005 at 07:32:55PM +0000, Grant Edwards wrote:
I want to subclass an IMAP connection so that most of the
methods raise an exception if the returned status isn't 'OK'.
This works, but there's got to be a way to do it that doesn't
involve so much duplication:

class MyImap4_ssl(imaplib.IMAP4_SSL):

def login(*args):
s,r = imaplib.IMAP4_SSL.login(*args)
if s!='OK':
raise NotOK((s,r))
return r

def list(*args):
s,r = imaplib.IMAP4_SSL.list(*args)
if s!='OK':
raise NotOK((s,r))
return r

def search(*args):
s,r = imaplib.IMAP4_SSL.search(*args)
if s!='OK':
raise NotOK((s,r))
return r

[and so on for another dozen methods]


something like this:

def NotOKVerified(orig):
def f(*args):
s, r = orig(*args)
if s != 'OK':
raise NotOK((s,r))
return r
return f

class MyImap4_ssl(IMAP4_SSL):
pass

for method_name in ('login', 'list', 'search'):
setattr(MyImap4_ssl, method_name, getattr(IMAP4_SSL, method_name))

?

I'd usually put big fat warnings around this code, and explain exaclty
why I need to do things this way...

--
John Lenton (jo**@grulic.org.ar) -- Random fortune:
"To vacillate or not to vacillate, that is the question ... or is it?"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCFPU3gPqu395ykGsRAmi/AJ9ETKZ6EZ5pgHfpibPOdPHbV24F0QCgltf4
kDEAtn7POsO/tXW0s2uuMZM=
=BjlO
-----END PGP SIGNATURE-----

Jul 18 '05 #7
Grant Edwards wrote:
On 2005-02-17, Steven Bethard <st************@gmail.com> wrote:

py> class C(object):
... def f(self, *args):
... print "f:", args
... def g(self, *args):
... print "g:", args
...
py> class D(C):
... pass
...
py> class Wrapper(object):
... def __init__(self, func):
... self.func = func
... def __call__(self, *args):
... print "wrapped"
... return self.func(*args)
...
py> for name in ['f', 'g']:
... wrapper = Wrapper(getattr(C, name))
... setattr(D, name, new.instancemethod(wrapper, None, D))

Thanks. The stuff provided by the "new" module is what I was
missing.

No magic in the 'new' module - new.instancemethod is just a synonym for the
method type:
import new, types
new.instancemethod is types.MethodType

True

Michael

Jul 18 '05 #8
On 2005-02-17, Mathias Waack <M.*****@gmx.de> wrote:
How about using a delegator:

class Wrapper:
funcs = ("login", "list", "search")
def __init__(self, classobj):
self.__wrapped = classobj()
def __getattr__(self, attr):
if attr in Wrapper.funcs:
def f(*args):
f1 = getattr(self.__wrapped, attr)
s,r = f1(args)
if s != 'OK': raise NotOk((s,r))
return r
return f
# raise some exception here
imap = Wrapper(imaplib.IMAP4_SSL)

If you wrap all methods you can ignore the if-test.
I'm not, and the other methods should behave "normally":

class Wrapper:
funcs = ("login", "list", "search")
def __init__(self, classobj):
self.__wrapped = classobj()
def __getattr__(self, attr):
if attr in Wrapper.funcs:
def f(*args):
f1 = getattr(self.__wrapped, attr)
s,r = f1(args)
if s != 'OK': raise NotOk((s,r))
return r
else:
f = getattr(self.__wrapped, attr)
return f
PS: note that we're wrapping the instance's methods, not the class's
methods!


You're right.

--
Grant Edwards grante Yow! "THE LITTLE PINK
at FLESH SISTERS," I saw them
visi.com at th' FLUROESCENT BULB
MAKERS CONVENTION...
Jul 18 '05 #9
On 2005-02-17, Michael Spencer <ma**@telcopartners.com> wrote:
Thanks. The stuff provided by the "new" module is what I was
missing.


No magic in the 'new' module - new.instancemethod is just a synonym for the
method type:
>>> import new, types
>>> new.instancemethod is types.MethodType

True


Thanks -- I didn't know that either.

--
Grant Edwards grante Yow! I joined scientology
at at a garage sale!!
visi.com
Jul 18 '05 #10
Michael Spencer wrote:
Grant Edwards wrote:

Thanks. The stuff provided by the "new" module is what I was
missing.

No magic in the 'new' module - new.instancemethod is just a synonym for
the method type:
>>> import new, types
>>> new.instancemethod is types.MethodType

True


(Assuming you're using Python 2.3 or newer)
Jul 18 '05 #11
John Lenton wrote:
On Thu, Feb 17, 2005 at 07:32:55PM +0000, Grant Edwards wrote:

I'd usually put big fat warnings around this code, and explain exaclty
why I need to do things this way...


As a low-tech alternative, what about sourcecode generation, since you are
targetting a python module? This gives two advantages vs the wrapping function:
1) the magic all occurs at coding time 2) the method signatures are documented.

Michael

import imaplib
import inspect
import types
instancemethod = types.MethodType

# The function template
funcwrapper = \
"""
def %(name)s%(argspec)s:
s,r = imaplib.IMAP4_SSL.%(name)s%(callspec)s
if s!='OK':
raise NotOK((s,r))
return r"""

# A helper function to get the template parameters
def getargs(method):
argspec = inspect.getargspec(method)
callspec = tuple(argspec[:3] + (None,))# No default

return {"name": method.__name__,
"argspec": inspect.formatargspec(*argspec),
"callspec": inspect.formatargspec(*callspec)}

# Do the stuff manually:
obj = imaplib.IMAP4_SSL
attrnames = [meth for meth in dir(imaplib.IMAP4_SSL) if not meth.startswith("_")] attributes = [getattr(obj, attrname) for attrname in attrnames]
methods = [attribute for attribute in attributes if inspect.ismethod(attribute)] print "\n".join(funcwrapper % getargs(method) for method in methods)
def append(self, mailbox, flags, date_time, message):
s,r = imaplib.IMAP4_SSL.append(self, mailbox, flags, date_time, message)
if s!='OK':
raise NotOK((s,r))
return r

def authenticate(self, mechanism, authobject):
s,r = imaplib.IMAP4_SSL.authenticate(self, mechanism, authobject)
if s!='OK':
raise NotOK((s,r))
return r

def check(self):
s,r = imaplib.IMAP4_SSL.check(self)
if s!='OK':
raise NotOK((s,r))
return r

def close(self):
s,r = imaplib.IMAP4_SSL.close(self)
if s!='OK':
raise NotOK((s,r))
return r

def copy(self, message_set, new_mailbox):
s,r = imaplib.IMAP4_SSL.copy(self, message_set, new_mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def create(self, mailbox):
s,r = imaplib.IMAP4_SSL.create(self, mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def delete(self, mailbox):
s,r = imaplib.IMAP4_SSL.delete(self, mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def deleteacl(self, mailbox, who):
s,r = imaplib.IMAP4_SSL.deleteacl(self, mailbox, who)
if s!='OK':
raise NotOK((s,r))
return r

def expunge(self):
s,r = imaplib.IMAP4_SSL.expunge(self)
if s!='OK':
raise NotOK((s,r))
return r

def fetch(self, message_set, message_parts):
s,r = imaplib.IMAP4_SSL.fetch(self, message_set, message_parts)
if s!='OK':
raise NotOK((s,r))
return r

def getacl(self, mailbox):
s,r = imaplib.IMAP4_SSL.getacl(self, mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def getquota(self, root):
s,r = imaplib.IMAP4_SSL.getquota(self, root)
if s!='OK':
raise NotOK((s,r))
return r

def getquotaroot(self, mailbox):
s,r = imaplib.IMAP4_SSL.getquotaroot(self, mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def list(self, directory='""', pattern='*'):
s,r = imaplib.IMAP4_SSL.list(self, directory, pattern)
if s!='OK':
raise NotOK((s,r))
return r

def login(self, user, password):
s,r = imaplib.IMAP4_SSL.login(self, user, password)
if s!='OK':
raise NotOK((s,r))
return r

def login_cram_md5(self, user, password):
s,r = imaplib.IMAP4_SSL.login_cram_md5(self, user, password)
if s!='OK':
raise NotOK((s,r))
return r

def logout(self):
s,r = imaplib.IMAP4_SSL.logout(self)
if s!='OK':
raise NotOK((s,r))
return r

def lsub(self, directory='""', pattern='*'):
s,r = imaplib.IMAP4_SSL.lsub(self, directory, pattern)
if s!='OK':
raise NotOK((s,r))
return r

def myrights(self, mailbox):
s,r = imaplib.IMAP4_SSL.myrights(self, mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def namespace(self):
s,r = imaplib.IMAP4_SSL.namespace(self)
if s!='OK':
raise NotOK((s,r))
return r

def noop(self):
s,r = imaplib.IMAP4_SSL.noop(self)
if s!='OK':
raise NotOK((s,r))
return r

def open(self, host='', port=993):
s,r = imaplib.IMAP4_SSL.open(self, host, port)
if s!='OK':
raise NotOK((s,r))
return r

def partial(self, message_num, message_part, start, length):
s,r = imaplib.IMAP4_SSL.partial(self, message_num, message_part, start,
length)
if s!='OK':
raise NotOK((s,r))
return r

def print_log(self):
s,r = imaplib.IMAP4_SSL.print_log(self)
if s!='OK':
raise NotOK((s,r))
return r

def proxyauth(self, user):
s,r = imaplib.IMAP4_SSL.proxyauth(self, user)
if s!='OK':
raise NotOK((s,r))
return r

def read(self, size):
s,r = imaplib.IMAP4_SSL.read(self, size)
if s!='OK':
raise NotOK((s,r))
return r

def readline(self):
s,r = imaplib.IMAP4_SSL.readline(self)
if s!='OK':
raise NotOK((s,r))
return r

def recent(self):
s,r = imaplib.IMAP4_SSL.recent(self)
if s!='OK':
raise NotOK((s,r))
return r

def rename(self, oldmailbox, newmailbox):
s,r = imaplib.IMAP4_SSL.rename(self, oldmailbox, newmailbox)
if s!='OK':
raise NotOK((s,r))
return r

def response(self, code):
s,r = imaplib.IMAP4_SSL.response(self, code)
if s!='OK':
raise NotOK((s,r))
return r

def search(self, charset, *criteria):
s,r = imaplib.IMAP4_SSL.search(self, charset, *criteria)
if s!='OK':
raise NotOK((s,r))
return r

def select(self, mailbox='INBOX', readonly=None):
s,r = imaplib.IMAP4_SSL.select(self, mailbox, readonly)
if s!='OK':
raise NotOK((s,r))
return r

def send(self, data):
s,r = imaplib.IMAP4_SSL.send(self, data)
if s!='OK':
raise NotOK((s,r))
return r

def setacl(self, mailbox, who, what):
s,r = imaplib.IMAP4_SSL.setacl(self, mailbox, who, what)
if s!='OK':
raise NotOK((s,r))
return r

def setquota(self, root, limits):
s,r = imaplib.IMAP4_SSL.setquota(self, root, limits)
if s!='OK':
raise NotOK((s,r))
return r

def shutdown(self):
s,r = imaplib.IMAP4_SSL.shutdown(self)
if s!='OK':
raise NotOK((s,r))
return r

def socket(self):
s,r = imaplib.IMAP4_SSL.socket(self)
if s!='OK':
raise NotOK((s,r))
return r

def sort(self, sort_criteria, charset, *search_criteria):
s,r = imaplib.IMAP4_SSL.sort(self, sort_criteria, charset,
*search_criteria)
if s!='OK':
raise NotOK((s,r))
return r

def ssl(self):
s,r = imaplib.IMAP4_SSL.ssl(self)
if s!='OK':
raise NotOK((s,r))
return r

def status(self, mailbox, names):
s,r = imaplib.IMAP4_SSL.status(self, mailbox, names)
if s!='OK':
raise NotOK((s,r))
return r

def store(self, message_set, command, flags):
s,r = imaplib.IMAP4_SSL.store(self, message_set, command, flags)
if s!='OK':
raise NotOK((s,r))
return r

def subscribe(self, mailbox):
s,r = imaplib.IMAP4_SSL.subscribe(self, mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def thread(self, threading_algorithm, charset, *search_criteria):
s,r = imaplib.IMAP4_SSL.thread(self, threading_algorithm, charset,
*search_criteria)
if s!='OK':
raise NotOK((s,r))
return r

def uid(self, command, *args):
s,r = imaplib.IMAP4_SSL.uid(self, command, *args)
if s!='OK':
raise NotOK((s,r))
return r

def unsubscribe(self, mailbox):
s,r = imaplib.IMAP4_SSL.unsubscribe(self, mailbox)
if s!='OK':
raise NotOK((s,r))
return r

def xatom(self, name, *args):
s,r = imaplib.IMAP4_SSL.xatom(self, name, *args)
if s!='OK':
raise NotOK((s,r))
return r


Jul 18 '05 #12
On 2005-02-17, Michael Spencer <ma**@telcopartners.com> wrote:
I'd usually put big fat warnings around this code, and explain exaclty
why I need to do things this way...


As a low-tech alternative, what about sourcecode generation,


Interesting idea. It's almost like haveing a macro capability. :)

--
Grant Edwards grante Yow! Oh my GOD -- the
at SUN just fell into YANKEE
visi.com STADIUM!!
Jul 18 '05 #13
rbt
Jeff Shannon wrote:
You could probably also do this as a factory function, rather than as a
class (also untested!):

def Wrapper(func):
def wrapped(self, *args, **kwargs):
s, r = func(self, *args, **kwargs)
if s != 'OK':
raise NotOK((s,r))
return r
return wrapped

I believe that this will be semantically almost equivalent, but
conceptually slightly simpler.

Jeff Shannon


This is a nice example. I have used sub-functions (functions within
functions) recently with some code, but I've wondered how proper it is
to do this. Is this type of thing frowned upon?
Jul 18 '05 #14
rbt wrote:
Jeff Shannon wrote:
You could probably also do this as a factory function, rather than as
a class (also untested!):

def Wrapper(func):
def wrapped(self, *args, **kwargs):
s, r = func(self, *args, **kwargs)
if s != 'OK':
raise NotOK((s,r))
return r
return wrapped

I believe that this will be semantically almost equivalent, but
conceptually slightly simpler.

Jeff Shannon


This is a nice example. I have used sub-functions (functions within
functions) recently with some code, but I've wondered how proper it is
to do this. Is this type of thing frowned upon?


Nope. If it was frowned upon, Python wouldn't support it. ;) Sometimes
it's even faster:

-------------------- test.py --------------------
def wrapper(func):
def wrapped(*args, **kwargs):
return bool(func(*args, **kwargs))
return wrapped

class Wrapper(object):
def __init__(self, func):
self.func = func
def __call__(self, *args, **kwargs):
return bool(self.func(*args, **kwargs))
-------------------------------------------------

$ python -m timeit -s "import test; w = test.wrapper(sum)" "w([]); w([1,2])"
100000 loops, best of 3: 4.77 usec per loop

$ python -m timeit -s "import test; w = test.Wrapper(sum)" "w([]); w([1,2])"
100000 loops, best of 3: 6.52 usec per loop

Personally, I still tend towards the class-based version, but I'm sure
in many cases the nested function version would work just as well.

STeVe
Jul 18 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JHR | last post by:
Hey all, I'm trying to make a sidebar box float to the right of various items, and for those items to wrap if a user shrinks his browser window. Instead, in every browser I've tried except for...
11
by: John Salerno | last post by:
My general problem with events seems to be that there are so many parts to them, and I'm not sure where they all go or when you use which parts. For example, there's the delegate, the event name,...
3
by: _BNC | last post by:
I have an old C DLL that I want to access via C#. I'm doing this via an outer DLL that wraps the old C DLL in an unmanaged C++ class, which is in turn wrapped in a Managed C++ class. Both these...
1
by: kathy | last post by:
I have posted my problem before and still not feel confused. Anyone know what is the problem? In my Win32 dll, I defined: #ifdef DllExport #define UNMANAGED_API __declspec(dllexport) #else...
2
by: YeJianWei | last post by:
I need to wrap a MFC extension Dll with export class(let's suppose it's named CA) so we could use it in C#. The dll is provided by third party vendor which means I couldn't modify it. A...
6
by: 314ccc | last post by:
I have some old code that uses very large c style arrays extensively. I am to the point where I need to write some new methods that access this data. Instead of passing this data as a pointer and...
5
by: pamela fluente | last post by:
I have been posting this question with no success. I do not know if I am not being clear of the question is too difficult :-)) or unclear. It seems to me that the need to wrap a collection is quite...
2
by: =?Utf-8?B?Y2hyaXNiZW4=?= | last post by:
Hi, I have some C++ static library which I would like to wrap and use in C# applications. It appears that I have two options. 1. Wrap the static library as dynamic library (dll), use unmanaged...
4
by: Greg Ewing | last post by:
I'm creating a COM server in Python that will have one main class, with methods that create and return instances of other classes. I've found that I need to use win32com.server.util.wrap and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.