I´m triying to use Google Drive API quickstart to save all files ids with Python. I want to save files ids in a txt document This is my code I want to save all files ids,but my program is not working properly only saves the last file id What is happening? Answer Delete from (for items in items:) to (archivo.close())
Tag: python-3.x
inputs being filled in too fast in selenium | python 3.8
so I am trying to log into this website called ttrockstars, and I have written a function to login to the website. However the code seems to be running too fast and ignoring time.sleep(5) that i have added to the code: When I run this, it simply enters the school name and then deletes it and enters the username and
Python uniform random number generation to a triangle shape
I have three data points which I performed a linear fit and obtained the 1 sigma uncertainty lines. Now I would like to generate 100k data point uniformly distributed between the 1 sigma error bars (the big triangle on the left side) but I do not have any idea how am I able to do that. Here is my code
Pandas – expending several values to new columns with some column name manipulation
I’m new to pandas. Consider you have a state in which you have a pandas Dataframe structure of columns like below: user_id | timestamp | foo_name1 | foo_name2 | foo_name3 As we can see Dataframe has several metadata parameters, having raw string values: user_id, timestamp and several dynamic name columns – which have a string value of json within each:
How to write more than one text inside of a variable [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 12 hours ago. Improve this question Hey Guys im new to Python and programming in general and i was creating little guessing game so i decleared a variable […]
pushing and poping into new list
I am trying to make a loop that if the program sees a letter or number it will push(x) into a new list and if it sees an asterisk * it must pop(). It is more of a stack algorithm where the first letter or number in is the last one out. FILO First in last out For example If
Remove commas from all columns except one
Is there a way to remove commas from all columns except 1 or 2 (here, just date) in general code? (I have 20 columns in reality.) Expected output: Answer Use DataFrame.replace on columns of dataframe excluding the columns from exclude list: Result:
Why cant I login into a website using request module
So I needed to login to a website as I need to do an action that requires logging in first. Here’s my code: it gives me the title of when you’re not logged in :( Answer I’m not sure why did I flagged this as duplicate, sorry. Okay, so I created a dummy account and tried logging in – I
Get person who invited the discord bot discord.py
Is there any way to get the person who invited the bot to the server? My point is to dm that person to tell her what to do so things go smoothly and I don’t want the bot to just write it in a random text channel that everybody could see. Thanks in advance Answer There isn’t any way yet
Counting the number of triplets forming GP series in python
The problem statement is: You are given an array and you need to find number of triplets of indices(i,j,k) such that the elements at those indices are in geometric progression for a given common ratio, r and i<j<k. For example, arr=[1,4,16,64]. If r=4, we have [1,4,16] and [4,16,64] at indices (0,1,2) and (1,2,3). I have a solution but I am