Skip to content

Instantly share code, notes, and snippets.

View davidneevel's full-sized avatar

askneevel davidneevel

View GitHub Profile
@davidneevel
davidneevel / gist:06d61e6bd76f342de50cfb403f968ef9
Created February 19, 2018 15:35
capture image with picam python
import picamera
cam = picamera.PiCamera()
cam.capture('aa.jpg')
@davidneevel
davidneevel / gist:7cf3c842f651da8b5e95375db355b904
Created February 19, 2018 12:21
python move file using subprocess
subprocess.call("mv a.jpg pics/a.jpg", shell=True)
@davidneevel
davidneevel / gist:e8358aa3523ba960497cee0b760df7a2
Created February 19, 2018 12:07
python read from and update text file
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