Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40510

Re: Downloading a file form a displayed table

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'context': 0.05; 'filename': 0.07; 'filenames': 0.07; 'subject:file': 0.07; 'subject:form': 0.07; 'python': 0.09; "'''": 0.09; 'any.': 0.09; 'page?': 0.09; 'specifying': 0.09; 'looked': 0.10; 'server,': 0.15; 'sys.exit(0)': 0.16; 'wrote:': 0.17; 'code.': 0.20; 'displayed': 0.22; 'skip:= 20': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'table,': 0.29; "skip:' 10": 0.30; 'button': 0.30; 'code': 0.31; 'file': 0.32; 'running': 0.32; 'print': 0.32; 'to:addr:python-list': 0.33; 'version': 0.34; 'wrong': 0.34; 'server': 0.35; 'path': 0.35; 'table': 0.35; 'but': 0.36; 'closing': 0.36; 'useful': 0.36; 'anything': 0.36; 'display': 0.36; 'subject:: ': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'skip:" 10': 0.40; 'received:192.168': 0.40; 'your': 0.60; 'show': 0.63; 'dont': 0.64; 'received:74.208': 0.71; 'click': 0.76; 'brand': 0.78; 'browser.': 0.81; 'presumably': 0.84; 'fragment': 0.91
Date Tue, 05 Mar 2013 04:45:09 -0500
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: Downloading a file form a displayed table
References <f99ae3d5-6f1f-4dfc-84da-78b758a5147a@googlegroups.com>
In-Reply-To <f99ae3d5-6f1f-4dfc-84da-78b758a5147a@googlegroups.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Provags-ID V02:K0:Fl5LBxxXfwH8jLfy2buNtYunEzV72JpdyQ5v0/EWxV6 YOdkPphaSKPIFOzm27reLSi81WZXYJeYoWtxkmva4CXS4qKejD iDP+3B39A6UulOLkUsM5bDQ9U4JUfuQBK/pZU41X1prkVNJ2M+ 1DzWO7aqg1Dxd59t+SUj8Mx2xaVoSpx972ApFkMawkEU6FfoqY DCWhfqPDotDRQijfPydY5eySWNwpDEOQjn5ikfFk/UOZKGdqEl DW0MPAu88DlVlDnbx6AgQnfkazvBkJBzGUBA6sgWvY4/HUN/Ax zF+wFN+PZdlS3tV/e7DQ8tq5XjNPaxQiOz3IPej4gj2t55S1w= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2872.1362476722.2939.python-list@python.org> (permalink)
Lines 40
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1362476722 news.xs4all.nl 6881 [2001:888:2000:d::a6]:41908
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:40510

Show key headers only | View raw


On 03/05/2013 04:00 AM, Νίκος Γκρ33κ wrote:
> # =================================================================================================================
> # display download button for each file and downlaod it on click
> # =================================================================================================================
> if form.getvalue('show') == 'files':
>
> 	print ( "<center><a href='http://superhost.gr/files.html'> <img src='/data/images/download.png'></a><br>" )
> 	print ( "<table border=5 cellpadding=5 bgcolor=blue>" )
>
> 	path = "/data/files/"
> 	
> 	for filename in os.walk(path):
> 		print '''
> 		<form method="get" action="%s">
> 			print( "<tr><td><center> <button type='submit'> %s </button> </td></tr>" ) % filename
> 		</form>
> 		'''
> 			
> 	sys.exit(0)
>
> ========================
>
> I use the above code to tidplay a filenames table so the user cna download a displayed button style lookign file but its not printing anything for me just an emptry table
>
> '/data/files' has 5 files in it but its not showing any.
> I dont see what iam doign wrong
>

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?

Have you looked at the result with View->Source in your browser?

-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 01:00 -0800
  Re: Downloading a file form a displayed table Dave Angel <davea@davea.name> - 2013-03-05 04:45 -0500
    Re: Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 01:48 -0800
      Re: Downloading a file form a displayed table Dave Angel <davea@davea.name> - 2013-03-05 05:05 -0500
    Re: Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 01:48 -0800
  Re: Downloading a file form a displayed table Dave Angel <davea@davea.name> - 2013-03-05 04:51 -0500
    Re: Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 02:24 -0800
      Re: Downloading a file form a displayed table Lele Gaifax <lele@metapensiero.it> - 2013-03-05 12:29 +0100
    Re: Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 02:24 -0800
  Re: Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 05:01 -0800
    Re: Downloading a file form a displayed table Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-05 08:38 -0500
    Re: Downloading a file form a displayed table "Vytas D." <vytasd2013@gmail.com> - 2013-03-05 13:38 +0000
      Re: Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 06:37 -0800
      Re: Downloading a file form a displayed table Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-05 06:37 -0800
  Re: Downloading a file form a displayed table Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-05 14:04 +0000

csiph-web