I’m successfully able to download CSV files from a folder on Exavault, using the files provided by Exavault, but the download gets saved in a temporary folder on my Mac. How do I define the directory to save it to? This is an excerpt of the script. Separately there’s a resources_api.py file, which…
Tag: python
Aggregation $match within a $sum
I was wondering if it was possible to somehow use the $match operator within the $sum function for aggregation. I want to be able to use the value of the $sum operator within the project fields somehow, I just don’t really understand what the right approach would be for this. Sample Input (may be too lo…
How to handle vector based movement and x axis tile map collisions in pygame
I have a problem with my pygame script in which the way I check for collisions doesn’t seem to work with the x axis and presents some very frustrating and downright stupid errors. The way it works is I first check for movement in the axis of choice, here is an example in the y axis. I then get a
Python pandas .str.split regex=True ValueError: Columns must be same length as key
I need help with this pandas split with regex. I’m getting the error ValueError: Columns must be same length as key. my column of data is like this my code is desired results would be. Answer Given: Doing: Output: Works fine for me.
solving single variable two sided equation in sympy
Can anyone advise on why the below code using Sympy would error with ‘Add’ object is not callable? I am trying to solve a simple single variable linear expression. It can be solved by hand and Wolfram Alpha gives a solution for ‘y’. Not sure how else to input it into Sympy. I might be …
Make a for loop that doesn’t add a new line (Class’s List)
I’m pretty new to python and I’m trying to make an inventory for a text RPG game I’m making if you could help me figure this out id super appreciate it! Current output if I enter Test as name then, giveX3, stats Desired output if I enter Test as name then, giveX8, stats Also would like to do…
Python regex: Negative look-ahead with selection of different length strings
I’m searching for a Regex pattern in Python 3.8 that matches a sequence of strings if and only if it’s not followed by a selection of other strings. For example, I want to match the pattern “<fruit> and <fruit>” only if the second fruit isn’t followed by “ice…
Subtract specific value from a list (of numbers) by user input
I’m a begginer in Python and i’m trying to do a program when the user chooses a number from a list, then after you type by how you much want to reduce this chosed number and then print the list. I know that using list[specific index], check if matches with user input and repeating over and over ag…
User-created Record Fields
I am creating a web-app w/ Flask + Flask-WTF that has CRM-like features as a project. My current database (MongoDB) structure is I have: Users who can login, People who are assigned to users, and Records who are assigned to people. People have various fields to be filled out (Name, Phone Number, Email, etc). …
Python client socket can’t receive data from a successful response
Socket can’t receive any data from the server, when there is a successful response, but with bad requests it can. Also server responds, just the socket can’t receive data (checked in WireShark) Answer First, the HTTP GET expects a sequence of CR LF characters after each header line not just a sing…