RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-369439

Qvint01's questions

Martin Hope
Qvint01
Asked: 2020-09-13 17:57:43 +0000 UTC

如何检查循环

  • 0

如何检查 for 循环中的至少一项测试是否有效

for x in range(len(word)):
    if letter == word[i]:
        cells[x] = letter
        pass
    i += 1
else: print('Такой буквы нет!')
python
  • 1 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-08-30 00:24:21 +0000 UTC

如何在python中做setTimeout?

  • 1

我需要提出一个请求/请求。假设我激活了一个函数,如果 30 秒后如果没有被确认,则调用另一个函数,如果它被确认,则调用第三个函数

js 有 setTimeout() 和 clearTimeout() 所以我想在 python 中做类似的事情(异步)

python
  • 2 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-08-28 06:28:43 +0000 UTC

如何将列表恢复为其默认值?

  • 1

有一个这样的列表:

board = [':one:',':two:',':three:',
         ':four:',':five:',':six:',
         ':seven:',':eight:',':nine:']

如何使它在操作时使其恢复到原始值?

python
  • 1 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-08-08 21:46:26 +0000 UTC

如何获得所有可能的坐标?

  • 0

如何获得所有可能的坐标组合的列表?

const vec3 = require('vec3')

var min = vec3(0,0,0)
var max = vec3(3,3,3)

输出应该是:[ [0,0,0], [1,0,0], [2,0,0], [3,0,0], [0,1,0], [0,2 ,0]、[0,3,0] 等...]

我没有找到任何地方如何做到这一点。

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-05-23 21:08:39 +0000 UTC

检查不工作

  • 0

当控制台给出 3 个相同的项目时,检查在代码中不起作用

public class casino {

public static String getIngot(){
    String[] ingots = new String[]{"iron","gold","diamond"};
    int n = (int)Math.floor(Math.random() * ingots.length);

    if(ingots[n] == "iron"){
        return "[I]";
    }
    else if(ingots[n] == "gold"){
        return "[G]";
    }
    else if(ingots[n] == "diamond"){
        return "[D]";
    }
    return null;
}

public static void main(String[] args) {

    String slots = (getIngot()+getIngot()+getIngot());
    System.out.println(slots);  
    if (slots == "[I][I][I]"){
        System.out.println("IRON");
    }
    if (slots == "[G][G][G]"){
        System.out.println("GOLD");
    }
    if (slots == "[D][D][D]"){
        System.out.println("DIAMOND");      
    }

  }
}
java
  • 1 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-02-23 22:55:05 +0000 UTC

如何做这样的事情?

  • -1

如何在 SublimeText3 中制作“分屏”,以便在底部有一个控制台(命令行)?也许一些插件

就像在图片上:

在此处输入图像描述

sublime-text
  • 1 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-02-09 23:18:06 +0000 UTC

如何颜色输入?

  • 1

如何在python中为输入着色?(使用 colorama 或 termcolor)

完美打印油漆

from colorama import Fore, Back, Style, init
init()

print(Fore.RED + 'test')

但是如果你用输入打开它,它就不会被绘制

from colorama import Fore, Back, Style, init
init()

input(Fore.RED + 'test')

提前致谢

python
  • 1 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-02-07 03:09:39 +0000 UTC

如何执行任务?

  • -1

有必要从 0 到 100 取一个随机数,如果它大于前一个(从 0 到 100 相同),则显示为绿色,反之亦然 - 显示为红色。

示例代码:

import random
from colorama import Fore
from time import sleep


while True:

    a = random.randint(0,100)

    sleep(0.5)

    if a > a:
        print(Fore.GREEN + str(a))
    elif a < a:
        print(Fore.RED + str(a))

提前致谢

python
  • 2 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-02-03 02:13:45 +0000 UTC

如何将url传输到变量?

  • -1

我需要将给定列表中的随机 url(字符串)写入变量

这是代码:

import requests
from json import loads
from bs4 import BeautifulSoup

s = requests.session()
s.headers.update({'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0'})

r = s.get('https://www.google.ru/search?q=кот&tbm=isch')

soup = BeautifulSoup(r.text, "html.parser")

for i in range(0,10):
    for text in soup.findAll(attrs={'class': 'rg_meta notranslate'}):
        text = loads(text.text)
        print(text["ou"])

提前致谢。

python
  • 2 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-02-02 03:59:17 +0000 UTC

电报机器人图像上传

  • 0

是否可以从 Internet 发送图像,而不是以前下载的图像?

(PyTelegramBotAPI)

像这样的东西,但带有指向图像的链接。

@bot.message_handler(commands=['test'])
def welcome(message):
    photo = open('test.png', 'rb')
    bot.send_photo(message.chat.id, photo)

提前致谢。

python
  • 1 个回答
  • 10 Views
Martin Hope
Qvint01
Asked: 2020-02-01 22:32:19 +0000 UTC

如何转换为整数?

  • 0

帮助将 response_json[0]['price_usd'] 转换为整数

import requests

TICKER_API_URL = 'https://api.coinmarketcap.com/v1/ticker/bitcoin'


response = requests.get(TICKER_API_URL)
response_json = response.json()

print(response_json[0]['price_usd'])

提前致谢。

python
  • 2 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5