All Questions

Tagged with
Filter by
Sorted by
Tagged with
0votes
1answer
24views

Unable to compare the time field in dictionary to current time

I am learning python. I am trying to compare the date in Time field of a dictionary with the date in current_time and if it matches, i am trying to print the key , id in JIRA_ISSUE but however, ...
user avatar
  • 5
0votes
0answers
12views

Is there a way to simultaneously download multiple audio files in pytube?

I have made a youtube to mp3 app in python using pytube. I wanted to be able to download multiple songs at once, as in add them to a queue of some sort and all items in it would begin to download ...
user avatar
  • 11
0votes
1answer
59views

Why is the output different with Python 2.7 than Python 3.10? [duplicate]

$ /usr/bin/python2 simple.py 200 > out2.pbm $ /opt/src/Python-3.10.1/bin/python3 simple.py 200 > out3.pbm $ cmp out2.pbm out3.pbm out2.pbm out3.pbm differ: byte 304, line 3 The python2 output ...
user avatar
  • 2,477
0votes
2answers
56views

TypeError: Menus.__init__() takes 1 positional argument but 2 were given

I'm shucked at his error TypeError: Menus.__init__() takes 1 positional argument but 2 were given any one please help me to solve his error main file: --> from tkinter import * from meanu_items ...
user avatar
-5votes
0answers
23views

How to access regular expression library in python? [closed]

I tried using this import regex it didn't work
user avatar
0votes
0answers
23views

Tkinter Scrollable Text, the slider doesn't appear

I'm try to create scroll bar in "notepad(Program name)" but when i run my program it don't show scrollbar in window ....................................................................... ......
user avatar
0votes
1answer
14views

chrome work normal but firefox get me this erorr

webdriver.firefox() Traceback (most recent call last): File "<pyshell#5>", line 1, in webdriver.firefox() TypeError: 'module' object is not callable
user avatar
-2votes
2answers
33views

Getting type error TypeError: a bytes-like object is required, not 'str

def escape_characters(message): for escape in ESCAPE_TTS_CHARACTERS: message = message.replace(escape, "\\"+escape) for escape in ESCAPE_EDI_CHARACTERS: message = ...
user avatar
0votes
0answers
12views

Dynamic HTTPImport with Dynamic From "X" Import "Y" in Python

I'm importing modules into memory from a URL and throws it into the RAM using httpimport. Consider the code: url = '..........' with httpimport.remote_repo(['myModels'], url): from myModels....
user avatar
  • 19.8k
0votes
1answer
31views

find number of places an alphabet to be shifted to make it alaphabetical order in python

Here let us consider a string 'images' original string is str = 'images' alphabetical order is str = 'aegims' to get this alphabetical order we shifted 'a' two places forward (i.e a) and 'e' to three ...
user avatar
0votes
0answers
25views

Purge backup older than 14 days python

I have a python code which is connected to jenkins now I have to purge those jenkins_backup which are older than 14 days. I tried this and I am getting output while testing with local system but it is ...
user avatar
-1votes
0answers
17views

So i tried this matlpotlib code but it's showing error. I think because of the csv file which is not showing the column name [closed]

So i tried this code but it's showing errorenter image description here enter image description here
user avatar
-1votes
1answer
32views

NameError: name 'still_guessing' is not defined [closed]

I am new to python and stackoverflow generally. I am using Python 3.10.0 Can anyone, someone tell me what I am doing wrong here: def check_guess(guess, still_guessing): global score ...
user avatar
  • 7
-3votes
1answer
27views

python else statement invalid syntax [closed]

I am new to python. I was unable to identify the invalid syntax at ELSE statement in my code but running code throws the invalid syntax error. My else statement is inline with IF statement. if the IF ...
user avatar
  • 5
1vote
1answer
45views

How to add Python Interpreter to PyCharm?

I followed a lot suggestions to add the interpreter to PyCharm, but they're simply not working. I want to figure out what the exact problem is here. First, it said no interpreter is found, so I tried ...
user avatar
0votes
1answer
33views

How to solve AttributeError: 'module' object has no attribute 'ABC'

I am a bit new to Linux but I am having an issue with my recently installed package Frida. It worked fine until yesterday when I installed fridump as well. When I try to use Frida I am getting this: ...
user avatar
  • 21
-1votes
0answers
15views

Fix this python code for creating multiple triggers for lambda function

