HTML - Hhtml/cgi Using Python
okay guys.. got a html page with forms and all.. sending all that data to a script using cgi..
in my cgi i call a python program that uses these variables and does some work. that program finally returns a variable back to the cgi script i'm trying to print that value back in the html page.. i just getting a blank page in my cgi before i call the python script i have some standard print commands .. that is also not getting printed.. i've given the print "content type" and all that before.. i was having problems calling th python script.. that time the printing from cgi was working. your help would be greatly appreciated guys thanks in advance Similar Tutorialshtml is there.. calling cgi.. from cgi i'm printing values back in html.. i'm printing a table sort of ting i want it to appear that it is auto refreshing with every iteration in the loop how do i go about it ? assume text color =black, background=white one way i thought was to print the data ..change the text color to white, re print, .. data changes (iteration) then again change text color back to black, then again print.. and so on not able to implement this I am programming cgi with python I need help, i am using windows, and whenever I save a script as somescript.cgi, It doesn't recognize the file and when I try to open it as a web page it just displays the text I am puting #!C:\Python25\python.exe before every script but it is not working, I need Help! Thank You -HTMLMW Ok, I'm in the process of creating a file explorer using 2 cgi scripts and one html file. The html file creates 2 frames, and calls 1 of the cgi scripts in each frame. The cgi scripts are written in python and html code. What I want I need to do is be able to click on a directory in the left frame and it opens it up in the right frame, while also opening the directory up in the left frame. Now link is dynamic seing as there are several directories. So I want to make it so that when I click on the directory link, it opens two links, modifying both frames. So I tried adding this underlined code in my code in the script that is called in the left frame: frame2 is the name of the second frame. #!/usr/bin/python print "Content-type: text/html\n\n" import re,os,sys def arbre(repertoire): liste=os.listdir(repertoire) print "<html>" +str(sys.argv[1])+ "<html>" for fichier in liste: if os.path.isdir(repertoire+"/"+fichier): print "<html>" "<div style='position:relative; top:15; width:500; height:20;'>" "<a href='http://localhost/cgi-bin/liste.cgi?"+str(sys.argv[1])+"/"+str(fichier)+"' onClick='parent.frame2.location.href='http://localhost/cgi-bin/contenu.cgi?"+str(sys.argv[1])+"/"+str(fichier)+"'>" "<img src='http://localhost/apache2-default/repertoire.gif' width='25' height='25' alt='blarr' align=left border=no>" "</img>" "</a>" "<h5>" ,fichier, "</h5>" "</div>" "</html>" arbre(sys.argv[1]) This does not work, the left frame(frame1) works the same, but the second frame is not modified, help please? This might you give you a better idea of what I'm talking about: ok people this is what i'm trying to do i have html.. calls cgi ..(using python).. through cgi i wanna be able to display a file back on html this is what i'm trying print '''<button type="button" onclick='window.location.href="file.txt"'>new</button>''' so basically on click i want it to display contentts of file.txt.. just not happening path and all is correct another thing.. without cgi.. just in windows and notepad this works fine.. i feel it can't be a cgi problem as other variables and all are getting printed fine through cgi back on html thanks in advance for your help Hello All, I am new to this, and not sure if this is the right forum. But, I have a simple web page with drop down menus where I can put values for a calculation. I would like to have the values saved as an input file for a python script that resides on the server. I would like the input file to be created and then the script executed and the output appear as a new page. I have googled this and have come up empty. Can someone point me in the right direction. Thanks, Bryan |