473,416 Members | 1,614 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,416 software developers and data experts.

Help with CGI functions on python.

8
Hi all....

i'm very new to this programming language. i'm required to fulfill this task in the company i'm doing my practical. i hope i can get guide for my problem...
Here is the script i already wrote but i'm having problem to move forward.

#!C:\python24\python.exe

####Code for viewing database....or search function#######

print 'Content-type: text/html\n\n'

import cgi # importing cgi module

import MySQLdb #importing MySQLdb module

form = cgi.FieldStorage() #assigning form to the cgi.FieldStorage

attribute = form.getvalue("attribute") #assigning attribute to get value from the function called attribute(drop down box) in the form

search = form.getvalue("search") #assigning search to get value from the function called search(textbox) in the form

conn =MySQLdb.connect(host = 'localhost', db='LESS', user ='root', passwd='') #creating conn to connect to MySQL

curs = conn.cursor() #creating a cursor called curs

curs.execute("use LESS") # exucuting the database

table = "download_file" #assignin table to download_file which is retrieved from MySql "less" under tables
#(download_file is a table name in less)

query = "select * from %s where %s like '%s'" %(table, attribute, search) #assigin query to MySQL command of select

#print query
curs.execute(query) #executing command set in the query function

count = curs.rowcount #indicating the cursor to count the rows
######## start of HTML code ##########
page= '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml
<head><title>View Database</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="http://localhost/Pictures/mm_travel2.css" type="text/css" />

<style type="text/css">
<!--
.style1 {font-family: Georgia}
.style2 {font-family: "Franklin Gothic Medium"}
.style3 {
font-family: "Franklin Gothic Medium";
font-weight: bold;
font-size: x-small;
font-style: italic;
}
.style4 {font-family: Georgia; font-size: 12px; }
.style5 {font-family: "Comic Sans MS"; font-weight: bold; font-size: large; color: #3300FF; }
.style6 {
font-size: large;
font-family: "Comic Sans MS";
font-style: italic;
font-weight: bold;
}
.style7 {font-size: large; font-family: "Comic Sans MS"; font-style: italic; color: #CC66CC; }
.style8 {font-family: "Times New Roman"; color: #000000; }
.style9 {
font-family: Arial;
font-weight: bold;
}
.style10 {
font-family: Roman;
font-size: 18px;
}
.style11 {color: #000000}
.style12 {
font-family: "Times New Roman";
font-style: italic;
}
.style13 {color: #000000; font-family: "Courier New"; }
.style14 {font-size: large; font-weight: bold; color: #006600; font-family: Verdana; }
.style15 {color: #006699;
font-weight: bold;
}
.style16 {color: #006699; font-weight: bold; font-size: 16px; }
-->
</style>

<script language="JavaScript" type="text/javascript">

var d=new Date();
var monthname=new Array("January","February","March","April","May"," June","July","August","September","October","Novem ber","December");
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
</script>
</head>
<body bgcolor="#C0DFFD">
<span class="style15"><img src="http://localhost/Pictures/f-secure.JPG" alt="Header image" width="153" height="144" border="0" /></span>
<h1 align="center">
<script language="JavaScript1.2">
var message="LESS File Collection!"
var neonbasecolor="#99FF66"
var neontextcolor="#CC3399"
var flashspeed=100 //in milliseconds
var n=0
if (document.all||document.getElementById){
document.write('<font color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
document.write('</font>')
}
else
document.write(message)
function crossref(number){
var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}
function neon(){
if (n==0){
for (m=0;m<message.length;m++)
crossref(m).style.color=neonbasecolor
}
crossref(n).style.color=neontextcolor
if (n<message.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}
function beginneon(){
if (document.all||document.getElementById)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>

<table width="104%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>

<tr bgcolor="#CCFF99">
<td>&nbsp;</td>
<td colspan="3" id="dateformat" height="25"><a href="LESS.html">HOME</a> ::<a href="Collection.html">Collection</a> ::<a href="Info.html">Info</a> ::<a href="Sources.html">Sources</a> :: <script language="JavaScript" type="text/javascript">
document.write(TODAY); </script> </td>
</tr>
<tr>
<td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr>
<td width="4">&nbsp;</td>
<td colspan="2" valign="top"><p>&nbsp;</p>
<p>&nbsp;</p></td>
<td width="590">&nbsp; </td>
</tr>
</table>
'''
print page
print "<p><div align=\"center\"><h1>Search with %s Results</h1>" %count
print "<i>Searching for %s with %s</i> </div></p>" %(attribute, search)
print "<form method=post action=http://localhost/cgi-bin/Raulf/next.py>"
print "<table border = 1 cellpadding =0 cellspacing = 0>"
##### End of HTML code ######

###### start of Html and python code for the header of the search table #######
print "<tr bgcolor=\"#cccccc\">"
print "<td></td>"

h = 0 #setting the values of the attribute as zero

while h < 9: # total attribute is 0-8 so while h is less than 9
desc = curs.description[h]
print "<th>%s</th>" %desc[0]
h += 1 #increase the h value.
print "</tr>"
print "<p align=right><input type=submit value=Download>&nbsp; <input type=submit value=Delete></p>"

###### End of code #####

###### start of Html and python code for the result of the search table #######

no_of_rows = 0 #setting the number of rows as zero



while True: #using while for true

row = curs.fetchone() #asking cursor to fetch one data at a time for a row
if not row: break #saying if its not a row the break it.

if (no_of_rows % 2): # for even no of row
print "<tr bgcolor=\"#dfdfdf\">" # if code is even, use such color for the cell
print "<td><input type=checkbox name=tick value=",form["attribute"].value=='d_id', "></td>"
i = 0
while i < 9:
print "<td>%s</td>" %row[i]
i += 1
else:
print "<td><input type=checkbox name=tick value=", form["attribute"].value=='d_id', "></td>"
i = 0
while i < 9:
print "<td>%s</td>" %row[i]
i += 1
no_of_rows += 1
print "</tr>"
print "</table>"

print "<div align = \"center\"><a href=\"http://localhost/Raulf/show_all.html\">Back</a>"
print "<input type=submit value=Submit>"
print "</form></body></html>"
my problem is :

1. how do i assign each checkbox to have equal value with the value of the d_id?

2. when the checkbox is clicked or check and when the submit button is pressed, how can i produce a new page showin me all the d_id of the check box that is clicked?

3. this is somethin like email function. when the checkbox is checked and delete button is pressed, how do i remove the checked files from my database?

4. finally if the checked box is checked and the download button is pressed, how do i download that particular file into the assignned folder, in this case assignned folder is C:\temp. If multiple box are checked, the file should be zipped and download in the assignned folder. how could i reach to this?

please assist me to this. i also will attach a snapshot.

Actually the codes above is a cgi for this codes:
<html>
<head>
<title>Source Downloader for LESS
</title>
<body>
<div align="left"><h1>Find record in LESS</h1></div>
<form method="POST" action="http://localhost/cgi-bin/Raulf/show_all.py">
<p>Select:
<select name ="attribute">
<option value="d_id">File ID</option>
<option value="filename">Filename</option>
<option value="extension">Extension</option>
<option value="size">Size(Bytes)</option>
<option value="url">Downloaded from</option>
<option value="location">Location in LESS</option>
<option value="md5">MD5</option>
<option value="SHA1">SHA1</option>
<option value="time_add">Date Entered</option>
</select>
<input type= text name="search">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</body>
</html>

very sorry. i'm extremely new to this and i have to complete this asap. can pls help me with the codes? thanks
Jan 15 '07 #1
3 2988
ghostdog74
511 Expert 256MB
hi

can you put your code in "code" tags, not "quote" tags.
thanks
Jan 15 '07 #2
cuties
8
sorry abt tat error....

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Source Downloader for LESS
  4. </title>
  5. <body>
  6. <div align="left"><h1>Find record in LESS</h1></div>
  7. <form method="POST" action="http://localhost/cgi-bin/Raulf/show_all.py">
  8. <p>Select:
  9. <select name ="attribute">
  10. <option value="d_id">File ID</option>
  11. <option value="filename">Filename</option>
  12. <option value="extension">Extension</option>
  13. <option value="size">Size(Bytes)</option>
  14. <option value="url">Downloaded from</option>
  15. <option value="location">Location in LESS</option>
  16. <option value="md5">MD5</option>
  17. <option value="SHA1">SHA1</option>
  18. <option value="time_add">Date Entered</option>
  19. </select>
  20. <input type= text name="search">
  21. <br>
  22. <input type="submit" value="Submit">
  23. <input type="reset" value="Reset">
  24. </body>
  25. </html>
Expand|Select|Wrap|Line Numbers
  1. #!C:\python24\python.exe
  2.  
  3. ####Code for viewing database....or search function#######
  4.  
  5. print 'Content-type: text/html\n\n'
  6.  
  7. import cgi # importing cgi module
  8.  
  9. import MySQLdb #importing MySQLdb module
  10.  
  11. form = cgi.FieldStorage() #assigning form to the cgi.FieldStorage
  12.  
  13. attribute = form.getvalue("attribute") #assigning attribute to get value from the function called attribute(drop down box) in the form
  14.  
  15. search = form.getvalue("search") #assigning search to get value from the function called search(textbox) in the form
  16.  
  17. conn =MySQLdb.connect(host = 'localhost', db='LESS', user ='root', passwd='') #creating conn to connect to MySQL
  18.  
  19. curs = conn.cursor() #creating a cursor called curs
  20.  
  21. curs.execute("use LESS") # exucuting the database
  22.  
  23. table = "download_file" #assignin table to download_file which is retrieved from MySql "less" under tables
  24. #(download_file is a table name in less)
  25.  
  26. query = "select * from %s where %s like '%s'" %(table, attribute, search) #assigin query to MySQL command of select
  27.  
  28. #print query
  29. curs.execute(query) #executing command set in the query function
  30.  
  31. count = curs.rowcount #indicating the cursor to count the rows
  32. ######## start of HTML code ##########
  33. page= '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  34. <html xmlns="http://www.w3.org/1999/xhtml
  35. <head><title>View Database</title>
  36.  
  37. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  38. <link rel="stylesheet" href="http://localhost/Pictures/mm_travel2.css" type="text/css" />
  39.  
  40. <style type="text/css">
  41. <!--
  42. .style1 {font-family: Georgia}
  43. .style2 {font-family: "Franklin Gothic Medium"}
  44. .style3 {
  45. font-family: "Franklin Gothic Medium";
  46. font-weight: bold;
  47. font-size: x-small;
  48. font-style: italic;
  49. }
  50. .style4 {font-family: Georgia; font-size: 12px; }
  51. .style5 {font-family: "Comic Sans MS"; font-weight: bold; font-size: large; color: #3300FF; }
  52. .style6 {
  53. font-size: large;
  54. font-family: "Comic Sans MS";
  55. font-style: italic;
  56. font-weight: bold;
  57. }
  58. .style7 {font-size: large; font-family: "Comic Sans MS"; font-style: italic; color: #CC66CC; }
  59. .style8 {font-family: "Times New Roman"; color: #000000; }
  60. .style9 {
  61. font-family: Arial;
  62. font-weight: bold;
  63. }
  64. .style10 {
  65. font-family: Roman;
  66. font-size: 18px;
  67. }
  68. .style11 {color: #000000}
  69. .style12 {
  70. font-family: "Times New Roman";
  71. font-style: italic;
  72. }
  73. .style13 {color: #000000; font-family: "Courier New"; }
  74. .style14 {font-size: large; font-weight: bold; color: #006600; font-family: Verdana; }
  75. .style15 {color: #006699;
  76. font-weight: bold;
  77. }
  78. .style16 {color: #006699; font-weight: bold; font-size: 16px; }
  79. -->
  80. </style>
  81.  
  82. <script language="JavaScript" type="text/javascript">
  83.  
  84. var d=new Date();
  85. var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  86. var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
  87. </script>
  88. </head>
  89. <body bgcolor="#C0DFFD">
  90. <span class="style15"><img src="http://localhost/Pictures/f-secure.JPG" alt="Header image" width="153" height="144" border="0" /></span>
  91. <h1 align="center">
  92. <script language="JavaScript1.2">
  93. var message="LESS File Collection!"
  94. var neonbasecolor="#99FF66"
  95. var neontextcolor="#CC3399"
  96. var flashspeed=100 //in milliseconds
  97. var n=0
  98. if (document.all||document.getElementById){
  99. document.write('<font color="'+neonbasecolor+'">')
  100. for (m=0;m<message.length;m++)
  101. document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
  102. document.write('</font>')
  103. }
  104. else
  105. document.write(message)
  106. function crossref(number){
  107. var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
  108. return crossobj
  109. }
  110. function neon(){
  111. if (n==0){
  112. for (m=0;m<message.length;m++)
  113. crossref(m).style.color=neonbasecolor
  114. }
  115. crossref(n).style.color=neontextcolor
  116. if (n<message.length-1)
  117. n++
  118. else{
  119. n=0
  120. clearInterval(flashing)
  121. setTimeout("beginneon()",1500)
  122. return
  123. }
  124. }
  125. function beginneon(){
  126. if (document.all||document.getElementById)
  127. flashing=setInterval("neon()",flashspeed)
  128. }
  129. beginneon()
  130. </script>
  131.  
  132. <table width="104%" border="0" cellspacing="0" cellpadding="0">
  133. <tr>
  134. <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  135. </tr>
  136.  
  137. <tr bgcolor="#CCFF99">
  138. <td>&nbsp;</td>
  139. <td colspan="3" id="dateformat" height="25"><a href="LESS.html">HOME</a> ::<a href="Collection.html">Collection</a> ::<a href="Info.html">Info</a> ::<a href="Sources.html">Sources</a> :: <script language="JavaScript" type="text/javascript">
  140. document.write(TODAY); </script> </td>
  141. </tr>
  142. <tr>
  143. <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  144. </tr>
  145. <tr>
  146. <td width="4">&nbsp;</td>
  147. <td colspan="2" valign="top"><p>&nbsp;</p>
  148. <p>&nbsp;</p></td>
  149. <td width="590">&nbsp; </td>
  150. </tr>
  151. </table>
  152. '''
  153. print page
  154. print "<p><div align=\"center\"><h1>Search with %s Results</h1>" %count
  155. print "<i>Searching for %s with %s</i> </div></p>" %(attribute, search)
  156. print "<form method=post action=http://localhost/cgi-bin/Raulf/next.py>"
  157. print "<table border = 1 cellpadding =0 cellspacing = 0>"
  158. ##### End of HTML code ######
  159.  
  160. ###### start of Html and python code for the header of the search table #######
  161. print "<tr bgcolor=\"#cccccc\">"
  162. print "<td></td>"
  163.  
  164. h = 0 #setting the values of the attribute as zero
  165.  
  166. while h < 9: # total attribute is 0-8 so while h is less than 9
  167. desc = curs.description[h]
  168. print "<th>%s</th>" %desc[0]
  169. h += 1 #increase the h value.
  170. print "</tr>"
  171. print "<p align=right><input type=submit value=Download>&nbsp; <input type=submit value=Delete></p>"
  172.  
  173. ###### End of code #####
  174.  
  175. ###### start of Html and python code for the result of the search table #######
  176.  
  177. no_of_rows = 0 #setting the number of rows as zero
  178.  
  179.  
  180.  
  181. while True: #using while for true
  182.  
  183. row = curs.fetchone() #asking cursor to fetch one data at a time for a row
  184. if not row: break #saying if its not a row the break it.
  185.  
  186. if (no_of_rows % 2): # for even no of row
  187. print "<tr bgcolor=\"#dfdfdf\">" # if code is even, use such color for the cell
  188. print "<td><input type=checkbox name=tick value=",form["attribute"].value=='d_id', "></td>"
  189. i = 0
  190. while i < 9:
  191. print "<td>%s</td>" %row[i]
  192. i += 1
  193. else:
  194. print "<td><input type=checkbox name=tick value=", form["attribute"].value=='d_id', "></td>"
  195. i = 0
  196. while i < 9:
  197. print "<td>%s</td>" %row[i]
  198. i += 1
  199. no_of_rows += 1
  200. print "</tr>"
  201. print "</table>"
  202.  
  203. print "<div align = \"center\"><a href=\"http://localhost/Raulf/show_all.html\">Back</a>"
  204. print "<input type=submit value=Submit>"
  205. print "</form></body></html>"
  206.  
Jan 15 '07 #3
cuties
8
sorry for the error i caused. earlier i also said that i'll attach a snapshot but i'm not available to do it. anyway my question is something like how our email system works. Only extra tasks is der such as user can view results of all the checked output. for question no2 i did try writing a script but i jst don't get the results that i desire. here is the codes

Expand|Select|Wrap|Line Numbers
  1. #!C:\python24\python.exe
  2.  
  3. print 'Content-type: text/html\n\n'
  4.  
  5. import cgi
  6.  
  7. import MySQLdb  
  8.  
  9. form = cgi.FieldStorage() 
  10.  
  11. tick = form.getvalue("tick")
  12.  
  13. attribute = form.getvalue("attribute") 
  14.  
  15. search = form.getvalue("search") 
  16.  
  17. conn =MySQLdb.connect(host = 'localhost', db='LESS', user ='root', passwd='') 
  18.  
  19. curs = conn.cursor() 
  20.  
  21. curs.execute("use LESS")  
  22.  
  23. page= '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml
  25. <head><title>Results of Checked Output</title>
  26.  
  27. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  28. <link rel="stylesheet" href="http://localhost/Pictures/mm_travel2.css" type="text/css" />
  29.  
  30. <style type="text/css">
  31. <!--
  32. .style1 {font-family: Georgia}
  33. .style2 {font-family: "Franklin Gothic Medium"}
  34. .style3 {
  35.     font-family: "Franklin Gothic Medium";
  36.     font-weight: bold;
  37.     font-size: x-small;
  38.     font-style: italic;
  39. }
  40. .style4 {font-family: Georgia; font-size: 12px; }
  41. .style5 {font-family: "Comic Sans MS"; font-weight: bold; font-size: large; color: #3300FF; }
  42. .style6 {
  43.     font-size: large;
  44.     font-family: "Comic Sans MS";
  45.     font-style: italic;
  46.     font-weight: bold;
  47. }
  48. .style7 {font-size: large; font-family: "Comic Sans MS"; font-style: italic; color: #CC66CC; }
  49. .style8 {font-family: "Times New Roman"; color: #000000; }
  50. .style9 {
  51.     font-family: Arial;
  52.     font-weight: bold;
  53. }
  54. .style10 {
  55.     font-family: Roman;
  56.     font-size: 18px;
  57. }
  58. .style11 {color: #000000}
  59. .style12 {
  60.     font-family: "Times New Roman";
  61.     font-style: italic;
  62. }
  63. .style13 {color: #000000; font-family: "Courier New"; }
  64. .style14 {font-size: large; font-weight: bold; color: #006600; font-family: Verdana; }
  65. .style15 {color: #006699;
  66.     font-weight: bold;
  67. }
  68. .style16 {color: #006699; font-weight: bold; font-size: 16px; }
  69. -->
  70. </style>
  71.  
  72. <script language="JavaScript" type="text/javascript">
  73.  
  74. var d=new Date();
  75. var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  76. var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
  77. </script>
  78. </head>
  79. <body bgcolor="#C0DFFD">
  80. <span class="style15"><img src="http://localhost/Pictures/f-secure.JPG" alt="Header image" width="153" height="144" border="0" /></span>
  81. <h1 align="center">
  82. <script language="JavaScript1.2">
  83. var message="LESS File Collection!"
  84. var neonbasecolor="#99FF66"
  85. var neontextcolor="#CC3399"
  86. var flashspeed=100  //in milliseconds
  87. var n=0
  88. if (document.all||document.getElementById){
  89. document.write('<font color="'+neonbasecolor+'">')
  90. for (m=0;m<message.length;m++)
  91. document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
  92. document.write('</font>')
  93. }
  94. else
  95. document.write(message)
  96. function crossref(number){
  97. var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
  98. return crossobj
  99. }
  100. function neon(){
  101. if (n==0){
  102. for (m=0;m<message.length;m++)
  103. crossref(m).style.color=neonbasecolor
  104. }
  105. crossref(n).style.color=neontextcolor
  106. if (n<message.length-1)
  107. n++
  108. else{
  109. n=0
  110. clearInterval(flashing)
  111. setTimeout("beginneon()",1500)
  112. return
  113. }
  114. }
  115. function beginneon(){
  116. if (document.all||document.getElementById)
  117. flashing=setInterval("neon()",flashspeed)
  118. }
  119. beginneon()
  120. </script>
  121.  
  122. <table width="104%" border="0" cellspacing="0" cellpadding="0">
  123.   <tr>
  124.     <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  125.   </tr>
  126.  
  127.   <tr bgcolor="#CCFF99">
  128.       <td>&nbsp;</td>
  129.       <td colspan="3" id="dateformat" height="25"><a href="LESS.html">HOME</a> ::<a href="Collection.html">Collection</a> ::<a href="Info.html">Info</a> ::<a href="Sources.html">Sources</a> :: <script language="JavaScript" type="text/javascript">
  130.       document.write(TODAY);    </script>    </td>
  131.   </tr>
  132.  <tr>
  133.     <td colspan="4" bgcolor="#003366"><img src="http://localhost/Pictures/spacer.gif" alt="" width="1" height="1" border="0" /></td>
  134.   </tr>
  135.  <tr>
  136.     <td width="4">&nbsp;</td>
  137.     <td colspan="2" valign="top"><p>&nbsp;</p>
  138.     <p>&nbsp;</p></td>
  139.       <td width="590">&nbsp; </td>
  140.   </tr>
  141. </table>
  142. '''
  143. print page
  144.  
  145. if tick == True:
  146.     print "The d_id", form["tick"].value, "is checked" 
  147. else: 
  148.     print "Nothing is ticked"
  149.  
  150.  
  151.  
  152. print "</body></html>"
  153.  
  154.  
Jan 15 '07 #4

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

Similar topics

5
by: sinisam | last post by:
Object oriented programming is not a new term to me, but when I tried to do some of it... uhh... it sure looked (and felt) like Hell :) I won't bother about things like "help me learn it" (but...
99
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
0
by: Neal D. Becker | last post by:
I'm using boost::python to transform various C++ classes and functions to python. It is all working quite well, but now I'm having trouble with documentation tools. I hope someone can tell me...
45
by: Joh | last post by:
hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = would like to produce : , , , ,
2
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to...
3
by: stuart_white_ | last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the new version of Python seems to be running correctly, I can't seem access the help from the interpreter. On Python 2.3.3...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
8
by: metaperl | last post by:
Hi, I would like an IDE that shows me all methods and functions I can call on a particular data item. For instance, iter() can be called on any sequence, but it is not a method. Nonetheless,...
2
by: Chris Smith | last post by:
Howdy, I'm a college student and for one of we are writing programs to numerically compute the parameters of antenna arrays. I decided to use Python to code up my programs. Up to now I haven't...
3
by: pycraze | last post by:
Hi , I am currently trying to implement base64 encoding and decoding scheme in C . Python has a module , base64 , that will do the encoding and decoding with ease . I am aware of OpenSSL having...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.