RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

Евграф Котовский's questions

Martin Hope
Евграф Котовский
Asked: 2025-02-18 17:23:07 +0000 UTC

PyQt5 中 QLabel 中的文本超出范围

  • 6

我为fb2书籍编写了这个阅读器,见下文。

当我将列表中的文本粘贴pages[]到 时textLabel,
文本“超出”了 的宽度textLabel。

在此处输入图片描述


setWordWrap这有帮助,但是文本变得难以阅读。

在此处输入图片描述

没有的话该如何修复setWordWrap?


main.py:

import sys
from config import *
from PyQt5.Qt import *
from src.Book import *
from src.styles.WhiteTheme import *


class BookViewer(object):
    def __init__(self, appStyle: style = WhiteTheme, appStyleFromSystem="Windows",
                 app=QApplication(sys.argv)) -> None:

        self.app = app
        self.Book = None

        # creating and configuring BookViewer window
        self.content = QWidget()
        self.content.setFixedSize(500, 500)
        self.content.setWindowIcon(QIcon("./media/karfagen.png"))
        self.content.setWindowTitle(f"Karfagen Book Viewer")
        self.content.setStyleSheet(appStyle.style)
        self.text_font = QFont(FONT_NAME, TEXT_SIZE)
        self.text_height = QFontMetrics(self.text_font)

        self.layout = QVBoxLayout(self.content)

        self.pageNumber = 0

        self.textLabel = QLabel()
        self.textLabel.setFixedWidth(400)
        self.textLabel.setFixedHeight(400)

        self.navigationBox = QGroupBox()
        self.navigationBox.setStyleSheet("""
        QGroupBox {
            border: 0px black solid;
        }
        """)

        #creating navigation panel
        self.navigationTopPanel = QWidget()
        self.navigationTopPanelLayout = QHBoxLayout()
        self.navigationTopPanel.setLayout(self.navigationTopPanelLayout)

        self.openFile = QPushButton(text = "open file")
        self.openFile.clicked.connect(self.openFileFunc)
        self.openFile.setFixedWidth(70)

        self.layout.addWidget(self.navigationTopPanel)

        self.navigationTopPanelLayout.addWidget(self.openFile)
        self.navigationTopPanelLayout.setAlignment(Qt.AlignLeft)

        #creating elements for navigation in Book
        self.navigationBoxLayout = QHBoxLayout()

        self.btn_prev = QPushButton(text="<")
        self.btn_prev.clicked.connect(self.prev_page)

        self.pageNumberLabel = QLabel(text=str(self.pageNumber))

        self.btn_next = QPushButton(text=">")
        self.btn_next.clicked.connect(self.next_page)

        self.navigationBoxLayout.addWidget(self.btn_prev)
        self.navigationBoxLayout.setAlignment(Qt.AlignCenter)
        self.navigationBoxLayout.addWidget(self.pageNumberLabel)
        self.navigationBoxLayout.addWidget(self.btn_next)

        self.navigationBox.setLayout(self.navigationBoxLayout)

        self.layout.addWidget(self.textLabel)
        self.layout.addStretch()
        self.layout.addWidget(self.navigationBox)
        self.content.setLayout(self.layout)

    def start(self):
        self.content.show()
        self.app.exec_()

    def render_page(self, pageNumber):
        try:
            self.pageNumberLabel.setText(str(pageNumber + 1))
            self.textLabel.setText("".join(self.pages[self.pageNumber]))
        except Exception as e:
            self.show_messagebox(str(e))

    def prev_page(self):
        if self.pageNumber > 0 and self.Book:
            self.pageNumber -= 1
            self.render_page(self.pageNumber)

    def next_page(self):
        if self.pageNumber <= len(self.pages) and self.Book:
            self.pageNumber += 1
            print(self.pageNumber)
            self.render_page(self.pageNumber)

    def parseBookData(self):
        """
        Parses raw book data into pages, handling paragraph wrapping and page breaks.

        Returns:
            A list of pages, where each page is a list of strings (paragraphs/lines).
        """

        pages= []
        page = []
        current_text_height = 0
        font_metrics = QFontMetrics(QFont(FONT_NAME, TEXT_SIZE))

        for paragraph in self.Book.text_data:
            # Split paragraph into lines that fit
            lines = self.split_paragraph_into_lines(paragraph, font_metrics, self.textLabel.width())
            for line in lines:
                line_height = font_metrics.height()  # Use actual line height

                if current_text_height + line_height <= self.textLabel.height():
                    page.append(line + "<br>")
                    current_text_height += line_height
                else:
                    pages.append(page)
                    page = [line]
                    current_text_height = line_height  # Reset height to the current line's height

        # Add the last page if it's not empty
        if page:
            pages.append(page)

        return pages

    def split_paragraph_into_lines(self, paragraph: str, font_metrics: QFontMetrics, max_width: int):
        """
        Splits a paragraph into lines that fit within the maximum width, handling word wrapping.

        Args:
            paragraph: The paragraph to split.
            font_metrics: QFontMetrics object.
            max_width: The maximum width for a line.

        Returns:
            A list of strings, where each string is a line.
        """

        if font_metrics.horizontalAdvance(paragraph) >= self.textLabel.width():

            words = paragraph.split()
            lines = []
            current_line = ""

            for word in words:
                test_line = current_line + word + " "  # Add word and a space to test
                if font_metrics.horizontalAdvance(test_line) <= max_width:
                    current_line = test_line
                else:
                    if current_line:  # Add the current line if it's not empty
                        newString = ""
                        for i in range(len(current_line)):
                            newString += current_line[i]
                            if font_metrics.horizontalAdvance(newString) == max_width:
                                break
                    lines.append(newString)
                    current_line = word + " " + current_line[i:len(current_line)]  # Start a new line with the current word

            if current_line:  # Add the last line
                lines.append(current_line.strip())
            return lines

        else:
            return [paragraph]

    def openFileFunc(self):
        options = QFileDialog.Options()

        # Get the file names from the dialog
        files, _ = QFileDialog.getOpenFileNames(self.content,
                                                 "Select Fiction Book Files",
                                                 "",
                                                 "Fiction Book 2 (*.fb2);;All Files (*)",
                                                 options=options)
        if files:
            self.Book = Book(files[0])
            self.Book.parse()

            self.content.setWindowTitle(self.Book.title + " " + self.Book.author + " " + "Karfagen Book Viewer")
            self.pages = self.parseBookData()
            self.render_page(self.pageNumber)

    def show_messagebox(self, text):
        msg = QMessageBox()
        msg.setIcon(QMessageBox.Icon.Error)
        msg.setText(text)
        msg.setInformativeText("")
        msg.setWindowTitle("error")
        msg.setDetailedText("")
        msg.exec()

