小编Omi*_* Ki的帖子

系统错误:程序无法启动,因为您的计算机缺少 MSVCP140D.DLL。尝试重新安装程序以解决此问题

所以我在 Visual Studio 2015 中使用 SFML 编写了一个简单的图形蛇游戏,它在我的主计算机上完美运行。我想我应该在我的笔记本电脑上尝试一下。运行程序时,它给了我这个错误: 系统错误:程序无法启动,因为您的计算机缺少 MSVCP140D.DLL。尝试重新安装程序来解决这个问题 所以我在我的电脑中搜索它并找到它所以我将它复制到我的笔记本电脑上,然后我再次收到另一个错误: 应用程序错误:应用程序无法正确启动(0xc000007b)。单击确定关闭应用程序。 我尝试重新安装 Microsoft Visual C++ Redistributable,但仍然无法正常工作。(顺便说一句,这不是代码问题,我已经正确安装了 SFML 并使用了它的库和 bin 没有任何问题)。你的帮助对我来说意义重大。谢谢!这是我的代码:

// 
GraphicalLoopSnakeGame.cpp : 
Defines the entry point for 
the console application.
//
#include "stdafx.h"
#include <SFML/Graphics.hpp>
#include <time.h>
using namespace sf;

int N = 30, M = 20;
int size = 16;
int w = size*N;
int h = size*M;

int dir, num = 4;

struct Snake
{
    int x, y;
}       s[100];

struct Fruit
{
    int x, y;
} …
Run Code Online (Sandbox Code Playgroud)

c++ dll visual-studio system-error

5
推荐指数
1
解决办法
2763
查看次数

为什么请求会停止?

我正在使用tkinter 和 requests制作这个应用程序,它应该像一个下载管理器。我正在使用 requests,最近我发现函数中的stream关键字参数requests.get(url)能够在下载时写下内容。我的问题是,当用户下载多个文件或只是大文件时,请求似乎停止了。奇怪的是,它不会像预期行为那样引发错误。为什么会出现这种情况?我该如何解决这个问题?没有 GUI 的简单版本下载(我发现这个特定的 url 有一点问题):

import requests
import time

url = "https://aspb2.cdn.asset.aparat.com/aparat-video/a5e07b7f62ffaad0c104763c23d7393215613675-1080p.mp4?wmsAuthSign=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6Ijg0ZTVmNjhhMGJkNDJlMmM0MWFjZjgyNzY5YWU4NmMzIiwiZXhwIjoxNjA1NzM3NjIxLCJpc3MiOiJTYWJhIElkZWEgR1NJRyJ9.eaqnWYevFhe-CHG1TGR3SuoTbnVNBEJmLj-ZSxjtNbY"
headers = requests.head(url, headers={'accept-encoding': ''}).headers
print(headers)
r = requests.get(url, allow_redirects=True, stream=True)
# headers = r.headers
name = url.split('/')[-1].split('.')[0]
print(name)
format_name = '.' + headers['Content-Type'].split('/')[1]
file_size = int(headers['Content-Length'])
downloaded = 0
print(name + format_name)
start = last_print = time.time()
with open(name + format_name, 'wb') as fp:
    for chunk in r.iter_content(chunk_size=4096):
        downloaded += fp.write(chunk)
        now = time.time()
        if now - last_print …
Run Code Online (Sandbox Code Playgroud)

python download download-manager python-requests

4
推荐指数
1
解决办法
2605
查看次数