How to correct a string in python? [closed]
Good day!today = 2004 - is a date and month clipping from the full date in the format day.month.year = April 20, 2024bdate parsed in day.month.year formatВотздесь member['bdate'][-4:] It turns out that...
View ArticleGetting 404 on Openai Azure Endpoint
Using the AzureOpenAi client, and getting a 404AsyncAzureOpenAI( api_key=os.getenv("AZURE_OPENAI_API_KEY"), api_version="2024-01-25-preview", azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT", ""), )As...
View Articleconverting a word file into a pdf file without notes
I want to convert a word file into a pdf file using python, but without any notes that I added to the word file.I am using PyPDF2 library and convert() function. for paragraph in infile.paragraphs: for...
View ArticleERROR: Could not open requirements file: [Errno 2] No such file or directory:...
I am using GitHub actions to run a file every day (the file is named newday.py and is in project folder). the requirements.txt file is in the root directory. the actions.yml file is in the...
View Articlereturn numpy array values from ctypes call
I am trying to use cytpes to interface to the Little CMS color system. I am on windows and python 3.12 with numpy 1.26.4. I have compiled lcms myself using msvc 2022. Calls to lcms2.dll to open...
View ArticleCan i combine contain and startswith in order to match two columns from one...
Master dataframe filled with a specific match's players and statistics.34 columns and variable number of rows.Column "Player" has full namesPlayerGoalsAssistsDominic Calvert-Lewin11Beto20Jarrad...
View ArticleHow to print one character at a time on one line?
How would one print the string "hello world" onto one line, but one character at a time so that there is a delay between the printing of each letter? My solutions have either resulted in one character...
View ArticleHow to set output print precision of Sympy on Jupyter Notebook
Using set_global_settings I was able to print variables on jupyter-notebook using scientific notation:import sympy as syfrom sympy.printing.str import StrPrinterStrPrinter.set_global_settings(min=1,...
View ArticleHow can I run Pyvmomi scripts based on vSphere alarms on the VCSA
I need to trigger a script through vsphere for specific events, say if an ESXi host crashed. Wanted to do it using pyvmomi, prefer not to poll the vcenter and rather have an alarm trigger a...
View ArticleHow can I enter to a virtual environment previously created to install new...
I’m having problems in Thonny with the picamera module. I can see it when I enter into manage packages. I also tried to install picamera2 which is already installed but not in the virtual environment...
View ArticleTelegram bot - Get poll results
I'm working on developing a Telegram bot that can initiate polls in group chats and gather the votes in those polls.I've successfully implemented the creation of polls using the sendPoll API endpoint....
View ArticleHow to overlap a geopandas dataframe with basemap?
I have a shapefile that I read as a geopandas dataframeimport geopandas as gpdgdf = gpd.read_file('myfile.shp')gdf.plot()where gdf.crs<Projected CRS: ESRI:54009>Name: World_MollweideAxis Info...
View ArticleHow to extract the expression of a combination of Wavefuncion objects in Sympy
The Sympy documentation says that the attribute expr extracts the expression of a Wavefunction object. However, that doesn't seem to work when dealing with linear combinations of wavefunctions.Consider...
View ArticleUnable to Install GDAL Using PIP on Python
I'm trying to install gdal in python3.8.8 (Windows 10) and i'm getting below errorI have install Visual Studio Build Tools 2019 and reboot my PCDowngrade my Python from 3.9.5 to 3.8.8C:\Program...
View Articleerror while install dlib on cmd, could not build wheels for dlib
im getting this error while trying o install dlib on cmdi already install cmake version 3.26.1visual studion python version is 3.10pip install dliband the resultsCollecting dlib Using cached...
View ArticleError when calling class constructor with Python in Vscode
enter image description hereclass CircularlyLinkedList: def __init__(self): self.tail = None self.size = 0..When I ran the above code and enteredls1 = CirculralyLinkedList()An error occurred: An...
View ArticleDiscord Python Bot nuke command partially works
So I've tried to make my discord bot a nuke command, but only the nuke part works, the cancel part doesn't work.My code:import discordfrom discord.ext import commandsfrom discord.ui import Button,...
View ArticleHow come my photo in flask does not appear on the page when the url is linked
So I have everything linked together. I've gone through every post on here related to flask and photo uploads and have tried all of them but nothing seems to be fixing me issues, it seems that the...
View ArticlePyCharm: Cannot find reference 'attrs' in 'PageElement | None'
I'm in PyCharm and I'm getting this strange "cannot find reference" error when using BeautifulSoup. I've followed other mentions of similar issues on here, but the warning persists. I'm getting a...
View ArticlePython: Differentiating between row and column vectors
Is there a good way of differentiating between row and column vectors in numpy? If I was to give one a vector, say:from numpy import *v = array([1,2,3])they wouldn't be able to say weather I mean a row...
View Article