RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

AleksandrM's questions

Martin Hope
AleksandrM
Asked: 2022-07-22 20:10:39 +0000 UTC

为什么逻辑“或”不起作用[重复]

  • 0
这个问题已经在这里得到了回答:
比较一个变量与多个值通过或不能正常工作 3答案
2 个月前关闭。
def main_data():
    archive_file = input("\nВведите адрес архива ")
    # делаем проверку расширения файла
    if archive_file.endswith('.zip') or archive_file.endswith('.rar') == False:
        print(" Вы указали неверный файл. Файл не имеет расширения 'zip' или 'rar' ")
    
python сравнение
  • 2 个回答
  • 44 Views
Martin Hope
AleksandrM
Asked: 2020-06-17 04:13:12 +0000 UTC

无法运行 sudo pip install

  • 0

我想在 Linux Mint 中安装 osrframework 在安装过程中,它说

alex@alex-Lenovo-ideapad-320-15IAP:~$ sudo -H pip install osrframework
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting osrframework
  Using cached osrframework-0.20.1.tar.gz (209 kB)
    **ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bDobBZ/osrframework/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bDobBZ/osrframework/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_c2o2O
         cwd: /tmp/pip-install-bDobBZ/osrframework/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-bDobBZ/osrframework/setup.py", line 161
        print(f"\t> {cmd}")
                         ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.**
python
  • 2 个回答
  • 10 Views
Martin Hope
AleksandrM
Asked: 2020-05-09 16:09:00 +0000 UTC

告诉我为什么带有显示-隐藏菜单条件的功能不起作用

  • 0

最初,使用 display: none 隐藏菜单(触发该功能时,我通过 js 更改样式)。该函数在加载时触发一次,当我单击菜单汉堡时,列表打开,当我想关闭它并再次单击菜单汉堡时,列表不会关闭。

let burgerMenu = document.querySelector(".burgerMenu"); // Это стилизованный блок с тремя горизонтальными линиями (бургер меню) по которому происходит клик.
let menu = document.querySelector(".menu"); // Это список ul? который должен выпадать и сворачиваться. 
burgerMenu.onclick = () => {
    if (menu.style.display = "none") {
        menu.style.display = "block";
    } else if (menu.style.display = "none") {
        menu.style.display = "none";
    }
}
javascript
  • 1 个回答
  • 10 Views
Martin Hope
AleksandrM
Asked: 2020-03-18 14:14:35 +0000 UTC

如何在 JS 中创建一个事件,以便只调用对象中的一个键?下次按下一个键

  • 1
let list = {
    'cat': 'кот',
    'dog': 'собака',
    'door': 'дверь'
};
let card = document.querySelector(".card");
card.onclick = function () {
    for (let key in list) {
        card.innerHTML = key + " ";
    }
}
card.onclick = function () {
    for (let key in list) {
        card.innerHTML = list[key];
    }
}
javascript
  • 2 个回答
  • 10 Views
Martin Hope
AleksandrM
Asked: 2020-12-20 20:31:27 +0000 UTC

我如何申请特定但[i] 新课程

  • 1

你好。为什么这在这里不起作用。如何将新类应用于特定 div(但 [i])。当按下键盘键时(例如,1,它也有一个符号!),键改变颜色是必要的(为此添加了一个新类)。每个 div 是一个单独的键盘键

<label for="#inp">
<h2>Введите что нибудь:&nbsp; </h2>
</label><input type="text" id="inp"></div>
<div class='digit'>
<div class="div-1 buttoN"> 1 </div>
<div class="div-2 buttoN"> 2 </div>
<div class="div-3 buttoN"> 3 </div>
<div class="div-4 buttoN"> 4 </div>
<div class="div-5 buttoN"> 5 </div>


 let inp = document.querySelector("#inp"); // Получаю значения из input 
 let but = document.querySelectorAll('.buttoN'); // Получаю множество блоков div  
 inp.onkeydown = function (event) {  
    for (var i = 0; i < but.length; i++) {  
        but[i].textContent == event.code;  
        if (event.code == 'Digit1') {  
            **this.but[i].classList.toggle('colY');**  
            inp.onkeyup = function () {  
                if (event.code == 'Digit1') {  
                    this.but[i].classList.toggle('colY');  
                };  
            }  
            if (event.code == 'Digit2') {  
                this.but[i].classList.toggle('colY');  
                inp.onkeyup = function () {  
                    if (event.code == 'Digit1') {  
                        this.but[i].classList.toggle('colY');  
                    };  
                }  
            }  
        }  
    }
javascript
  • 1 个回答
  • 10 Views
Martin Hope
AleksandrM
Asked: 2020-12-15 00:26:38 +0000 UTC

通过迭代类和添加新类来帮助解决问题

  • 2

同一个类的div元素有很多,迭代的时候,我必须在块中找到例如表示字母'h'的div,并为其分配一个新的类。

  <input type="text" id="inp">
  <div class="buttoN"> m</div>
  <div class="buttoN">p</div>
  <div class="buttoN">h</div>
  <div class="buttoN">i</div>
  <div class="buttoN">b</div>

.buthover{
  color: red;
}

let inp = document.querySelector("#inp");
let but = document.querySelectorAll('.buttoN');
inp.onkeydown = function () {

.................
    for (i = 0; i < but.length; i++) {

............................


    }
}

链接https://codepen.io/fortune82/pen/xBMKKz?editors=1111

javascript
  • 1 个回答
  • 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