Jump to content

Getting python to work


Kbailey

Recommended Posts

Post the script here or give a direct link please.

 

(BEWARE WORD WRAP!

 

#!/usr/bin/python

#

#

#######################################################################

# PrayerWheel.py V:1.0.0 ©2010 by Kirk D Bailey All rights reserved. #

# this program is designed for theinternetprayerwheel site, and is #

# not offered for use on any other website. Genuine Buddist temple #

# websites may request a copy personalized for their site's use. #

#######################################################################

version="1.0.0"

#

import os, cgi

import cgitb; cgitb.enable()

#

# page header follows

print "Content-Type: text/html \n"

print '<html><head><title>Prayer Wheel Processor</title>'

print '<meta http-equiv="refresh" content="10;url=/index.shtml" >'

print '</head><body text="00FF00" bgcolor="black" links="0000FF"><P><center><h1>Processed.</h1></center><P>'

print 'Please wait 10 seconds. If it does not reload the page, <a href="/index.shtml">CLICK HERE</a>.<P> '

print '<P><br> '

os.chdir('..')

form=cgi.FieldStorage()

prayer=form['prayer'].value

append="""<hr width=50%>

<marquee bgcolor="black" behavior="scroll" direction="left" delay="1" scrollamount="4" onMouseover="this.scrollAmount=0" onMouseout="this.scrollAmount=4" loop="INFINITE" >"""+prayer+"""</marquee>

<p>

"""

f1=open('index.shtml','a')

f1.write(append)

f1.close()

print ' </body></html>'

 

 

 

Post the script here or give a direct link please.

Now hells bells, today it works, and nothing was changed by me... did you change something?

 

Link to comment
Share on other sites

The world may never know.

It is such as this thast keeps me lying awake nights. Perhaps I should put a prayer on the wheel about it?

 

 

Say, I added 2 new scripts. Click the big logo to activate 'editmypage.py'. Same error. The shebang is the same. LEt it be a day, just look and watch, let's see if it heals all bu itself automagically.

 

`Dis is gettin' inerinstin!

 

-Kirk

 

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...

 

 

Link to comment
Share on other sites

ok, I have a new script, eraser, and it will erase and rewrite the prayerwheel.txt file with only one wheel to start with, the permanent one at the top of them all.which is included via SSI into the page. The script has (it appears) the correct shebang. Permissions 755. It barks and dies. Hmmm, what the heck?

 

Let's see if it fixes itself like the other one did. I decided on using a resetting script instead of an editing script.

 

Also, the counter program already installed in the server is a pooch, it does not display. The code is:

<img src="/cgi-sys/Count.cgi?df=Counter.dat|display=Counter|ft=6|md=6|frgb=139;139;0|dd=3">

'Cound not write to counter file/var/cpanel/Counters/Counter.dat' appears in the box, not a counter.

 

sigh...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...