Q:

how to read data from clipboard and pass it as value to a variable in python?

how to read data from clipboard and pass it as value to a variable in python?
For example:
I will copy some data {eg: 200} by pressing ctrl+c or through rightclick. and pass it to a variable.
c = 200
..can any1 tel me how to do this?

A:

To read from clipboard in your script with tkinter is this easy:
try:
    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk

root = tk.Tk()
# keep the window from showing
root.withdraw()

# read the clipboard
c = root.clipboard_get()

A:

Just put this script in your path somewhere, say in your project folder, then;
import pyperclip # The name you have the file
x = pyperclip.paste()