Book.py:

from xml.dom.minidom import parse

class Book(object):

    def __init__(self, filename, encoding="UTF-8"):
        self.filename = filename
        self.encoding = encoding

        self.text_data = None
        self.document = None

        self.genre = None
        self.author = None
        self.title = None
        self.lang = None

    def parse(self):
        document = parse(self.filename)

        self.document = document
        self.genre = self.loadTagValueFromXML("genre")
        self.lang = self.loadTagValueFromXML("lang")
        self.author = self.loadTagValueFromXML("last-name") + self.loadTagValueFromXML("first-name")
        self.title = self.loadTagValueFromXML("book-title")

        paragraphs = document.getElementsByTagName("section")
        for paragraph in paragraphs:
            text_nodes = [
                node.childNodes[0].nodeValue for node in paragraph.childNodes
                if node.nodeName == 'p' and node.childNodes[0].nodeValue
            ]
        self.text_data = text_nodes
        self.parsedTextData = []

    def loadTagValueFromXML(self, tag_name):
        try:
            tag = self.document.getElementsByTagName(tag_name)[0].childNodes[0].nodeValue
            return tag
        except IndexError:
            return ""
python
  • 1 个回答
  • 66 Views
Martin Hope
Евграф Котовский
Asked: 2025-02-10 08:41:18 +0000 UTC

为什么解析 XML(FB2)时字符串值为空

  • 5

晚安。我编写了这个类来解析 XML:

from xml.dom.minidom import parse
from xml.dom import minidom

class Book(object):

    def __init__(self, filename):
        self.filename = filename

    def parse(self):
        with open(self.filename, "r", encoding="UTF-8") as document:
            document = parse(document)
            print(document.version, document.encoding, document.standalone)
            paragraphs = document.getElementsByTagName("section")
            for paragraph in paragraphs:
                text_nodes = [
                    node.nodeValue for node in paragraph.childNodes
                    if node.nodeType == minidom.Node.TEXT_NODE
                ]
                text = "".join(text_nodes)
            return text

