[BangPypers] reqiured help for final year project - urgent

Amal raj.amal at gmail.com
Wed Apr 23 09:20:57 CEST 2008


If you tell what the problem is then may be we can help.

One issue I noticed is you are using csoc.recv(1024) . Which is tooo small
for the other file formats. So what u can do is write a loop there to
receive the entire data. Basically when u say csoc.recv(1024) It reads only
1024 bytes from the socket and remaining are not read.  And use "rb" only
for the reading.

And hereafter tell what is the problem in the mail, rather than just saying
its not working. It will help us understand the problem.

regards,
Amal.

On Wed, Apr 23, 2008 at 12:26 PM, Prajakta Chaudhari <pc_3110 at yahoo.co.in>
wrote:

> 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
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
Amal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20080423/00ae67a3/attachment.htm>


More information about the BangPypers mailing list