Skip to content

Instantly share code, notes, and snippets.

askneevel davidneevel

View GitHub Profile
View gist:06d61e6bd76f342de50cfb403f968ef9
import picamera
cam = picamera.PiCamera()
cam.capture('aa.jpg')
View gist:7cf3c842f651da8b5e95375db355b904
subprocess.call("mv a.jpg pics/a.jpg", shell=True)
@davidneevel
davidneevel / gist:e8358aa3523ba960497cee0b760df7a2
Created Feb 19, 2018
python read from and update text file
View gist:e8358aa3523ba960497cee0b760df7a2
countFile = open("counter.txt","r") # opens file to read
count = countFile.read() # reads
intCount = int(count) # converts to int
print intCount
intCount = intCount + 1 # increases
countFile = open("counter.txt","w") # opens file to write
countFile.write(str(intCount)) # writes
countFile.close() # close file
You can’t perform that action at this time.