python

How do I send an email using Python?

Tell me, did you need to send a message to yandex in python. I found the code, but an error occurs. I read it, it is written ... SMTPAuthenticationError: (535, b'5.7.8 Error: authentication failed: This user does not have access rights to this service')

Parsing multiple bs4 python pages

Created a site parser. If you parse a single url, the code works. But since I need data from all the pages that are in the ar ... -25-g/','https://smokelab.me/catalog/tabak/severnyij-25-g/?page=2', ] for url in url_list: get_name_count(get_html(url))

Parsing an HTML file using BeautifulSoup in a DataFrame

There is a file of the form: <TD class="c1">111-1111</TD> <TD class="c2">AA1111-1111</TD> <TD cla ... = value that I have now .368 to lead to a numeric value? a value of the form 0.368 ? I will be grateful for any information !

'str' object cannot be interpreted as an integer what is the problem?

For _ in range(threadcountinp): TypeError: 'str' object cannot be interpreted as an integer Code: from bs4 import Beautiful ... '\n') for _ in range(threadcountinp): t = threading.Thread(target=thread) t.start() file.close() proxylist.close()

Time Limit Exceeded in a Python queue task

Python Queue task We asked a laboratory at the institute for writing a queue in python, I solved the problem, uploaded it to ... thub.com/RoyalGoose/testrepos What could be the problem? How can I fix the code so that it runs faster and passes this test?

Entering dictionary data from the keyboard

Please tell me how to set the dictionary from the keyboard (via input)? For example, my dictionary should store dates and events. can I use this code? That is, I enter the year and the corresponding event in the history.

How do I block entering characters in Entry from the keyboard?

from tkinter import* e=Entry(width=20) e.pack() How do I make it so that nothing can be typed on the keyboard, as well as inserted?

How do I run the script?

How do I run a script written in python 2.6 in 7 through the console?

Run a python script on the server

I remember there was some command python script.py & [что-то там] Which ran the script and you could close the terminal, leave the server, and the script continued to work. Can someone remind me?

Python. Check whether the number is a power of three. Outputs None

def is_power_three(n): print(n) if n == 1: return 'Є степенем трійки' if n < 1: return 'Не є степенем трійки' is_power_three(n/3) n = int(input('Введіть N: ')) print(is_power_three(n)) Be sure to use recursion.

All Russian words

From where can I get all the words in Russian? You need it for your own t9 on a PC. (preferably all words with an array)

'float' object is not callable

Error in line 7. Help me fix it. import math from math import sqrt, exp, sin, log, cos, pi, asin x = float(input()) y = floa ... ) / 2 * pi()))) # <--- r2 = 1.2 + sqrt(2 - cos(y) ** 2) r3 = x ** 2 + y ** 2 + 1 z = (r1 + r2) / r3 print(round(z, 5))

Black image when displaying an image

'exec(%matplotlib inline)' import numpy as np import matplotlib.pyplot as plt from PIL import Image import pandas as pd x_dat ... lt.get_cmap('gray')) plt.show() I can't understand why images are not output from the dataset, please help me understand

Django / Python does not follow links to html pages. How do I fix this?

I wanted to create a simple bulletin board (I just started learning Django). One of the tasks was to create several html page ... nclude urlpatterns = [ path("admin/", admin.site.urls), path('advertisements/', include('advertisements.urls')), ]

Returns error: ValueError: invalid literal for int () with base 10: '-'

import math f = open('D:/Python/info/input.txt', 'r') g = f.read(256) a = g[4] + g[5] b = g[11] + g[12] c = g[18] + g[19] if ... () f.close() Here is the code itself. It gives this error : Something to fix, please help, thank you very much in advance!

How to properly parse Html tags in Python

There is a question how to parse Html pages in python or rather here is the link to the page: https://3dtoday.ru/3d-models?pa ... </a> </div> I don't understand how to parse the text of the tag <a>?

TypeError error: 'int' object is not subscriptable

I'm starting to learn python, I ran into a problem like TypeError: 'int' object is not subscriptable. I ask for help, because ... ] + s[k]) % 4 if a[r] < (b[p] + s[k]): a = b[p] + s[k] b = a print(max(a[1], a[2], a[3]))

Fraction: how to add a fraction with an integer?

Implemented the Fraction class for operations with fractions. def gcd(a, b): while a % b != 0: old_a = a ... 10, 5) + 1) Output: AttributeError: 'int' object has no attribute 'b' Question: how to add a fraction with an integer?

How do I categorize a string based on the presence of a given group of extraneous characters?

I have a function that accepts a string. The string passed to the function can be: Consist entirely of letters (Russian or ... - Pi !!!") Out[64]: 3 # Буквы + какие-то символы In [65]: str_category("3.1415, -{}[]) !!!") Out[65]: 2 # Какие-то символы

How to calculate the sum of the modules of the array elements located after the first negative number?

We have: import random a = float(input("Введите число, которое будет началом диапазона случайных чисел: ")) b = float(input(" ... l numbers inside the new list to the module: newlist = [abs(elem) for elem in newlist] And I find the sum of all the values.