You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter
|
|
|
|
# Global stuff
|
|
import os
|
|
import csv
|
|
|
|
userText = ["growing","write seven","words onto","a card"]
|
|
currentCard = 0
|
|
cardHeight = 95
|
|
cardWidth = 70
|
|
pageHeight = 249
|
|
pageWidth = 378
|
|
cardX = 0
|
|
cardY = pageHeight
|
|
lineHeight = 10
|
|
locX = 0
|
|
locY = 0
|
|
newLines = [" "]
|
|
|
|
|
|
#--------------------------------------------------------
|
|
# Getting the input from the keyboard one line at a time
|
|
# If you want to do stuff one character at a time maybe use getch
|
|
newTitle = input("Enter a title: ")
|
|
|
|
print("Enter the body line by line. Press x then enter to cancel")
|
|
while newLines[-1] != "x":
|
|
newLines.append(input("Type: "))
|
|
newLines = newLines[:-1]
|
|
|
|
print(newTitle)
|
|
for line in newLines:
|
|
print(line)
|
|
|
|
#--------------------------------------------------------
|
|
# Sneakily saving it maybe to a txt file for alternative documentation
|
|
with open('definitions.csv', 'a', newline='') as file:
|
|
writer = csv.writer(file)
|
|
writer.writerow([newTitle, newLines])
|
|
file.close() |