当我输出结果时,有一个空行。 fb2文件本身是正确的,可以用程序打开。但它对我不起作用。这是为什么?

python
  • 2 个回答
  • 25 Views
Martin Hope
Евграф Котовский
Asked: 2024-11-17 07:05:06 +0000 UTC

为什么数据库在执行过程中会被阻塞?

  • 5

我正在为我的项目编写测试

这是导致错误的测试:

# adding classes to path
import sys
sys.path.append('..')
from time import sleep
from classes.database import *
import psycopg2
import sqlite3
from classes.tools import *

class UserClassAllMethodstest(object):
    #defining data of example user for tests User() class
    SimpleUserData = {
        "password":"123",
        'email': '[email protected]',
        "user":"user",
        "is_admin":"0",
        "is_banned":'0',
        "is_banned":"0",
        "logo_path":'',
        "citate":"",
        "format":"",

    }

    def __init__(self, DBWorker=DB()):
        self.DBWorker = DBWorker
        DBWorker.db.DBInit()

    # checking methods of User() class
    def TestClass(self):

        """
        checks create method

        #in first case we are checking creation of new user
        #in second case we are checking error from same emails
        #in third case we are checking errors from same user ID
        """

        assert self.DBWorker.User().create(**UserClassAllMethodstest.SimpleUserData)

        

        try:
            self.DBWorker.User().create(**UserClassAllMethodstest.SimpleUserData)
            self.DBWorker.User().create(password="1234567890", email="[email protected]", user="user1", is_admin="",
                                  is_banned="", logo_path="", citate="", format="obj")
        except Exception as e:

            assert type(e) == sqlite3.IntegrityError or type(e) == psycopg2.errors.UniqueViolation

        

        try:
            self.DBWorker.User().create(password="1234567890", email="[email protected]", user="user", is_admin="",
                                    is_banned="", logo_path="", citate="", format="obj")

            self.DBWorker.User().create(password="1234567890", email="[email protected]", user="user", is_admin="",\
                                  is_banned="", logo_path="",\
                                  citate="", format="obj")


        except Exception as e:
            
            print(e)
            assert type(e) == sqlite3.IntegrityError or type(e) == psycopg2.errors.UniqueViolation

        


        """
        checks get method
        
        in first case we checking receiving user by his user id
        in second case we checking receiving user by his user id and password
        in second case we checking receiving user by his token, created as a hash from password and user id
        in four case we checking getting user from num
        in case 5 we checking getting data in json (dict in python) format
        in case 6 we checking getting data from not existing user id
        
        """

        assert self.DBWorker.User().get(user = UserClassAllMethodstest.SimpleUserData["user"], format = "obj").UserId == \
               UserClassAllMethodstest.SimpleUserData["user"]

        

        assert self.DBWorker.User().get(user=UserClassAllMethodstest.SimpleUserData["user"], password = \
                                   UserClassAllMethodstest.SimpleUserData["password"], format = "obj").UserId == \
               UserClassAllMethodstest.SimpleUserData['user']

        


        token = generate_token(UserClassAllMethodstest.SimpleUserData["user"],UserClassAllMethodstest.SimpleUserData["password"])

        assert self.DBWorker().get(token=token, format = "obj").UserId ==\
               UserClassAllMethodstest["user"]
        


        TestUser = self.DBWorker.User().create(password="1234567890", email="[email protected]", user="user5", is_admin="",
                                  is_banned="", logo_path="",
                                  citate="", format="obj")

        

        assert self.DBWorker.User().get(num = TestUser.ActiveNum).__dict__ == TestUser.__dict__

        


        assert self.DBWorker.User().get(user = UserClassAllMethodstest.SimpleUserData["user"], format = "json")["UserId"] == \
               UserClassAllMethodstest.SimpleUserData["user"]

        

        """
        checks data changing via UserStorage() class
        """

        UserData = self.DBWorker.User().get(user = UserClassAllMethodstest.SimpleUserData["user"], format = "obj")

        try:

            UserData.email = "[email protected]"
            UserData.UserId = "user1337"
            UserData.IsAdmin = "1"
            UserData.IsBanned = "1"
            UserData.LogoPath = "sample_image"
            UserData.citate = "sample quote"
            UserData.time = "13:37:14"
            UserData.ActiveNum = "1337"
            self.IsActivated = "1"
            self.NumOfPosts = "666"

            UserData.save()

        except Exception as e:

            raise AssertionError

        """
        checks delete method
        
        in case 1 we checking deleting data via user id
        in case 2 we checking deleting data via user id and password
        in case 3 we checking deleting via token created as a hash from user id and password
        """

        assert self.DBWorker.User().delete(user == UserClassAllMethodstest.SimpleUserData["user"]) == 1
        assert self.DBWorker.User().create(**UserClassAllMethodstest.SimpleUserData)

        assert self.DBWorker.User().delete(user == UserClassAllMethodstest.SimpleUserData["user"], password = UserClassAllMethodstest.SimpleUserData["password"]) == 1
        assert self.DBWorker.User().create(**UserClassAllMethodstest.SimpleUserData)

        assert self.DBWorker.User().delete(token = token) == 1

