小编dip*_*pl0的帖子

无法安装hashlib,python 3,debian

该软件无法安装.任何帮助解决这个问题将不胜感激.

我相信错误可能是依赖错误.

             Running setup.py (path:/tmp/pip-build-9rlb94_r/hashlib/setup.py) egg_info for package hashlib
            Traceback (most recent call last):
              File "<string>", line 3, in <module>
              File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 10, in <module>
                from setuptools.extern.six.moves import filter, map
              File "/usr/local/lib/python3.4/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
                from pkg_resources.extern import VendorImporter
              File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 36, in <module>
                import email.parser
              File "/usr/lib/python3.4/email/parser.py", line 12, in <module>
                from email.feedparser import FeedParser, BytesFeedParser
              File "/usr/lib/python3.4/email/feedparser.py", line 27, in <module>
                from email import message
              File "/usr/lib/python3.4/email/message.py", line 16, in <module>
                from email import utils …
Run Code Online (Sandbox Code Playgroud)

python hashlib python-3.x

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

Sublime Text 3手动插入制表符

使用Sublime Text 3时,我的大多数文件都设置为使用空格缩进.但是我有时希望插入一个文字标签.当我使用vim时,我会使用<Ctrl> + v <Tab>,但这不适用于Sublime Text 3.

我一直在搜索和搜索,找不到任何东西.请帮忙!

tabs sublimetext sublimetext2 sublimetext3 sublime-text-plugin

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

mysql.connector.errors.ProgrammingError:字符串格式化过程中的参数数量错误

我正在打开一个文本文件并尝试将其写入SQL数据库.

import mysql.connector
import sys
import mysql

f = open('norepeats.txt', 'r')

def sniffertodatabase(f):
for line in f:
    linestrip = line.strip()
    IP = linestrip
    cnx = mysql.connector.connect(user='', password='', host='localhost', database='snifferdb')
    cur = cnx.cursor()
    #print IP
    insert_stmt = (
    "INSERT INTO SNIFFERDBIPs (IP)"
    "VALUES (%s)"
    )
    data = ('IP')
    cur.execute(insert_stmt, data)

    #cur.execute("INSERT INTO SNIFFERDBIPs (IP)" "VALUES (%s), (IP)")
    #cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)", (42, 'bar'))
    cnx.commit()
    cnx.close()
sniffertodatabase(f)
Run Code Online (Sandbox Code Playgroud)

而我得到的错误是:

Traceback (most recent call last):
File "snifferdatabase.py", line 26, in …
Run Code Online (Sandbox Code Playgroud)

python mysql mysql-connector

2
推荐指数
1
解决办法
3344
查看次数

Django 模型 - 'Pcaps.uuid' 必须设置 unique=True 因为它被外键引用

本质上,我试图创建一些填充了 pcaps 属性的表。我收到一个很奇怪的错误。这是模型类中的代码:

class Pcaps(models.Model):
     uuid = models.CharField(max_length=50)
     filename = models.CharField(max_length=200, default='')
     datetime = models.DateTimeField(default=datetime.now, blank=True)
     filehash = models.ForeignKey(Malwares, to_field="filehash", 
 db_column="filehash")

class PcapsIps(models.Model):
    domainname = models.CharField(max_length=100)
    ip = models.CharField(max_length=100)
    uuid = models.ForeignKey(Pcaps, to_field="uuid", db_column="uuid")

class PcapsPorts(models.Model):
   number = models.CharField(max_length=100)
   uuid = models.ForeignKey(Pcaps, to_field="uuid", db_column="uuid")
Run Code Online (Sandbox Code Playgroud)

有问题的错误如下:

错误:

analyser.PcapsIps.uuid: (fields.E311) 'Pcaps.uuid' must set unique=True 
because it is referenced by a foreign key.
analyser.PcapsPorts.uuid: (fields.E311) 'Pcaps.uuid' must set unique=True because it is referenced by a foreign key.
Run Code Online (Sandbox Code Playgroud)

sql django django-models python-3.x

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

Django - Bootstrap 下拉列表不起作用

我正在处理我的 Django Web 应用程序,但我似乎无法让下拉列表在单击时实际下拉。

        <div class="panel panel-default">
      <div class="panel-body">
         <div class="dropdown">
      <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Actions
      <span class="caret"></span></button>
      <ul class="dropdown-menu">
        <li><a href="{% url 'start' uuid=uuid %}">Start</a></li>
        <li><a href="{% url 'clone' uuid=uuid %}">Clone</a></li>
        <li><a href="{% url 'stop' uuid=uuid %}">Stop</a></li>
        <li><a href="{% url 'paranoidfish' uuid=uuid %}">Run Anti-Anti-Forensics Checker</a></li>

      </ul>
    </div>
Run Code Online (Sandbox Code Playgroud)

并通过请求我的 urls.py,虽然我不完全确定它是如何相关的

  urlpatterns = [
        #multiurl(
        url(r'^$', views.index, name='index'),
        #url(r'^$', views.transfer, name='transfer'),
        url(r'^malware/$', views.malware, name='malware'), # Add this /malware/ route
        url(r'^pokedex/$', views.pokedex, name='pokedex'),  # Add this /malware/ route

        url(r'^about/$', views.about, name='about'), …
Run Code Online (Sandbox Code Playgroud)

html python django python-3.x twitter-bootstrap

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

找不到 Excel 类型或命名空间名称

所以我是一个新的 C Sharp 用户。然而,在第 4、18、19 和 20 行,我收到以下错误:

找不到 Excel 类型或命名空间名称

我已经导入了对excel COM库的引用,但没有效果。

using System;
using System.IO;
using System.Diagnostics;
using Excel;
namespace CallPython
{

class Program
{

    private static bool ExcelCommentsChecker()
    {
        Excel.Application excelApp = new Excel.Application();
        Excel.Workbook workBook = excelApp.Workbooks.Open(@"C:\Tools\comments.xlsx");
        foreach (var worksheet in workBook.Worksheets()
            if (worksheet.Comments != null)
            {
                Console.WriteLine("comments");
            }
            else
            {
                Console.WriteLine("The variable is set to false.");
            }
        //foreach (var row in worksheet.Rows)
        //   foreach (var cell in row.Cells)
        // https://learn.microsoft.com/en-us/visualstudio/vsto/how-to-programmatically-add-and-delete-worksheet-comments
        // https://www.c-sharpcorner.com/blogs/how-to-add-move-hide-remove-comments-to-an-excel-worksheet-cell-using-epplus-net-application-c-sharp-part-eight
        //https://www.codeproject.com/Tips/801032/Csharp-How-To-Read-xlsx-Excel-File-With-Lines-of
        // if …
Run Code Online (Sandbox Code Playgroud)

c#

0
推荐指数
1
解决办法
1万
查看次数