import json3 def lambda_handler(event, context): client1 = boto3.client('lambda') client = boto3.client( 's3', aws_access_key_id='access key', ...
user avatar
-1votes
0answers
25views

Not able to run given program

I am very new in the programming and running codes. Please help me to run the following code. The given code is written in python 2 and use pymc also, so I have converted it to python 3 using the &...
user avatar
0votes
1answer
16views

Lambda Python3.8 urllib2

I'm trying to migrate a working lambda running from python2.7 code python3.8. However I noticed urllib2 seems to be no longer supported on latest python3? May I ask if you guys also encountered this ...
user avatar
  • 383
0votes
0answers
8views

Python flask group logs for all function which below to same API request [duplicate]

Before marking my question closed please help me how I can use below url solution in mine. I went through this link What is the g object in this Flask code? but I am not sure how I can use this. I am ...
user avatar
  • 215
0votes
0answers
21views

Python flask group logs for different function which are called from same API request [duplicate]

I am working on python flask and I am creating logs for my application. I want to acheive something like when a api call is been made it should log to console. Also all the functions which are called ...
user avatar
  • 215
0votes
2answers
24views

calculation of measures of descriptive statistics

In this program you CANNOT USE python libraries (pandas, numpy, etc), nor python functions (sum, etc). Fulfilling all this, I would like to know how I could calculate these measures of my quantitative ...
user avatar
0votes
0answers
43views

Reading from a csv file Python [duplicate]

I have a file with this data: id,nb,lat,lng,totbs 0,901,48.892795924112306,2.391225227186182,20 1,903,48.83713368945151,2.374340554605615,20 2,904,48.85213620522547,2.301961227213259,30 3,905,48....
user avatar
0votes
0answers
31views

How can I fix IndexError: invalid index to scalar variable

I am trying to convert cartesian to spherical coordinates and following is my code. I am getting the error IndexError: invalid index to scalar variable when it's trying to calculate ph = math.atan2(-...
user avatar
0votes
0answers
30views

How to load certain portion of file into memory and write it on a file in Python?

I have a csv file which generates dataframe for every second and stores it in it. It will have millions of values. How to load only certain part. Like only first 5 MB. Then next 5 MB in a text file.. ...
user avatar
  • 57
0votes
0answers
22views

NumpyArray => IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed

I'm new to python and I'm trying to use a code I found on a paper to analyze time series data (https://github.com/BML-cbnu/TRACS). The thing is I'm getting troubles to run that code. I'm giving to ...
user avatar
-1votes
1answer
28views

ValueError: Need to specify at least one of 'labels', 'index' or 'columns' on deleting columns using drop() function in pandas dataframe [duplicate]

I have large number of columns in my datasets and there are many columns that have various null values therefore tried to delete all those columns from pandas DataFrame which have null values more ...
user avatar
0votes
0answers
11views

Panda: how to make a vbar in bokeh

my code so far How can i make a vbar in bokeh where on the x-axis the date and on the y-axis the earnings that is summed for that date?
user avatar
  • 3
0votes
2answers
41views

Pandas: how to add each row of a column the value with each other

csv file with for each date the earning In the image you see a csv file, I want to add for each date, in the example 01-01-2020, the earnings of that date witch eachother and also for the other date, ...
user avatar
  • 3
1vote
2answers
46views

How would I go about using the list(element) function? How would you use this function?

I'm a python newbie and am using The Python Bible 7 in 1 written by Florian Dedov to learn. I've been doing well but I've hit a barrier with list functions as described in the book and would like help....
user avatar
  • 21
1vote
1answer
27views

python | start new thread that will impersonate another uid without affecting main thread

I with to create a new thread which will impersonate to another uid, execute a task and finish, while my main thread will keep is original uid all the time. impersonation can easily be achieved by ...
user avatar
  • 3,180
-1votes
2answers
49views

Find an analogue for the Python 2.7 sorting behavior in Python 3.x [duplicate]

In Python 2.7 there was an ability to use the sorted function with a list that contains different types, e.g. string, tuple, integer, like this: some_list = ['a', 'b', 1, ('c', 'd'), [2, 3, 4]] >&...
user avatar
  • 133
0votes
4answers
49views

How do I compare every line of the 1st text file to every line of the 2nd text file in Python?

I have 2 text files named f1 & f2 with 100k lines of names each. I want to compare the first line of f1 with every line of f2, then the second line of f1 with every line of f2, and so on. I ...
user avatar
0votes
1answer
20views

I need to make the gallons of water used 0.8 instead of 99999999.2? This is when c is inputted as the code

code = input("Enter the customer's code:") b_meter = int(input("Enter the customer's beginning meter reading:")) e_meter = int(input("The customer's ending meter reading:"...
user avatar
0votes
0answers
15views

Automate clusterization using python and Excel

Looking for some bright ideas to implement in my tool. Backround : I have created this python tool which would take as input a excel file. Excel file contains data on 4 columns (A-contains Part ...
user avatar
0votes
1answer
28views

Pandas: How to correct time data in pandas data frame to then combine with date column

I have a date and time column in my data, but my time column has times over 24 therefore, in order to use it for analysis, I need to correct it, so I can do some analysis, for those cases I have to ...
user avatar
  • 1,062
-1votes
0answers
15views

I'm confused, how is my test using classes to remove and rename the attribute can be failed?

So, I have some exercises from my mentor. But, I'm confused because my test always failed, then I try to look at the solution and it still failed. I have tried to change the name, and the import of it,...
user avatar
-1votes
1answer
36views

How to migrate Google App Engine from Python2.7 and DataStore to Python3

My website was built using Google AppEngine, DataStore and Python2.7. It’s no longer working This site can’t be reached. I need to migrate to Python3 but I cannot identify which migration guide is ...
user avatar
0votes
1answer
49views

iterating over multiple dictionaries in a list [duplicate]

I am learning python. I have two lists of dictionaries list_1 and list_2. I want to update each dictionary in list_2 with the proper value(s) from the corresponding dictionary from list_1 based on a ...
user avatar
  • 5
-2votes
1answer
62views

check unreachable code in most simple way in python [closed]

I have a python code with is detect any errors in another python code saved in txt file, i did that i can detect magic numbers and more than 3 parameters in the function, and now i have to check un ...
user avatar
0votes
0answers
18views

PyScripter: How i can disable code autocomplete in PyScripter

how I can disable code autocomplete in Pyscripter, an example I don't want the text editor to close the semicolon automatically
user avatar
-2votes
2answers
43views

Is there a python code for tracking all keypresses (getting timeline for each keypress)? [closed]

I am using OpenSesame (which runs on Python) for creating an experiment. I need a code for getting a timeline for each keypress (1, 2, 3, 4, space). For example, key 1 pressed at 12223ms, key 3 at ...
user avatar
  • 3
0votes
1answer
36views

storing all function body from txt file in dictionary in python

I'm trying to do code analyzer app and i have a txt file that contains a python code and my goal now is to save all functions in this txt file in dictionary in the class, but i don't have any idea how ...
user avatar
0votes
3answers
43views

how to remove item from list with children

I am currently working on python and I am relatively new to this so I have a list 'D' D = { 'Dunwich': ['Blaxhall', 'Harwich'], 'Blaxhall': ['Dunwich', 'Harwich', 'Feering'], ...
user avatar
-1votes
1answer
56views

Fill in the gaps in the initials function so that it returns the initials of the words contained in the phrase received, in upper case

#original code def initials(phrase): words = phrase.___ result = "" for word in words: result += ___ return ___ print(initials("Universal Serial Bus&...
user avatar
0votes
2answers
46views

Create multiple dictionaries in an efficient way

I have to create more than 10 dictionaries. Is there a more efficient way to create multiple dictionaries using Python's built-in libraries as described below: dict1_1= { "value":100,...
user avatar
0votes
1answer
24views

How do tell "swig -python -py3 myswig.i" not to include annotations

I need to use SWIG to support both Python 2.7 and Python 3.10. [Yes, I know that Python 2.7 is dead, and we're doing our best to migrate users away from it as quickly as we can.] I generate my module ...
user avatar
  • 6,046
1vote
1answer
25views

How to find values that exist in both dataframes using Python?

I have 2 dataframes outlines below df1 columns a b c d df2 columns x y z I want to find all x values that match with c (I do not have an ID to merge these columns)
user avatar
-1votes
0answers
35views

How to group together like elements in a python list?

I have created a code that group's together like elements and sums there values based on a predetermined criteria. My code seems to work for most inputs except for n=1234**5678 with an expected result ...
user avatar
  • 19
0votes
0answers
25views

Webscraping the food menu

I am trying to scrape the daily menu but I get everything else but the menu. I tried to insert everything including "left-div item-name" but that I get NONE. Any idea? from bs4 import ...
user avatar
  • 1

15 30 50 per page
1
2 3 4 5
182