![Quote](images/misc/quote_icon.png)
Originally Posted by
cncmachineguy
more from the novice:
Followed the link, played with the button. Not sure how to access the .py scripts. If I right click and choose view source, all I see is the html source for the page. What am I missing?
Well... That is all there is at the moment ![Embarrassment](images/smilies/redface.gif)
The .py that the HTML button page triggers is in red on the first page. The HTML with the button sends info to the .py then the .py produces a web page with the results.
The HTML part that gets it going
form action="/cgi-bin/ChipDrop.py" method="post" target="_blank">
select name="ChipSel">
--SNIP--
Then the Python code picks it up here
# Get data from fields
if form.getvalue('ChipSel'):
subject = form.getvalue('ChipSel')
else:
subject = "Not entered"
So all I have is the HTML and one py script to display the config options.
BTW.
I used this to help generate the HTML. No way I typed all of that..
Code:
#!/usr/bin/python
import os
import re
import string
path="fileS" # insert the path to the directory of interest
dirList=os.listdir(path)
for fname in dirList:
str = fname
tx = str.strip('.INC');
sep = ''
list = ['<option value="fileS/',str,'">',tx,'</option>']
print sep.join(list)
Bookmarks