Hi Jorena, this is just an example .rst file
If you look on the right of this text box you will see a pushbutton 'RAW'
Press that to see the actual code used to create this file.
A really nice example is https://gist.github.com/dupuy/1855764
| import os | |
| # User entry of folder name. Make it. | |
| folder = input("Folder name:") | |
| try: | |
| os.makedirs(folder) | |
| except: | |
| pass | |
| # User entry of file base. Build full path. |
| import time | |
| while True: | |
| print("How long or 'exit' when finished") | |
| try: | |
| uin = input(">> ") | |
| except Exception: | |
| break | |
| if uin == 'exit': | |
| break |
| """ Program to accept list of numbers and return smallest and largest """ | |
| def main(): | |
| print("Enter numbers. Type 'done' for the number to compute min and max") | |
| smallest = largest = None | |
| while True: | |
| user_entry = input('enter a number ') | |
| if user_entry == 'done': | |
| break | |
| try: |
| #!/bin/bash | |
| # | |
| # DESCRIPTION: | |
| # | |
| # Set the bash prompt according to: | |
| # * the active virtualenv | |
| # * the branch of the current git/mercurial repository | |
| # * the return value of the previous command | |
| # * the fact you just came from Windows and are used to having newlines in | |
| # your prompts. |
| # Goal is to capture output from print() to a nice box with scrollbars | |
| # These print statements are proxies for what really does the printing, so I can't change them. | |
| import ipywidgets as widgets | |
| from ipywidgets import HBox, IntSlider, Text, Label, Output | |
| # Attempt #1 | |
| a = Output() | |
| with a: | |
| for i in range (50): | |
| print(f"Hello {i}") |
| """ | |
| Turtle graphics demo. | |
| Reference: https://www.geeksforgeeks.org/turtle-programming-python/ | |
| """ | |
| import turtle | |
| wn = turtle.Screen() | |
| wn.bgcolor("light green") |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | |
| 324 | 123 | 345 | 564 | 567 | 345 | 554 |
| // -----JS CODE----- | |
| function showProps(obj, pre) { | |
| pre = pre || '' | |
| var result = ''; | |
| result += pre + "Properties\n"; | |
| for (var i in obj) { | |
| if (obj.hasOwnProperty(i)) { | |
| result += pre + ' .' + i + ' = ' + obj[i] + '\n'; | |
| } | |
| } |
Hi Jorena, this is just an example .rst file
If you look on the right of this text box you will see a pushbutton 'RAW'
Press that to see the actual code used to create this file.
A really nice example is https://gist.github.com/dupuy/1855764