I’ve been using xlrd3 to manage a .xlsx spreadsheet through python. When I’m given the value of the cell the date should be in, it gives me 44295, which should be 09/04/2021. I understand that this is because of the format excel stores dates as, so I’ve been using the xldate_as_datetime func…
I need a way to stop a function from running at the push of a button
I’ve been working on this for hours, and I’ve tried everything from break in an if statement to making an index variable. I can’t seem to find a way to stop the sound/music from playing. My goal is to press ‘Q’ and stop the function and while loop to start another while loop. Ans…
Dialogflow – sending media from python flask app to twilio
I am trying to figure out whether it is possible to send a response back to the user from my python flask app to twilio, which is integrated with dialogflow. Using Twilio and python only, and using messaging response I can send images back to the user. However, once I link the integration with dialogflow, I&#…
Command line array argument into a python script
I would like to create a python script and parse a list of command-line arguments. Specifically, I would like to give it the following arguments and have it read them as an array. Something like this: where the input array is: and inside the script, I want to do a “for loop” and and assign the var…
Iterate through nested dictionary values and return an ordered list based on dict’s values
I have a nested dictionary titled ‘transportation_costs’ that contains the transportation costs associated with every facility-customer combination. I need to iterate through each customer (key2) in the dictionary and generate five ordered lists (one for each customer) that contains the facilities…
Scraping Map created on google Maps
My goal is to scrape, the name and location of the Cannabis retailer in Manitoba Canada.Then place all the data onto a excel file.From this website: https://www.google.com/maps/d/u/0/viewer?mid=1jTYtNQgB0CVC27Bn_xIsFGeVuCh_KCdR&ll=49.671544600000004%2C-96.65402250000001&z=8. I am not sure if this is t…
Python split function behaviour
returns This behaviour seems really strange to me. Why are blanks returned only for b and not a? Answer As was pointed out by others, the documented behavior of str.split explains your results. Since you specify sep to be ‘)’, split looks for the strings that surround it, and in the case of ‘…
Pip install a whl on a private github repo?
How can one install a .whl (python library) from a private github repo? I have setup a personal access token and can install the library if its not a .whl by using the following command However if there is a .whl in the repo and I want to install from that using: Then I get the following error: I am
Jupyter notebook cell code not executing in VSCode when there is a file named random.py in the folder
I have just started using Jupyter notebooks in VSCode and have come across a strange issue. I made a folder for keeping my lab programs and there is a file named random.py in the folder. When I try to execute a code cell of my Jupyter notebook which is present in the same folder then I get an error ‘Ker…
making list index possible for python class list
Python has no function for list index argument in __getitem()__, __setitem()__, __delitem()__. Since I have been an R user for long time, it looks quite natural to utilize list index. I know there is pandas or numpy but it is cumbersome to change the type. AND IT NEEDS IMPORTING EXTRA PACKAGE! Here is my prop…