Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'json': 0.07; 'suppose': 0.07; 'cookie': 0.09; 'etc).': 0.09; 'subject:How': 0.10; 'python': 0.11; '"python"': 0.16; '23,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'multiplayer': 0.16; 'subject:values': 0.16; 'url:json': 0.16; 'values?': 0.16; 'wrote:': 0.18; 'module': 0.19; 'python?': 0.22; 'sends': 0.24; 'connected': 0.24; 'looks': 0.24; 'handling': 0.26; 'header:In-Reply-To:1': 0.27; 'wondering': 0.29; 'am,': 0.29; 'google,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'trace': 0.31; 'there.': 0.32; 'url:python': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'possible': 0.36; 'url:org': 0.36; 'should': 0.36; 'url:library': 0.38; 'handle': 0.38; 'needed': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'url:3': 0.61; 'save': 0.62; "you'll": 0.62; 'url:http': 0.64; 'details': 0.65; 'subject:get': 0.81; 'game,': 0.84; 'want:': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=zdxJ+WFImDuFH3yybaiLTSBxTztJ6oeqg2aWtrI2xwA=; b=s2MYBb4tnTshZR2k2pQScoQIqMA1szDyDwnFzsMBD2D0XVymzccdRJJVZYjvnVf/HN fxtIgd/U/IkqeVHhEwagzg/tt4FaeZNpprbUk9b1P8+S46jl/0vFajRDF+PXa6gF3eI0 k4ID7PWZMSwOJMVe6E3GO/Be01VWi6G6yyVS3slMyWna6EP/CTrJj2gnoYP2NDsE1rc9 MDt2x3ATwTzcJHvyaxi8d1JEgeirCAKfrnqhaSFujYXS539Vhm4jgwQ9HXaOfZ1EPeoF Ogr7pBl/sKU0/uH2ek9mvhZNkn4DIHezzcK9QAIvthL4qEaoUUz1tvMrNyw9np/HjY60 cMbg== MIME-Version: 1.0 X-Received: by 10.52.231.231 with SMTP id tj7mr17353327vdc.111.1366663654948; Mon, 22 Apr 2013 13:47:34 -0700 (PDT) In-Reply-To: References: Date: Tue, 23 Apr 2013 06:47:34 +1000 Subject: Re: How to get JSON values and how to trace sessions?? 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.15 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: 1366663657 news.xs4all.nl 2175 [2001:888:2000:d::a6]:34899 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44111 On Tue, Apr 23, 2013 at 6:09 AM, wrote: > But now i am wondering how to trace sessions? it is needed for a multipla= yer game, connected to a webserver. How do i trace a PHP-session? I suppose= i have to save a cookie with the sessionID from the webserver? Is this pos= sible with Python? Are their other ways to keep control over which players = sends the gamedata? > > Secondly, can i handle JSON values? I know how to create them serverside,= but how do i handle that response in python? Python has a JSON module that should do what you want: http://docs.python.org/3.3/library/json.html I don't know the details of cookie handling in Python, but this looks to be what you want: http://docs.python.org/3.3/library/http.cookiejar.html#http.cookiejar.Cooki= eJar Tip: The Python docs can be searched very efficiently with a web search (eg Google, Bing, DuckDuckGo, etc). Just type "python" and whatever it is you want - chances are you'll get straight there. ChrisA