Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'responding': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'language.': 0.14; 'balls': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'res': 0.16; 'subject:import': 0.16; 'subject:python': 0.16; 'language': 0.16; 'wrote:': 0.18; "skip:' 30": 0.19; 'header:User- Agent:1': 0.23; 'headers': 0.24; 'skip:{ 20': 0.24; "i've": 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; "i'm": 0.30; 'code': 0.31; 'running': 0.33; "can't": 0.35; 'to:addr:python-list': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'ian': 0.60; "you're": 0.61; 'back': 0.62; 'our': 0.64; 'charset:windows-1252': 0.65; 'frank': 0.68; 'skip:r 30': 0.69; '3.4': 0.84; 'package?': 0.84; 'received:2': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: python 3.4 use python-gcm can't import Date: Fri, 29 Aug 2014 17:51:28 +0100 References: <9c330850-fd0d-4190-a924-5cd99fbaccd6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-194-65.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: <9c330850-fd0d-4190-a924-5cd99fbaccd6@googlegroups.com> 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409331106 news.xs4all.nl 2882 [2001:888:2000:d::a6]:35525 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77280 On 29/08/2014 09:35, Frank Liou wrote: > what? > > So...My 3.4 can't use this package? > > now > > i use http.client > > reg_ids = [] > reg_ids.append(GetCustomerGCMId[0]) > API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' > mydata = {'registration_ids': reg_ids, 'data': data} > jqs = json.dumps(mydata) > headers = {"Content-type": "application/json", "Authorization": "key="+API_KEY} > conn = http.client.HTTPConnection('android.googleapis.com') > conn.request('POST', '/gcm/send', jqs, headers) > res = conn.getresponse() > conn.close() > reason = res.reason > read = res.read().decode() > headers = res.headers > result = {'msg': res.status, 'reason': str(res.reason), 'read': str(res.read())} > > > i got status only 200 ok > > and body is "b'" .....is empty > > i'm so confused.don't know it work or not > Thankfully I've one of my crystal balls back from the menders so I know that you're responding to Ian Kelly. Having said that have you tried running the code through 2to3? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence