My title can look a little ambiguous, so here is an explanation. Professional IDE like Pycharm or Visual Studio Code allow copying the folder, navigating to a specific directory and pasting it there. I would also like to implement that. But in my case, shutil.copytree needs 2 arguments – source folder and destination folder. So is there any way that
Flask and Ldap3 not playing nicely together
I’m building an internal app for my company, and are looking into using ldap3 to connect to our exchange server to validate login credentials. I am integrating into a flask app and have a login view with the following code The above code works fine when I login using my actual credentials, but when I try to login using wrong
Array input into an equation get array output in Python
I’m a python beginner and I’m trying to solve a cubic equation with two independent variables and one dependent variable. Here is the equation, which I am trying to solve for v: 3pv^3ā(p+8t)v^2+9vā3=0 If I set p and t as individual values, I can solve the equation with my current code. But what I would like to do is set
Python ImportError and ValueError in VSCode/pytest
This is what my project looks like (oversimplified): Whenever I run pytest standing in root/ I get ImportError : Attempted relative import with no known parent package. If I move test_code.py out to root/ everything works fine. But this is not an option since I have many modules and that is why I need to put ALL test modules inside
Search for a specific element in multiple pages and click using Python Selenium
Hi im trying to navigate from page 1 to page 5 (the element can be in any of the pages)and find and click on a specific element using python selenium. The following is the element from the page: <span _ngcontent-mtx-c123″” class”ng-star-inserted”>ABC Company</span> i tried by using : driver.find_element_by_name(“ABC Company”).click() but this doesnt work. Another Way i tried: I need the
Python get filepath
I’m trying to create a simple script to copy the filepath of a selected file (in windows explorer) to the clipboard in python. I’ve been looking at pyperclip and tkinter but I’m unsure how exactly to proceed. The askopenfilename in tkinter seems promising, but I’d like to select the files outside python and then call the script through the windows
Associate a Django Bool FormField with a submit button in a ModelForm and CBV
The view has a Boolean Field which will define if a question is OK or needs correction. The template will load two buttons to act as submit to the form, “Question is OK” and “Question needs correction”. I need to pass the value of this button as the Boolean Field value. I found the answer when using Function-based views, but
How to extract total year rows and columns from multiindex to create histograms in plotly
How do I create dataframes showing daily data for each year to create histograms in plotly? I want my output for 2019 data frame to have all of 2019 transactions and my other dataframe to have all of 2020 transactions Answer Try with
How to Detect collisions in PyQt5
Iam making a simple game using PyQt, but i don’t know how i can detect the collisions between enemy and bullets, there is a C++ implementation, but i dont know how i can do that in PyQt. and it should be done in Bullet.py file. these are the files. Window.py Player.py Enemy.py Bullet.py Score.py from PyQt6.QtWidgets import QGraphicsTextItem from PyQt6.QtCore
Concat following row to the right of a df – python
I’m aiming to subset a pandas df using a condition and append those rows to the right of a df. For example, where Num2 is equal to 1, I want to take the following row and append it to the right of the df. The following appends every row, where as I just want to append the following row after