python idle 启动错误_python – IDLE子进程启动错误

我在下面的代码中有一个名为code.py的文件.我正在使用IDLE来编辑文件.当我单击运行>运行模块时,我收到错误:

“IDLE’s subprocess didn’t make connection. Either IDLE can’t start a

subprocess of personal firewall software is blocking the connection.”

我使用的是Windows 7 Ultimate 64bit,但我安装了32位版本的Python 2.7.

我在这个网站以及其他网站上寻找了一个解决方案,但他们似乎都建议删除一些名为tkinter.py的东西(我不知道这是什么)或关闭我的防火墙(除了Microsoft Security之外我没有启用Essentials不是防火墙.)

#Globals

#-------------------

x_pad = 476

y_pad = 444

import ImageGrab

import os

import time

import win32api, win32con

def screenGrab():

box = (x_pad+1,y_pad+1,x_pad+641,y_pad+480)

im = ImageGrab.grab(box)

im.save(os.getcwd() + '\\full_snap__' + str(int(time.time())) +

'.png', 'PNG')

def main():

pass

if __name__ == '__main__':

main()

def leftClick():

win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)

time.sleep(.1)

win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)

print 'Click.' #completely optional. But nice for debugging purposes.

def leftDown():

win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)

time.sleep(.1)

print 'left Down'

def leftUp():

win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)

time.sleep(.1)

print 'left release'

def mousePos(cord):

win32api.SetCursorPos((x_pad + cord[0], y_pad + cord[1])

def get_cords():

x,y = win32api.GetCursorPos()

x = x - x_pad

y = y - y_pad

print x,y

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值