Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'syntax': 0.04; 'subject:Python': 0.06; 'attribute': 0.07; "'no": 0.09; 'subject:using': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'changes': 0.15; '23,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'merged': 0.16; 'subscribing': 0.16; 'whitespace.': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'trying': 0.19; 'else,': 0.19; 'import': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'dec': 0.30; 'kevin': 0.30; 'mode': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'lines': 0.31; 'posting': 0.31; 'peterson': 0.31; 'url:python': 0.33; 'running': 0.33; 'skip:# 10': 0.33; 'skip:d 20': 0.34; 'something': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'url:listinfo': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'list': 0.37; 'pm,': 0.38; 'mailing': 0.39; 'url:mail': 0.40; 'such': 0.63; 'messed': 0.84; 'widespread': 0.91; 'to:none': 0.92; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=N3x0QkRTjRKnKhaRlTQWC+VpV42cKW3mGNPBgqI9f7c=; b=LhkNxq434SjJ4fEW8+t4y3qSdB86lXC2tLcXdrB09HqLVvJiHKZd5O2jKW+uJ6krBq +uziMFQXDOlBeThQPG9U3rjI/uVmJxNVn+fzunVnQ4EXt4VMhEhe/pPuvIkrfXlOXf3p Aq5T2+BQEM4XGXBQ7mrF32SEjFskgpRFUjM3AhPkK0psZk5H5z5/FfWpTW1k3+FE8Mxm CG69y8Lkuq34oKB0DpAtlc7HQRWxuVR5mSLh1uC1bGute6mx1Vqd3465czvJgrWnYkDC YOcsJyQ0cQwNXPe5Q8/2/QHYIHRbCh0Fe8EoRq6sbwM4ASUEZNIxLD92f8076IsvHbnF g2WA== MIME-Version: 1.0 X-Received: by 10.68.12.138 with SMTP id y10mr23319177pbb.101.1387769585996; Sun, 22 Dec 2013 19:33:05 -0800 (PST) In-Reply-To: References: Date: Mon, 23 Dec 2013 14:33:05 +1100 Subject: Re: Airplane mode control using Python? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387769595 news.xs4all.nl 2846 [2001:888:2000:d::a6]:42357 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62585 On Mon, Dec 23, 2013 at 2:20 PM, Kevin Peterson wrote: > I am trying to control Aeroplane mode on Android using Python code. I am running QPyPlus python. When I execute this code(that is widespread in the net), > > #!/usr/bin/python > import android droid = android.Android() > # go to airplane mode > droid.toggleAirplaneMode() > > droid.makeToast('exiting') > > I get the error 'no such attribute Android()'. Python code is sensitive to changes in whitespace. The above is actually a syntax error, because lines have been merged and indented incorrectly. You seem to be posting from Google Groups, which may be why it's messed up; I recommend switching to something else, like Mozilla Thunderbird, or subscribing instead to the mailing list (with all the same content): https://mail.python.org/mailman/listinfo/python-list ChrisA