python

How to destroy the Label and Entry Tkinter Python?

I create a label, put it through place and try to delete it self. label.destroy (), but nothing works, the same with entry, p ... estroy() self.settings[1] = 0 if __name__ == "__main__": app = mainWindow() app.root.mainloop()

Search for an item in the list

Code: users = [12390312, 12313123, 57289234, 21837129398] userstats = 21837129398 print("Начинаю поиск") for element in us ... to do, I tried Googling, but I didn't google anything. I'm still new to this field, maybe I don't know something, tell me :)

Need help with Beautiful Soup

I want to write a simple parser to check whether the series was released or not. If the series is not released, then the site ... html.select('title')[0].text tag = False for el in html.select('a'): print(el.text) But it didn't work out

What is the essence of IDLE (Python)?

Downloaded and installed Python 3.8. Then I found out that there is IDLE. See different app icons What's the idea? Why, whe ... dy in IDLE? And what is the point of that app on a black background? In what their difference? And why does it give an error?

How do I run a python script using xp cmdshell from sql-server?

Python 3.8.5 is installed on the server. If you run the file bot.py from the command line, then everything works. But I need ... TEWAY\MSSQL_TELEGRAM -d Problem -i C:\Python\Telegram\bot.py' The same mistake. How do I run this one script without errors?

In the terminal on the MAC it gives an error when trying to download pip and then the library

I'm trying to install the pygame library, and as far as I know, provided that I have a third version of python on my computer ... y want sudo's -H flag. ERROR: You must give at least one requirement to install (see "pip help install") Tell me how to be

pip python doesn't work on the command line

Pip doesn't work in python. What to do? I write on the command line - D:\python3>pip install pyinstaller And outputs "pi ... й командой, исполняемой программой или пакетным файлом. Tried through the folder python3\tools\scripts, still does not find

SyntaxError: Non-ASCII character '\xd1'

I wrote the following code conAcc = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=D:\ThirdTask\Northw ... no encoding declared; see http://www.python.org/peps/pep-0263.html for details What should I do to make the error disappear?

TypeError: argument of type 'type' is not iterable

from file import x a = x if i in a: dosomething File.py: class x: def __init__(self): self.q = [] def __contains__( ... yield i An error appears: TypeError: argument of type 'type' is not iterable What am I doing wrong and how do I do it right?

How to check that a variable!= (power of two - 1)

How to write a check that a number is not (a power of two - 1) without resorting to using a pre-filled list of similar number ... his one while (((x % 2) == 0) && x > 1) /* While x is even and > 1 */ x /= 2; return (x == 1); Methods?

The image is not displayed in django

I do not display the image in django, but if you do it through admin, everything works. I need a user to do this, not an adm ... p> </div> </a> </div> {% endfor %} {% endblock content %}

How do I find the most frequently repeated word in the text?

Write a program that reads text from a file (there can be more than one line in the file) and outputs the most frequent word ... count[i] == max_word_count: if word[i] < min_word: min_word = word[i] print(min_word,max_word_count)

Why does sum() in python assume that the collection contains exactly the numbers?

The sum() function in python3 has the signature sum(iterable, start=0). What is the reason that start is initially initialize ... ant to add it, and I expect the function to sum to me adds all my objects to one, and doesn't crash with the TypeError error.

Python, class inheritance

Hey, Stack. Faced with such a problem that I can not correctly distribute the classes into separate ones .py files. According ... : # арккотангенс ... fourth.py class D(): # Вообще это класс для производной, но не знаю от чего его наследовать. ...

How do I edit a BMP file in Python?

My task is to open a BMP file in binary mode and change it (make a negative of this image). By condition: The program is fed ... How is it still necessary to implement such file processing? Because I just ran out of ideas on how I can complete the task.

How do I save an xlsx file to a pdf?

Hello everyone The question is: how can I save it in PDF format via Excel? Or maybe another way to somehow convert? Here is t ... s://docs.microsoft.com/en-us/office/vba/api/ex ... SaveAsFixedFormat fails. How is it correct to write a save to PDF? Thanks!

Find a number that is some power of two

The program must enter the natural number n from the console and find the number following n, which is some power of two. For ... 2 active = True while active: for i in range(1, n): if z == x**i: active = False z += 1 z = n print(n)

How do I make a formatted list output?

I can't understand one mistake: TypeError: can only concatenate list (not "str") to list There is a line in which various i ... ), tuple([]), but then I get this answer: ['123', '456'] and 789. I need a result like this, but without [] these brackets.

Python how many days,minutes,seconds left from date to date

I have two dates: current and new year's. It is clear that using the datetime module in Python 3 , you can subtract these da ... of time until the new year in seconds, days, minutes, hours, etc. Example: До нового года: 60 дней 22 часа 45 мин 12 сек.

WebSocket in Django

I started working with websockets for the first time in my life and this error occurred. I have already used the tips to inst ... l" async def websocket_view(socket): await socket.accept() await socket.send_text('hello') await socket.close()