Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75937 > unrolled thread

Re: how to write file into my android phone?

Started byChris “Kwpolska” Warrick <kwpolska@gmail.com>
First post2014-08-09 12:49 +0200
Last post2014-08-09 12:49 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: how to write file into my android phone? Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-08-09 12:49 +0200

#75937 — Re: how to write file into my android phone?

FromChris “Kwpolska” Warrick <kwpolska@gmail.com>
Date2014-08-09 12:49 +0200
SubjectRe: how to write file into my android phone?
Message-ID<mailman.12788.1407581356.18130.python-list@python.org>
On Sat, Aug 9, 2014 at 7:56 PM, luofeiyu <elearn2014@gmail.com> 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 = bluetooth.discover_devices(lookup_names = 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(bluetooth
> 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-files

However, if you want to do it via Bluetooth for some reason, you need
to find a library that does OBEX — Google hints at
http://lightblue.sourceforge.net/ .

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web