convert a code from java into python
Question: Now I am trying to change a program from Java into Python, when I finally fix
three problems on my code and I run it. Then shows me this Error.

    
    
    Traceback (most recent call last):
      File "serial.py", line 4, in <module>
        import serial
      File "/home/pi/serial.py", line , in <module>
        port=serial.Serial(
    AttributeError:'module' object has no attribute 'Serial'
    

How can I fix it?

If you need the source code and What were the problems that I had to fix, let
me know. Please help me about it.


Answer: I think import serial is wrong.

Did you try:-

from serial import serial

<http://pyserial.sourceforge.net/shortintro.html>

