DDA Line Drawing Algorithms Line Coordinates

def ROUND(a):
  return int(a + 0.5)
def drawDDA(x1,y1,x2,y2):
  x,y = x1,y1
  length = (x2-x1) if (x2-x1) > (y2-y1) else (y2-y1)
  dx = (x2-x1)/float(length)
  dy = (y2-y1)/float(length)
  print ('x = %s, y = %s' % (((ROUND(x),ROUND(y)))))
  for i in range(length):
    x += dx
    y += dy
    print ('x = %s, y = %s' % (((ROUND(x),ROUND(y)))))
drawDDA(2,5,10,20)

PyRobot - Python for Robotics

PyRobot is a Python package for benchmarking and running experiments in robot learning. The goal of this project is to abstract away the low-level controls for individual robots from the high-level motion generation and learning in an easy-to-use way. Using PyRobot will allow you to run robots without having to deal with the robot specific software along with enabling better comparisons.




Python developers reveal their favorite tool kits

  • Python is used mainly for Data Analysis 
  • NumPy is most popular data science framework 
  • Flask is most popular web frameworks 
  • Requests is most popular software libraries 
  • PyCharm is most popular IDEs for Python 

Python program to print memory and processor usage

import os import psutil pid = os.getpid() py = psutil.Process(pid) mu = (py.memory_info()[0] / 2.**30) * 1000 print('Memory Use(MB):', mu, 'of process id:', pid) print('CPU Use:',psutil.cpu_percent())