I'm just starting with Python and I need to import xclip in Python to make a program run.
The problem appears when I run the program. I get
Traceback (most recent call last): File "/home/jorgekadri/CesarCyhper.py", line 4, in <module> import xclip ImportError: No module named xclip
I've already installed xclip by:
sudo get-apt install xclip
But when I want to import it in Python, it won't run.
This is my code
Caesar Cipher http://inventwithpython.com/hacking
import pyperclip #the string to be encrypted/decypted message = 'this is my secret message.' #the encryption/decryption key key = 13 #tells the program to encrypt or decrypt mode ='encrypt' #every possible symbol that can be encrypted LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' # stores the encrypted/decryted form of the message translated='' #capitalize the string in message message = message.upper() #run the encryption/decyptio code on each symbol in the message string for symbol in message: if symbol in LETTERS: #get the encrypted(or decrypted) number for this symbol num = LETTERS.find(symbol)#get the number of the symbol if mode=='encrypt': num=num+key elif mode == 'decrypt': num=num-key #hanble the wrap-raound if num is larger than the length of #LETTERS or less than 0 if num >= len(LETTERS): num = num-len(LETTERS) elif num < 0: num = num + len(LETTERS) #add encrypted/decrypted numbers symbol at the ned of the translated translated=translated+LETTERS[num] else: #just add the symbol without encrypting/decrypting traslated = translated + symbol #print the encrypted/decrypted string to the screen print(translated) #copy the encrypted/Decrypted string to the clipboard pyperclip.copy(translated)
In the website http://invpy.com/pyperclip.py says that I can get Pyperclip from there.
Also in the website says: " On Linux, this module makes use of the xclip command, which should come with the os. Otherwise run "sudo apt-get install xclip"
I have the xclip working in my Terminal, the problem is that in Python I need to import xclip but when I do it I get the Error what I show in the begging.