#Mac python install pyperclip install
alias pyjson_decode_stdout='python3 -c "import sys, json, subprocess \ print(json.dumps(eval(subprocess.check_output( \ \"pbpaste\", env= and enter pyjson_decode_stdout would print the parsed json based on this dict Copy and enter pyjson_decode would write this string to pbcopy. On Windows, use the py Python launcher in combination with the -m switch: py -2 -m pip install SomePackage default Python 2 py -2.7 -m pip install SomePackage specifically Python 2.7 py -3 -m pip install SomePackage default Python 3 py -3.4 -m pip install SomePackage specifically Python 3.4. Install on Linux/macOS: pip3 install pyperclip. Note: replace the SomePackage with the package name which you want to install. Install on Windows: pip install pyperclip. Step 2: To install a package, run the following commands in the terminal: python -m pip install SomePackage latest version python -m pip install SomePackage1.0.4 specific version python -m pip install 'SomePackage>1.0.4' minimum version. So, the script below would be very helpful to my works. Pyperclip is a cross-platform Python module for copy and paste clipboard functions. The tutorial says that the 'pyperclip' module should already be installed, but I Googled around to see if I could figure it out. The problem is, when I go to run the code, I get this error: ImportError: No module named 'pyperclip'.
This modules adds the ability to copy and paste text for your Python. Based on Foster's answer, I implemented a simple script(only works for mac) to decode python dict(actually, it is parsed from a JSON string) to JSON string, because sometimes when debugging, I need to find the mistake(s) in the data(and the data body is very big and complex, which is hard for human to read), then I would paste it in python shell and json.dumps(data) and copy to VS code, prettify the JSON. It makes use of the 'sys' module and 'pyperclip' module, so I have. pyperclip - A Python module that provides cross-platform clipboard handling functions.