programming arduino with python

I want to make a robot with Ultrasonic sensor HC-SR04. I can see the data of the sensor with using pyserial library of python . But ı can not define ports high and low with python. Does anybody have any idea about this topic ?

Thanks.

I see you have been busy cross-posting. Please stop.

I want to make a robot with Ultrasonic sensor HC-SR04. I can see the data of the sensor with using pyserial library of python . But I can not write codes for the motors. What can I do ? I am waiting advantages.

Thanks.

@YunusEmreYlcn, your post is confusing. An Arduino is programmed with C/C++ and not with Python. Python works on a PC.

You can certainly send data between a Python program on a PC and an Arduino. Have a look at this Python - Arduino demo

You cannot get a program on a PC to control the Arduino I/O pins directly. You need a program on the Arduino to receive data from the PC and switch the I/O pins depending on what that data contains.

...R

@YunusEmreYlcn, STOP CROSS-POSTING. LAST WARNING.

@Coding Badly, ok I understood.

Have a look at NewPing library details in Arduino playground.

As @Robin said, you cant program Arduino with Python.