Sir,
We were suggested your name by a friend of ours in Thadomal Sahani Engineering
College. We are students of K. J. Somaiya College of Engineering. We are doing
our final year project in Python and need some help.
Our project is : we wanted to transfer all types of files(.txt, .jpg, .mp3,
.mpeg and so on) automatically from the phone to our computer using Bluetooth.
Whenever our phone comes in the range of the computer Bluetooth dongle, it must
update any file, which has been recently updated on the phone, onto the
computer. Until now, we have just been able to transfer .txt files over
Bluetooth. We are facing problems in transferring other files.
Our codes are:
Phone code:
import sys, socket
host = “11:11:11:11:11:11”
port = 10
file = “E:\\Data\\2.txt”
s = socket.socket(socket.AF_BT, socket.SOCK_STREAM)
s.connect((host, port))
f = open(file, “r”)
data = f.read()
f.close()
s.send(data)
s.close()
Here, for transferring other types of files, we tried using opening the files
with read binary; “rb”, format. But that approach has not worked.
Computer code:
from Bluetooth import *
port =10
backlog = 1
file = “C:\Documents and Settings\sanjay\Desktop\Transfer\File.txt”
host = “11:11:11:11:11:11”
soc = BluetoothSocket(RFCOMM)
soc.bind((host, port))
soc.listen(backlog)
csoc, cinfo = soc.accept()
csoc.recv(1024)
csoc.close()
soc.close()
Kindly help us out with this problem of ours. Looking forward to your reply.
Thanking you,
Yours sincerely,
Prajakta Chaudhari
Priya Mathur
(K. J. Somaiya College Of Engineering – Electronics and Telecommunication
Engineering)
Meet people who discuss and share your passions. Go to
http://in.promos.yahoo.com/groups/bestofyahoo/
_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers