SosiPad offers two methods for sharing code. First, you can embed a SosiPad containing source code into your webpage. Second, you can share a SosiPad execution URL that includes the source code. Both methods utilize GitHub's Gist.
1. URL Sharing Method
Sharing Regular Source Code
SosiPad automatically finds and displays the main.py file from your Gist.
- Create a Gist containing the main.py file and note the Gist ID.
- Add the Gist ID to the SosiPad URL. Sharing link format: "https://app.sosipad.com/python?gid={Gist ID}"
- Adding a YouTube video: Add yid={YouTube ID} to the URL parameters. The YouTube ID is the value of the v parameter in the YouTube URL.
Sharing Source Code for Typing Practice
You can share source code that users can directly type out for practice.
- Create a Gist containing the main.py file and note the Gist ID.
- Add the Gist ID to the SosiPad URL. Sharing link format: "https://app.sosipad.com/python?gid={Gist ID}&mode=typing"
Sharing Fill-in-the-Blanks Files
You can share code in a quiz format where users fill in blanks in the source code.
- Create a main.py file with blanks in a Gist and note the Gist ID. Define blanks using the format {{c{number}:{answer}}}.
- Below is an example defining two blanks, "numbers" and "2":
# Define a list of numbers
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# Iterate through the list
for number in {{c1::numbers}}:
# Check if the number is even or odd
if number % {{c2::2}} == 0:
print(f"{number} is even")
else:
print(f"{number} is odd")
- Add the Gist ID to the SosiPad URL. Sharing link format: "https://app.sosipad.com/python?gid={Gist ID}&mode=fill_blanks"
Sharing Source Code for Practice Problems