You can usually easily and safely do copy-pasting with IPython, through the commands %cpaste (manually ending code with --) and %paste (execute code immediately). This is very handy for testing code that you copy from web pages, for instance, or from your editor: these commands even strip leading prompts (like In[1] and ...) for you.
IPython also has a %run command that runs a program and leaves you in a Python shell with all the variables that were defined in the program, so that you can play with them.
In order to get help on these functions: %cpaste?, etc.
Copying and pasting code directly into the Python interpreter - Stack Overflow
Copy and Paste Files - Command
terminal - Copy & paste Python code into the command line - Unix & Linux Stack Exchange
Everytime I copy and paste more than one line of code, python stops responding.
[SOLVED]
Yo. Please use the most dumbed down language, because I've literally never done this stuff, Idk how python works. And at this moment, I'm not exactly trying to. Im just trying to copy/paate a command. I am simply trying to copy/paste code from a guide and it keeps saying I have a syntax error. I think I figured out that you dont actually type the $, but I dont even know if that's correct. Either way, I continue to get a syntax error with the arrow pointing to seemingly random letters.
Please help.
Edit: This is the simple command given to download a HTTP library for Python called "Requests":
$ python -m pip install requests
Edit2: Thanks to social_nerdtastic for answering. I just had to use cmd. I had a feeling it was something simple and fundamental that I just didn't know
You can usually easily and safely do copy-pasting with IPython, through the commands %cpaste (manually ending code with --) and %paste (execute code immediately). This is very handy for testing code that you copy from web pages, for instance, or from your editor: these commands even strip leading prompts (like In[1] and ...) for you.
IPython also has a %run command that runs a program and leaves you in a Python shell with all the variables that were defined in the program, so that you can play with them.
In order to get help on these functions: %cpaste?, etc.
You can simply convert all tabs to spaces and remove ALL empty lines. So you will be able to paste any code to python console (e.g.: python2.6)
I'm trying to learn Python by taking some codes for games like Snake. I want to copy and paste the code into Python, change some things up a bit in order to learn how everything works, and then begin making my own sets of code. But everytime I copy and paste more than one line of code into, Python launches Snake, and stops responding and I'm forced to cloe it. Is there anyway around this?
Here is a link to a video showing what happens: https://youtu.be/LsoJG4LHY4A