General Programming Flashcards
stop a program from running in ide or command line.
command-C
open a file so it’s writeable in python
open(filename, ‘w’)
search for a specific spot in a file and cut everything off
target.truncate()
write over a file in python
target.write(newline)
copy and put contents of file in pasteboard
cat filename | pbcopy
print out file in command line
cat
pipe in command line
|
python: open a file name in read (default)
open(filename, ‘r’)
python: open file in write (overwrites everything)
open(filename, ‘w’)
python: open filename in append (adds to end)
open(filename, ‘a’)
copy contents of a file into command line
cat filename
pipe
|
copy contents of command line into pasteboard
cat filename | pbcopy
search for a specific spot in a file and cut everything off
target.truncate()