if __name__ == '__main__':
    UserClassAllMethodstest().TestClass()

执行时,由于数据库被锁定,程序崩溃。我用的是sqlite3。数据库被阻塞可能是什么问题以及如何解决?

python
  • 2 个回答
  • 37 Views
Martin Hope
Евграф Котовский
Asked: 2024-09-28 22:14:27 +0000 UTC

为什么该函数不取消表单提交?

  • 5

我在 static/main.js 中有这个函数:

  function getCookie(cookieName) {
    const name = cookieName + "=";
    const decodedCookie = decodeURIComponent(document.cookie);
    const cookieArray = decodedCookie.split(';');
    
    for (let cookie of cookieArray) {
        while (cookie.charAt(0) == ' ') {
            cookie = cookie.substring(1);
        }
        if (cookie.indexOf(name) == 0) {
            return cookie.substring(name.length, cookie.length);
        }
    }
    return "";
}

var UserDataGet = async (token) => {
    const userRequest = await fetch(`/api/GetUserInfo?token=${token}`);
  
    if (await userRequest.ok) {
      const userData = await userRequest.json();
      if (Object.keys(userData).length === 0) {
        return "0"; 
      } else {
        return userData;
      }
    } else {
      return "0";
    }
  };

var DataValidate = async () => {
  if ( await UserDataGet(getCookie("token")) == "0") {
    alert("you are not registred");
    return false
  }

  else {
    return true
  }
}

这是形式:

<form method="POST" enctype="multipart/form-data" onsubmit = "return DataValidate()"> 
  <label for="Message">Write your message</label>
  <input name="Message" type="text">

  <input name="TopicId" type="hidden" value="">

  <input name="AuthToken" type="hidden" value="">

</form>

DataValidate() 函数检查用户是否已注册。如果不是,则返回 false,该函数本身可以正常工作。但是如何将 DataValidate() 函数的结果返回到表单呢?

javascript
  • 1 个回答
  • 37 Views
Martin Hope
Евграф Котовский
Asked: 2024-09-20 06:25:01 +0000 UTC

为什么要返回类方法?

  • 5

我有以下班级系统:

import sqlite3
import psycopg2 as psql

from .user import user
from .message import *
from .topic import *
from .user import user
from .tools import *

class SQLite3:

    def __init__(self, path):
        self.path = path

    def work(self, query):
        con = sqlite3.connect(self.path)
        cursor = con.cursor()
        cursor.execute(query)
        data = cursor.fetchall()
        con.commit()

        return data
    
    def DBInit(self):
        InitDB(self.work)

class postgres():

    def __init__(self, host, port, name, user, password):
        self.host = host
        self.port = port
        self.name = name
        self.user = user
        self.password = password

    def work(self, query):
        conn = psql.connect(dbname=self.name, user=self.user, password=self.password, host=self.host, port=self.port)
        cursor = conn.cursor()
        cursor.execute(query)
        data = cursor.fetchall()
        cursor.close()
        conn.close()

        return data
    
    def DBInit(self):
        InitDB(self.work)


