Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'url:sourceforge': 0.03; 'reason,': 0.07; 'subject:file': 0.07; 'utf-8': 0.07; 'mixed': 0.09; 'subject:into': 0.09; 'true)': 0.09; '\xe2\x80\x94': 0.09; 'cc:addr:python-list': 0.11; 'addr,': 0.16; 'open()': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'library': 0.18; 'file,': 0.19; 'input': 0.22; 'import': 0.22; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'file': 0.32; 'regular': 0.32; 'open': 0.33; 'url:python': 0.33; 'mac': 0.33; 'skip:b 30': 0.33; 'sense': 0.34; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'disk': 0.36; 'url:listinfo': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'two': 0.37; 'pm,': 0.38; 'does': 0.39; 'url:mail': 0.40; 'how': 0.40; 'from:charset:utf-8': 0.61; 'address': 0.63; 'skip:6 10': 0.63; 'skip:n 10': 0.64; 'different': 0.65; 'skip:\xe2 10': 0.65; 'to:addr:gmail.com': 0.65; 'phone': 0.66; 'hints': 0.68; '8bit%:43': 0.74; 'bluetooth': 0.91; 'subject:phone': 0.91 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:to :cc:content-type:content-transfer-encoding; bh=LdDy12v2mNVZAP9hpjrHkErLD0jrgvhJUDyE7kXCYpE=; b=KaGbx1HpqoxWdXHBBSXPKjXBtggw8LOL89Pt+njgaJh51fj7jB0JTTGJy3LbaADMFR +Pl5kfg2HcszDylrpRl+BA9MVtIjPUv0qxkeMpd0GhlY6bPeiYJ2Yu2Rzz2JFizATV8D x88imNLQDQVpxxb0SialLWO+xDy6iYlYgFS+D6emqmDlGy7+vWf39wz9rHkmcW+QleOY TZf2ebtL1Qf5APg8jeZzIuZ6jFQW2Ghdq1C15EaZBlBBr983fiVg9WRFf0VfxVyoaweM +gvUQcVMjkDjSWmDsueGb2FxpswYyAphWU7xLg+kISjcjlEwES1oWtYUm0HbK7D2gIrS kvTw== MIME-Version: 1.0 X-Received: by 10.50.253.195 with SMTP id ac3mr12152566igd.18.1407581348898; Sat, 09 Aug 2014 03:49:08 -0700 (PDT) In-Reply-To: <53E660BF.7080401@gmail.com> References: <53E660BF.7080401@gmail.com> Date: Sat, 9 Aug 2014 12:49:08 +0200 Subject: Re: how to write file into my android phone? From: =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= To: luofeiyu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407581357 news.xs4all.nl 2888 [2001:888:2000:d::a6]:36577 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75937 On Sat, Aug 9, 2014 at 7:56 PM, luofeiyu wrote: > When i input usb line with my android phone into the pc , there are two > disks j: and k: (type :removable disk) displayed in win7. > > i can get my android phone bluetooth mac address . > > import bluetooth > nearby_devices =3D bluetooth.discover_devices(lookup_names =3D True) > for addr, phoneName in nearby_devices: > print(addr) > > > it is 6C:8B:2F:CE:5B:59 > > Now how can i write a file into the disk j: of my android phone(bluetoo= th > mac is 6C:8B:2F:CE:5B:59 )? > > -- > https://mail.python.org/mailman/listinfo/python-list You mixed up two very different interfaces. Bluetooth and USB are completely separate. If you want to write a file to the USB drive, you can just open a file, using the regular open() function (specify a path somewhere benath J:\): https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-fil= es However, if you want to do it via Bluetooth for some reason, you need to find a library that does OBEX =E2=80=94 Google hints at http://lightblue.sourceforge.net/ . --=20 Chris =E2=80=9CKwpolska=E2=80=9D Warrick PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense