Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xmodem error
#1
Hi,
i have a program for transfer a file using 'Xmodem' protocol. My code is :
import select
import sys
from modem import XMODEM
def getc(size, timeout=5):
    r, w, e = select.select([sys.stdin.fileno()], [], [], timeout)
    if r: return sys.stdin.read(size)

def putc(data, timeout):
    r, w, e = select.select([], [sys.stdout.fileno()], [], timeout)
    if w: return sys.stdout.write(data)
xmodem = XMODEM(getc, putc)
stream = file("/home/gokul/Peer2Peer.bin")
xmodem.send(stream)
But when i run these code i got an error like "ImportError: No module named protocol.xmodem"

What is this error? How to solve this ?
Reply
#2
Please, post full traceback in error tags, not just the last line
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
This is the error
from modem import XMODEM
File "build/bdist.linux-x86_64/egg/modem/__init__.py", line 10, in <module>
ImportError: No module named protocol.xmodem
Reply
#4
Try from xmodem import XMODEM
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
Hi, i got the program error free. But now the file is not sending. But no error also . When i stop the code it shows like
r, w, e = select.select([sys.stdin.fileno()], [], [], timeout)
KeyboardInterrupt



is it a problem of timeout?
Reply
#6
what python version do you use?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#7
i'm using Python 2.7.6
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Progress Indicator for Xmodem 0.4.6 KenHorse 1 1,968 Jan-30-2021, 07:12 PM
Last Post: bowlofred
  How to stop Xmodem after bin file transfer was finished shaya2103 0 2,501 Nov-27-2019, 04:33 PM
Last Post: shaya2103
  problems sending BIN file with XMODEM python shaya2103 0 2,822 Nov-23-2019, 10:27 AM
Last Post: shaya2103

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020