You can use Tkinter's colorchooser
to prompt the user to enter a color, then set it to the fill color of a line. Here's an example:
from tkinter import *
def chooseColor(event):
global color #set color to global so it updates in other function
color = colorchooser.askcolor()
def paint(event):
#create a line while in this event. use color[1] to get the second element in the color tuple
canvas.create_line(event.x,event.y,event.x+1,event.y+1, fill=color[1])
tk = Tk()
canvas = Canvas(tk, width=500, height=500)
canvas.pack()
color = tkColorChooser.askcolor() #get initial color, as a tuple
canvas.bind_all("<Button-3>", chooseColor)
canvas.bind_all("<B1-Motion>", paint)
tk.mainloop()