Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.mixmin.net!feed.xsnews.nl!border-3.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'oct': 0.02; 'passes': 0.05; 'stuff.': 0.05; 'subject:Python': 0.06; '(especially': 0.07; 'python': 0.08; 'dancing': 0.09; '--bill': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'it.\xa0': 0.16; 'landing': 0.16; 'subject:function': 0.16; 'wow,': 0.16; 'written': 0.16; 'wrote:': 0.16; 'received:209.85.210.174': 0.18; 'received:mail- iy0-f174.google.com': 0.18; 'seems': 0.20; 'subject:data': 0.21; 'header:In-Reply-To:1': 0.22; 'literal': 0.23; 'pm,': 0.24; 'code': 0.25; 'code.': 0.26; 'thu,': 0.28; 'bit': 0.28; '27,': 0.29; 'message-id:@mail.gmail.com': 0.29; 'script': 0.29; 'thanks': 0.30; 'to:addr:python-list': 0.33; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'might': 0.40; "it's": 0.40; 'your': 0.61; 'day,': 0.65; 'unlimited': 0.68; 'client-side': 0.84; 'worrying': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=RPyA+WqO0uvHf+6XHmnJb8x+/T0RIamBc8PRF00QVHI=; b=wEd3Civg2/iT+DHcgEekhilstnr8Gvrwsiat/MWP44+yBPGTVHH9Iay92jBhPqSa95 91GoCaP14WOcJE+p0qJ0aigFvhYblyyIgKzV/cnQKBGaTZGdyXqgObwyAJTt7N372GeS Tqjniy9fhEZ9ze2sDZlUtO3YpJwXicqKZ6bCw= MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 27 Oct 2011 14:55:28 +1100 Subject: Re: passing Python data to a javascript function From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1319687731 news.xs4all.nl 6885 [2001:888:2000:d::a6]:56225 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15021 On Thu, Oct 27, 2011 at 2:51 PM, Bill Allen wrote: > Chris, > > Wow, that seems so simple now that I see it.=A0 I was dancing around that= all > day, but just not landing on it.=A0=A0 Thanks so very much for the assist= . > > --Bill > > Final code that works perfectly, passes the value from the Python script = to > the javascript correctly: > > Congratulations! You've just written code that writes code. It takes a bit to get your head around it (especially when you start worrying about literal strings that might contain quotes, for instance), but it's really cool and seriously powerful stuff. Your server-side Python code can generate client-side Javascript code any way it likes... unlimited possibilities. ChrisA