|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
i am building a website in Zope, and learning as i go along. can somebody help demonstrate how to write custom functions (using Python scripts i guess) such as:
a function called DrawSpacer() that would handle variables for height and width, so that when DrawSpacer(50, 20) is called, the result is something like <img src="/img/spacer.gif" height="50" width="20"> (after the page is parsed or course)? i have done this with ASP, but i cannot get it to work in Zope, yet i'm sure it can easily be done. this type of functionality would allow me to break up many parts of the site into reusable modules that draw certain aspects of the page; i just need a basic example to learn from. thanks. |
|
#2
|
|||
|
|||
|
First off I don't use Zope but I do write python. But since not many people post here I thought some help is better than none.
If I where to write what you described it would look like this def DrawSpacer(height, width): print "<img src=\"/img/spacer.gif\" height=\"%d\" width=\"%d\">" % (height, width) Then when you execute the function: DrawSpacer(50, 20) You should get what you want. Hope this helps. E. |
|
#3
|
|||
|
|||
|
What you want is listed below:
Code:
print "<img src='/img/spacer.gif' height='%d'0 width='%d'>" % (height, width) return printed |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > writing pyhton scripts in zope |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|