trouble running a python function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ZZTOP123
    New Member
    • Dec 2006
    • 3

    #1

    trouble running a python function

    Hi, using Python 2.3. Trying to write a function which will activate with
    onmousedown="fu nction()"

    When I put this in the body statement of my page and load it, everything is fine, when I click on the page to activate my function I get an error. Not real specific just says object expected.

    Any help is aprecciated.

    Frank
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by ZZTOP123
    Hi, using Python 2.3. Trying to write a function which will activate with
    onmousedown="fu nction()"

    When I put this in the body statement of my page and load it, everything is fine, when I click on the page to activate my function I get an error. Not real specific just says object expected.

    Any help is aprecciated.

    Frank
    Hi Frank. Posting code will help us. I think you may be looking for this:
    Code:
    def onmousedown():
        pass    # put your code here
    but if this an object methond it's:
    Code:
    def onmousedown(self):   # the name "self" is conventional (not the required name)
        pass    # put your code here
    Of course, if the is an event handler in a GUI program, there must be a binding to a widget somewhere.
    So post some code and let us take a look at what's going on. Thanks,
    Barton

    Comment

    • ZZTOP123
      New Member
      • Dec 2006
      • 3

      #3
      Originally posted by bartonc
      Hi Frank. Posting code will help us. I think you may be looking for this:
      Code:
      def onmousedown():
          pass    # put your code here
      but if this an object methond it's:
      Code:
      def onmousedown(self):   # the name "self" is conventional (not the required name)
          pass    # put your code here
      Of course, if the is an event handler in a GUI program, there must be a binding to a widget somewhere.
      So post some code and let us take a look at what's going on. Thanks,
      Barton


      Hi Barton, Thanks for replying.

      Code:
      def runit() :
          server.rna_xmlrpc.invoke(session,'/interfaces/com3/rznet_peer/wellness/wellness/Boiler/HeatEnSP','set',changevalue)
      This is the function. I'm trying to run it in an asp file used as a web page, with onmousedown="ru nit()"

      Frank
      Last edited by bartonc; Dec 15 '06, 01:15 AM. Reason: added code tags

      Comment

      • bartonc
        Recognized Expert Expert
        • Sep 2006
        • 6478

        #4
        Originally posted by ZZTOP123
        Hi Barton, Thanks for replying.

        Code:
        def runit() :
            server.rna_xmlrpc.invoke(session,'/interfaces/com3/rznet_peer/wellness/wellness/Boiler/HeatEnSP','set',changevalue)
        This is the function. I'm trying to run it in an asp file used as a web page, with onmousedown="ru nit()"

        Frank
        Ok, that helps. Will you also copy the whole error message here? Thanks.

        Comment

        Working...