class DB:

    def __init__(self, DBType="sqlite3", path="", host="", port="", name="", user="", password=""):

        match DBType:
            case "sqlite3":
                self.db = SQLite3(path)
            case "postgres":
                self.db = postgres(host, port, name, user, password)
            case _:
                raise TypeError("Unkwon type of DB")
            

    def DBInit(self):
        self.db.DBInit()

    def User(self):
        return user(self.db.work)

    def Topic(self):
        return topic(self.db.work)

    def Message(self):
        return messages(self.db.work)

from .tools import *
from .TableMetaClass import *
from .storage import *

class messages(TableMetaClass):

    def __init__(self, DBworker):
        super().__init__(DBworker)

    def get(self, MessageId):
        super().get(self)

        return MessagesStorage(self.DBworker(f"SELECT * FROM messages WHERE MessageId = {MessageId}"))
    
    def JsonGet(self, MessageId):

        return {"TopicId":MessageId[0], "MessageId":MessageId[1], "author":MessageId[2], "text":MessageId[3], "time":MessageId[4]}

    def all_(self):
        super().get(self)

        return [MessagesStorage(i) for i in self.DBworker("SELECT * FROM messages")]
    
    def AllJson(self):

        return [{"TopicId":MessageId[0], "MessageId":MessageId[1], "author":MessageId[2], "text":MessageId[3], "time":MessageId[4]} for MessageId in self.DBworker("SELECT * FROM messages") ]

    def delete(self, MessageId):
        super().get(self)
        self.DBworker(f"DELETE * from messages WHERE MessageId = {MessageId}")

    def create(self, TopicId, author, text, time_of_publication):
        # TopicId, MessageId, author, text, time_of_publication
        super().create(self)
        
        try:
            self.DBworker(f"INSERT INTO messages VALUES '{TopicId}', '{generate_id()}', '{author}', '{text}', '{get_current_time()}'")
            return 1
        except:
            return 0

当我像这样调用 GetViaTokenJson 方法时

