How do I debug the issues in my code so that my subfunction can also print?
This is a code of my function, I had to breakdown the main function into subfunctions. When I tested the main function it worked but not when I tried to print the output of subfunction. I tried to...
View ArticleSelenium Manager not working on AWS Lambda
trying to run a lambda on AWS that uses selenium and chromedriveruploaded a layer that contains selenium v4.13 and chromedriver v2.24I understand that this version of selenium contains selenium manager...
View ArticleI am trying to make a diphthong counter, and i cannot seem to get it count...
word = input("Tell me the word you wish to check for diphthongs: ")total = 0diphthongs = ['ue', 'ie', 'ae', 'ee', 'oe', 'ui', 'ii', 'ai', 'ei', 'oi', 'ua', 'ia', 'aa', 'ea', 'oa', 'uo', 'io','ao',...
View ArticlePYTHON--SPAWN and exitcode = _main(fd, parent_sentinel) . What do that mean?...
Code Using Selenium and WEbdriver threw these error codes:e exitcode = _main(fd, parent_sentinel)prepare(preparation_data)_fixup_main_from_path(data['init_main_from_path'])main_content =...
View ArticleOpenAI from Langchain requires "openai_api_key" even though it is loaded
this is my code:import osfrom dotenv import load_dotenv,find_dotenvload_dotenv(find_dotenv())print(os.environ.get("OPEN_AI_KEY"))from langchain.llms import...
View ArticleHow can I speed up these if statements?
Currently, my code runs fine it's just running a bit slow for my use. I am using OpenCV to capture the screen and then checking those results using some if statements. I believe the current bottleneck...
View ArticleIn which language do i need to learn DSA?
I'm confused to chose a programming language to master DSA.In a recent blog i saw that some companies don't allow to do DSA using python, I saw a random Youtube video in which they mentioned to use...
View ArticleWhen would the absence of "break" at the end of a while loop lead to infinite...
I created a silly function to see if a string contains digits or not.def check_digit_placement(w): if w.isalpha(): return True else: i=0 while True: if w[i].isdigit(): return True #Would the absence of...
View ArticleHow do I set environment variables in Code Cells in Scientific Mode?
Pycharm is not reflecting the environment variable I set in a code cell. The following code runs in Pycharm (hitting play on the entire script):#%% <- Scientific Mode: onimport osfrom pathlib import...
View ArticleError `Object of type datetime is not JSON serializable` when uploading file...
Im running Google Cloud SDK 458.0.1 & core 2023.12.20 with python 3.11.4Im calling the command on a file tmp.yaml which was downloaded with gcloud run jobs describe <job name> --format...
View ArticlePython, clicker game, coding of "passive income" , problems with Threading...
I am trying to code a clicker game and already have a screen, a button to increase money and a upgrade to increase the money made with clicks. The whole thing is made in Tkinter.The next function i am...
View ArticleHow can I add a font on OpenCV library in python?
I have a very specific question to ask regarding fonts on OpenCV.As well known, the fonts are predefined, and if you want to use fonts that are not in the list, you need the help of PIL(Pillow).Now my...
View ArticleWhy is there a little arrow in the middle of the screen?
I hide all turtles that are supposed to be hidden. I am wondering why there is always a little arrow in the middle of the screen (see screen shot below code).import timefrom turtle import Screenfrom...
View Articlealigning multiple labels below xaxis using matplotlib at equi-distances
I am trying to add a few labels below the x-axis using matplotlib. I have 5-6 labels which I want to plot below the xaxis. The text of these labels will vary hence, having a single setting to render...
View ArticleAttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you...
Earlier I installed some packages like Matplotlib, NumPy, pip (version 23.3.1), wheel (version 0.41.2), etc., and did some programming with those. I used the command C:\Users\UserName>pip list to...
View ArticleBuildozer fails to compile Kivy app to android
I'm using Ubuntu Desktop 22.04.3 in VirtualBox. I'm trying to make an AR/VR program for android using Kivy but whe I ran the command: buildozer android debug in the terminal. I got an error about a...
View ArticleUnable to print QWidget to PDF at acceptable quality
I am trying to print a QWidget to pdf at A4 page size with QPrinter. But unable to generate it in a acceptable quality. Please find the code I have tried below. Any help regarding the pdf quality is...
View ArticleError while treating data with curve_fit : " RuntimeError: Optimal parameters...
I have to do an homework on Python, and I'm getting the error :RuntimeError: Optimal parameters not found: The maximum number of function evaluations is exceeded." while treating data.So, I just...
View Articlei am having trouble in project
i am working on Youtube API for Python: How to Create a Unique Data Portfolio Projectand i always got an error message while running this code:import isodatevideo_df["durationSecs"]=...
View ArticleCombine rows and columns to create a 2x2 table for Fisher's exact test
I need to perform a test of independence on the following crosstab ct using python:Since there are some values less than 5, I cannot perform the chi-square test of independence. Instead, I need to...
View Article