If you mean you want to be able to type some Python code in a form and have it executed and the results displayed in a display box, the code is fairly simple in principle, but it would be very dangerous. You never want to allow users to upload scripts that will be directly executed on your server or they could easily hack your site unless you take some serious precautions - starting with pre-screening the code for potentially dangerous commands. The demonstrations you're seeing on sites like w3schools are almost certainly limited to HTML, CSS, and JavaScript which are reasonably safe to handle this way because they are processed in the users' browser and not by your server. I suggest that you wait until you have a good deal more experience before trying this on a real website.
Rick Trethewey
Rainbo Design
Bookmarks