db = DB(DBType="sqlite3",path="main.db")
db.User.GetViaTokenJson("AwesomeToken"

我收到类似的错误: AttributeError: 'function' object has no attribute 'GetViaTokenJson' 为什么 DB 返回方法而不是 User 类的对象?

python
  • 1 个回答
  • 10 Views
Martin Hope
Евграф Котовский
Asked: 2024-05-27 03:42:58 +0000 UTC

Django 找不到图像

  • 5

我在settings.py中定义了以下设置: 在此输入图像描述

我有以下项目结构:

在此输入图像描述

当访问这些网址时:

127.0.0.1:8000/media/5JTeFpjl95w.jpg
127.0.0.1:8000/media/images/5JTeFpjl95w.jpg*текст курсивом*

它只返回 404。我该如何解决这个问题?

python
  • 1 个回答
  • 11 Views
Martin Hope
Евграф Котовский
Asked: 2024-02-08 06:00:34 +0000 UTC

python中无法调用静态类方法

  • 5

我在调用方法时遇到问题的主题类:

#.tools  - where definded get_current_time, generate_id
#db is object of class and have method excute_query, wich send query to
from .tools import *

class topic:
    
    def __init__(self,theme,author,about,db):
        self.time_of_creation = get_current_time
        self.theme = theme
        self.author = author
        self.about = about
        self.sb_id = generate_id()
        self.db = db

        try:
            #inserting data into DB
            self.db.excute_query(f"""INSERT INTO user VALUES ("{get_current_time()}, '{self.theme}', 
                                                            '{self.author}','{self.about}',
                                                            '{generate_id()}')""")
            
            return 1
    
        except Exception as e:
            print(str(e))
            return [0, str(e)]
        
    @staticmethod
    def all(self):
        return self.db.excute_query("SELECT * FROM topic")

我正在尝试调用 all() 方法:

topic.all()

作为响应,我得到 AttributeError: 'function' object has no attribute 'all'。我怎样才能解决这个问题?

python
  • 2 个回答
  • 60 Views
Martin Hope
Евграф Котовский
Asked: 2024-01-22 19:17:05 +0000 UTC

python 脚本中的 SQL 查询返回操作错误:near ")"

  • 6

我有以下功能:

def initialise_database(db: object):

    if db.__class__ == sql_lite3_db:

        # sqlite3 doesn't handle date type, so date_of_creation and other similar variables must be in the format YYYY-MM-DD HH:MM:SS.SSS
        # creating table, which represents the forum class
        # structure of table forum: name, date_of_creation, id

        db.excute_query("""
            CREATE TABLE IF NOT EXISTS forum (
                name TEXT,
                date_of_creation TEXT,
                id TEXT ,
            )
        """)

        # structure of table user: password, user_id, is_admin, is_banned, logo_path, citate, time_of_join, token

        db.excute_query("""
            CREATE TABLE IF NOT EXISTS user (
                password TEXT,
                user_id TEXT UNIQUE,
                is_admin BOOLEAN,
                is_banned BOOLEAN,
                logo_path TEXT,
                citate TEXT,
                time_of_join TEXT,
                token TEXT UNIQUE NOT NULL
            )
        """)

                

        # creating table threads, which represents the thread class
        # structure of table thread: id_forum, id_thread, name, time_of_creation, author, decrypt (description)

        db.excute_query("""
            CREATE TABLE IF NOT EXISTS thread (
                id_forum TEXT REFERENCES forum(id),
                id_thread TEXT UNIQUE PRIMARY KEY,
                time_of_creation TEXT,
                author TEXT REFERENCES user(user_id),
                decrypt TEXT
            )
        """)

        # structure of table topic time_of_creation|theme|author|about|sb_id


        db.excute_query("""
            CREATE TABLE IF NOT EXISTS topic(
                time_of_creation TEXT,
                theme TEXT, 
                author TEXT REFERENCES user(user_id),
                about TEXT,
                sb_id TEXT REFERENCES thread(id_thread)


            )
                  
                  
                  
                  """)

                
        # creating table messages, which represents the message class
        # structure of table messages: id_thread, message_id, author, text, time_of_publication

        db.excute_query("""
            CREATE TABLE IF NOT EXISTS messages (
                id_thread TEXT REFERENCES thread(id_thread),
                message_id TEXT UNIQUE PRIMARY KEY,
                author TEXT REFERENCES user(user_id),
                text_of_publication TEXT,
                time_of_publication TEXT
            )
        """)



        
    elif db.__class__ == postgres_db:

        # sqlite3 didn't handle date type, so date_of_creation and other similar variables must be like YYYY-MM-DD HH:MM:SS.SSS
        #creating table, which represents the forum class
        #structure of table forum : name;date_of_creasting;id

        #structure of table user password|user_id|is_admin|is_banned|logo_path|citate|time_of_join

        db.excute_query(""" 

                CREATE TABLE IF NOT EXISTS user (
                    password TEXT,
                    user_id text UNIQUE,
                    is_admin BOOLEAN,
                    is_banned BOOLEAN,
                    logo_path TEXT,
                    citate TEXT,
                    time_of_join date,
                )
                         
                         
                         """)

        db.excute_query("""

    CREATE TABLE IF NOT EXISTS forum (
        name TEXT,
        date_of_creation date,
        forum_id TEXT,
    )

                        """)
        
        #creating table threads, which represents the thread class
        #structure of table: id_forum|id_thread|name|time_of_creation|author|decrpt (description)

        db.excute_query("""
                        
    CREATE TABLE IF NOT EXISTS thread (
        id_forum TEXT REFERENCES forum(id),
        id_thread TEXT UNIQUE PRIMARY KEY,
        time_of_creation date,
        author TEXT REFERENCES user(user),
        decrpt TEXT,
    )

                        
""")


        #creating table messages, which represents the messages class
        #structure of table messages : |id_thd|mess_id|author|text|time_of_publication

        db.excute_query(""" 
                        
    CREATE TABLE IF NOT EXISTS messages (
        id_thd TEXT REFERENCES thread(id_thread),
        mess_id TEXT UNIQUE PRIMARY KEY,
        author TEXT REFERENCES user(user),
        text_of_publication TEXT,
        time_of_publication date,
    )


                        """)


        db.excute_query("""
            CREATE TABLE IF NOT EXISTS topic(
                time_of_creation date,
                theme TEXT, 
                author TEXT REFERENCES user(user_id),
                about TEXT,
                sb_id TEXT REFERENCES thread(id_thread)


            )
                  
                  
                  
                  """)


    else:
        raise TypeError('object must be in databases classes, not in other')

db 是一个类对象,它们有一个 extract_query 方法。我传递了一个“sql_lite3_db”类的对象,它返回

sqlite3.OperationalError: near ")": syntax error

告诉我,我的 SQL 脚本中的错误在哪里?

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