Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autojump.png为0k #415

Closed
ghost opened this issue Jan 1, 2018 · 10 comments
Closed

autojump.png为0k #415

ghost opened this issue Jan 1, 2018 · 10 comments

Comments

@ghost
Copy link

ghost commented Jan 1, 2018

Load default config
226.15384615384608 0.06074766355140192 0.8392156862745098
140 142 149
如果你的脚本无法工作,上报issue时请copy如下信息:


Screen: 1920*1080
Density: win10
DeviceType: 一加3t
OS: win32
Python: 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]


Traceback (most recent call last):
File "F:\Downloads\wechat_jump_game-master\wechat_jump_auto.py", line 356, in
main()
File "F:\Downloads\wechat_jump_game-master\wechat_jump_auto.py", line 343, in main
im = Image.open('./autojump.png')
File "C:\Users\yunli\AppData\Local\Programs\Python\Python36\lib\site-packages\PIL\Image.py", line 2572, in open
% (filename if filename else fp))
OSError: cannot identify image file './autojump.png'
注:这个png图片的大小是0k

@WaterWan
Copy link

WaterWan commented Jan 1, 2018

我也遇到了一样的问题,我的环境是win加Android虚拟机,目前还不知道怎么解决。

@DevXue
Copy link

DevXue commented Jan 1, 2018

周六的时候 用的旧代码 还是可以的,跳到了500多, 今天我换成了新的代码, 我也是刚刚遇到这个问题了,作者说是让看这个 194 iessus, 但是我看了 ,我按照上面的操作了 也没好,不知道咋回事 我的是 win10 64位系统, Android 小米Note 1920*1089 ! 求解答!

@stevenling
Copy link

#401

@DevXue
Copy link

DevXue commented Jan 1, 2018

@stevenling
这是我修改之后的
def pull_screenshot():
process = subprocess.Popen('adb shell screencap -p', shell=True, stdout=subprocess.PIPE)
screenshot = screenshot.replace(b'\r\r\n', b'\n')
if sys.platform == 'win32':
screenshot = screenshot.replace(b'\r\n', b'\n')
f = open('autojump.png', 'wb')
f.write(screenshot)
f.close()

但是报错了
a

@DevXue
Copy link

DevXue commented Jan 1, 2018

解决了 是我写错了!
def pull_screenshot():
process = subprocess.Popen('adb shell screencap -p', shell=True, stdout=subprocess.PIPE)
screenshot = process.stdout.read()
if sys.platform == 'win32':
screenshot = screenshot.replace(b'\r\r\n', b'\n')
f = open('autojump.png', 'wb')
f.write(screenshot)
f.close()
这样写,我的就没问题了。

@ghost
Copy link
Author

ghost commented Jan 1, 2018

@DevXue可是我的截图是0k,也这样改过,还是这样

@ghost ghost changed the title 运行出错,autojump.png问题 autojump.png为0‘’ Jan 1, 2018
@ghost ghost changed the title autojump.png为0‘’ autojump.png为0k Jan 1, 2018
@DevXue
Copy link

DevXue commented Jan 1, 2018

@lolqwerdfa 你把代码重新覆盖成最新的, 然后把我发的这段复制到你的代码中试试!

@ghost
Copy link
Author

ghost commented Jan 1, 2018

@DevXue 还是不行

@ghost ghost closed this as completed Jan 1, 2018
@ghost ghost reopened this Jan 1, 2018
@F-loat
Copy link
Contributor

F-loat commented Jan 1, 2018

#325

@Van1996
Copy link

Van1996 commented Jan 1, 2018

尝试以下代码:

def pull_screenshot():
    os.system("adb shell screencap -p | sed 's/\\r$//' > autojump.png")

...win下没有sed命令
建议使用git bash或者其他bash运行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants