473,396 Members | 2,106 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,396 software developers and data experts.

trouble running a python function

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

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
Dec 14 '06 #1
3 1214
bartonc
6,596 Expert 4TB
Hi, using Python 2.3. Trying to write a function which will activate with
onmousedown="function()"

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:
Expand|Select|Wrap|Line Numbers
  1. def onmousedown():
  2.     pass    # put your code here
but if this an object methond it's:
Expand|Select|Wrap|Line Numbers
  1. def onmousedown(self):   # the name "self" is conventional (not the required name)
  2.     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
Dec 14 '06 #2
Hi Frank. Posting code will help us. I think you may be looking for this:
Expand|Select|Wrap|Line Numbers
  1. def onmousedown():
  2.     pass    # put your code here
but if this an object methond it's:
Expand|Select|Wrap|Line Numbers
  1. def onmousedown(self):   # the name "self" is conventional (not the required name)
  2.     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.

Expand|Select|Wrap|Line Numbers
  1. def runit() :
  2.     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="runit()"

Frank
Dec 14 '06 #3
bartonc
6,596 Expert 4TB
Hi Barton, Thanks for replying.

Expand|Select|Wrap|Line Numbers
  1. def runit() :
  2.     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="runit()"

Frank
Ok, that helps. Will you also copy the whole error message here? Thanks.
Dec 15 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: vincent wehren | last post by:
Hi, I'm running into trouble building Python2.3.3c1 from source on a Windows XP machine. I'm getting C:\Python-2.3.3c1\PC\python_nt.rc(14) : fatal error RC1015: cannot open include file...
1
by: Scott Brady Drummonds | last post by:
Hi, everyone, I have a tool I've written in Python that is taking many hours to run but I believe could be running in less than an hour with a more clever implementation. As such, I'm trying to...
4
by: Rembrandt Q Einstein | last post by:
I am running an external command and I need to know a) when it is done and b) what it wrote to both stdout and stderr. After a little searching, I found the popen2 module and used the Popen3...
1
by: Frans Englich | last post by:
Hello all, I have a couple of questions related to module importing. 1) When I start my Python program with `python foo.py` instead of simply adding a interpreter comment on the first line and...
6
by: Gonzalo Monzón | last post by:
Hi all! I have been translating some Python custom C extension code into Python, as I need these modules to be portable and run on a PocketPC without the need of compile (for the purpose its a...
2
by: goetzie | last post by:
I am using Python 2.4.1 and Numeric 23.8 and running on Windows XP. I am passing a Numeric array of strings (objects) to a C Extension module using the following python code: import Numeric...
5
by: tkondal | last post by:
Hi all. I just started looking at Python's ctypes lib and I am having trouble using it for a function. For starters, here's my Python code: from ctypes import*; myStringDLL=...
3
by: sab | last post by:
Hello, I have been working on a python script to parse a continuously growing log file on a UNIX server. The input is the standard in, piped in from the log file. The application works well...
0
by: Gabriel Genellina | last post by:
En Sat, 18 Oct 2008 05:52:04 -0300, Stef Mientki <stef.mientki@gmail.com> escribió: Why don't you let the caller tell you its own location, using __file__? The above code is too much magic for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.