python

How to parse Yandex. Market in python.Error 403

Hello everyone.Problem with Yandex.Market parsing.I want to parse phones . When I contact Yandex. Market, it returns me a 403 ... ng="UTF8" soup = bs4.BeautifulSoup(r.content,"html.parser") sel = soup.select("div.d0N9PZYfeg a") for i in sel: print(i)

Requests module

I need to get a list of videos on the channel https://www.youtube.com/channel/UCMpoPt5DaBcscn1eLQxLCwA/videos, but the proble ... -grid-video-renderer')[0] last_video_link = last_video_html.select('a[id="video-title"]')[0]['href'] input(last_video_link)

How do I delete duplicate rows in an array?

Given a NumPy array: [[1 0 1 0 0 1] [1 1 1 0 0 1] [1 0 1 0 0 1] [1 0 1 0 1 1] [1 0 1 0 0 1]] a = [[1, 0, 1, 0, 0, 1], ... np.array(a) How can I delete duplicate rows? That is, the output should be: [[1 0 1 0 0 1] [1 1 1 0 0 1] [1 0 1 0 1 1]]

A while loop with a double condition in python

Actually, the problem is the following: when you leave only one of the conditions in the loop, everything works without compl ... о. Число должно быть от 1 до 9 включительно') number = int(input('Введите число: ')) number = number ** 2 print(number)

Predicting SARIMAX statsmodels time series in Python

To predict the time series, I use the SARIMAX model. I build a model, save the calculated coefficients, and try to apply them ... or the forecast. And the original model (see example) for some reason, it requires more than 50 identical values on the tail.

Python recursion, a common variable

There is such a function: def foo(): dosomething() foo() You need to somehow store the result of all calls to dosome ... e_list) How can I do without defining a list of some_list outside of the foo() function and return the result with a return?

Installing Pygame in PyPy

How do I install pygame in pypy? pypy3 -m pip install pygame - not working (running on Manjaro Linux) Here is the explanatio ... ------------ ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

sqlite3 PYTHON Update

Good afternoon, dear colleagues! Started sqlite3. I didn't understand the UPDATE command. It seems to be written correctly. b ... ie SET Salary_USD="30000$" WHERE Imya="Sergey"' print(cursor.execute(c).fetchall()) connection.commit() connection.close()

How to download a page via selenium

I need to download the page that selenium opened for further parsing via bs4. How do I do this?

Datetime python3 how to output only the time?

Let's say I have a function def get_current_time() -> datetime: delta = datetime.timedelta(hours=3, minutes=0) ret ... e.now(datetime.timezone.utc) + delta How do I display only the time, or rather the hours and minutes? No date, seconds, etc.

you need to install libraries like numpy and others using pip install

I installed Python 3.9 64-bit version and I need to add different libraries. I understand I have a problem with path. If you ... not an internal or external command, executable program, or batch file. I don't see how this can be solved. Please tell me.

Why does "1000000000000000 in range(1000000000000001)" work so fast?

As far as I understand, the range() function, which is actually a object type in Python 3, generates its contents on the fly, ... the question why is 1000000000000000 in range(1000000000000001) so fast in python 3 from the participant @RicksupportsMonica

Python. Is it possible to run a single thread many times?

I recently started studying threads in Python, specifically the threading module. And I need to make it so that after the en ... оторый нужно выполнить во время работы потока #событие: run = False How will this be implemented correctly? Python 3.8.3

Parallel execution of while loops in Python 3

I need to add game time that will go several times faster than normal time, doing this through a while loop. All loops should ... ime2)) if health <= 0: print("Конец игры. Ваше здоровье упало до нуля.") time.sleep(3) break

Python functions and threads

There is a loop that runs a loop that runs a function in 5 threads. The loop while looks for links on the page (there are alw ... 0])) th.start() j += 50 Stop all threads when pausing a single function already looked at, not suitable.

Iterating through dataframe strings in Pandas (Python)

You need to write a function that will take each row of the dataframe, and return the column names (with a value of 1) as a l ... the same initially, but I can't think of how to swap the list of columns and df[i]. As a result, I wandered into a dead end.

How do I set the grid Tkinter line margins?

I'm new to tkinter, please help me. Why is there an indent before " Your OS:"? I also set it to column = 0. Screen and code b ... Label(text = 'Текущая директория: ' + os.getcwd(), bg = 'pink', font = 'Times 30') label_CurentDir.grid(column = 0, row = 1)

How do I find the geographical coordinates of all bridges in Russia?

I want to get the coordinates of all the bridges across the rivers of Russia, how can this be done the fastest?

Randomizer of photos telegram bot

if message.text == 'Фотка' photo = open('Photo/photo.jpg', 'rb') bot.send_photo(message.chat.id, photo) I want it to send not a specific photo but a random one from the folder, how do I do this?

Adding an item to the top of a Python list

There is a function append(), but it adds an item to the end of the list, which function should I use to add it to the beginning? For example [10,100,55] Добавить 5 в начало [5,10,100,55]