               [1]Billy-Bob Ming               * [3]Billy-Bob's Ming Server
             [2]Get The Good Stuff             * [4]Ming Server Manual
                                               * [5]Ming Server Incoming Data Handler
          Ming Server Python Data Type

    Pages of Python Output

    The Ming Server allows you to create pages using python scripts. The script is run using an os.popen3 call, the output  is
    captured, and is inserted into the  site.html. The output is processed by  HTMLParser and HTMLMaker. Make sure the  python
    scripts are executable (chmod 755)

    To use this data type, you must set the type to python. The line looks like:

      #python

    To pass params to your python scripts, include a "params" key in your form data. You can pass multiple params like this:

      /cgi-bin/ming.cgi?page=somepage&params=one:two:three

    Just split the params string on the separator in your script.

    Below is a python data type page as an example.

    --------------------------------------------------------------------------------------------------------------------------

 #python

 import os, pickle, time

 def hdr():
         print """
         <font color=red>Hey!</font> --
         """
         return

 def count():
         LOG = "ming.cgi.pob.log"
         if (os.path.isdir("/tmp/persistent")):
                 LOG = "/tmp/persistent/"+LOG
         try:
                 f = open(LOG)
                 dict = pickle.load(f)
                 f.close()
                 views = dict["last"]
         except:
                 views = 0
         print `views`
         return


 def ftr():
         print """
         of you came by yesterday and not one of you told me what you wanted
         Pobble to do.  You see, I am not a teacher. And rather than take this
         any further on my own, in a direction teachers might not use,
         I'm waiting on you.
         <p>
         Set Pobble up on your own machines, try it out, and think about where it
         should be going.  We can take it anywhere you'd like.  While you're
         thinking about what Pobble could do for you, think about what you would
         like to do for Pobble.
         (The easy answer is
         <a href="http://sourceforge.net/donate/index.php?group_id=97331">money</a>
         -- but little good ever comes from taking the easy way out.)
         <p>
         When you've done your thinking,
         <a href="mailto:your_email@some.com">speak up</a>.
         Because if you don't, this is as far as I take this project.  (I took it
         this far to help my daughter learn Spanish.)  Okay then, here I am--ready when
         you are.  Welcome to the free software revolution.
         <p>
         Updated:
         """
         return

 def stamp():
         s = time.ctime(time.time())
         print s[:10]+s[-5:]

 hdr()
 count()
 ftr()
 stamp()

                 [6]We Publish                           [8]You Publish                           [10]You Write
                 [7]We Publish                           [9]You Publish                           [11]You Write
                                                  [12]WHAT'S HOT ON BILLY-BOB?
          [13]Free Software Foundation                 [15]billy-bob ming                  [17]Creative Commons License
               [14]GPL'D Software                       [16]Our Founders                      [18]Copyrighted Works

References

   Visible links
   1. http://192.168.56.2/billybobming.html
   2. http://192.168.56.2/billybobming.html
   3. http://192.168.56.2/cgibin/ming.cgi?page=sites/ming/index
   4. http://192.168.56.2/cgibin/ming.cgi?page=sites/ming/01server/index
   5. http://192.168.56.2/cgibin/ming.cgi?page=sites/ming/01server/incoming
   6. http://billy-bob-ming.com/cgibin/ming.cgi?page=sites/billybob/breakfast
   7. http://billy-bob-ming.com/cgibin/ming.cgi?page=sites/billybob/breakfast
   8. http://billy-bob-ming.com/cgibin/ming.cgi?page=sites/ming/index
   9. http://billy-bob-ming.com/cgibin/ming.cgi?page=sites/ming/index
  10. http://billy-bob-ming.com/ghostwriter/
  11. http://billy-bob-ming.com/ghostwriter/
  12. http://192.168.56.2/cgibin/ming.cgi?page=open/logger/hits
  13. http://www.fsf.org/
  14. http://www.fsf.org/
  15. http://billy-bob-ming.com/billybobming.html
  16. http://billy-bob-ming.com/billybobming.html
  17. http://creativecommons.org/licenses/by-nc-nd/2.5/
  18. http://creativecommons.org/licenses/by-nc-nd/2.5/
