Downloading a file form a displayed table

Dave Angel davea at davea.name
Tue Mar 5 05:05:00 EST 2013


On 03/05/2013 04:48 AM, Νίκος Γκρ33κ wrote:
> Τη Τρίτη, 5 Μαρτίου 2013 11:45:09 π.μ. UTC+2, ο χρήστης Dave Angel έγραψε:
>
>> It would be useful to actually specifying the context of this fragment
>>
>> of code.  Presumably it's running on a web server somewhere, and you're
>>
>> expecting the filenames to somehow show up on a browser.  Which OS and
>>
>> which version of Python for that server, and what brand and version of
>>
>> browser?
>>
>>
>>
>> Have you considered closing the table, and ending the body of the page?
>
> The server run Linux and python version is v2.7 and the browser is Chrome v27
>
> The source appears empty.

In that case, there's something wrong far outside of this code fragment. 
  A web page (html) has lots of required elements which were presumably 
in other parts of the script that are not shown here.


>
> Frankly i dont see anythign wrong with my code:
>
> 	path = "/data/files/"
> 	
> 	for filename in os.walk(path):
> 		print '''
> 		<form method="get" action="%s">
> 			<tr><td><center> <button type="submit"> %s </button> </td></tr>
> 		</form>
> 		''' % (filename, filename)
> 			
> 	sys.exit(0)
>


-- 
DaveA



More information about the Python-list mailing list