Category "python-2.7"

Unused import statement 'import config' Pycharm

class Bot: @staticmethod def token(): telegramtoken = '...' return telegramtoken @staticmethod def executar(): import

How to update key values by append the existing one for the record in MongoDb collection

I have a Collection allRecords as {'name':'tom', 'subjects':'Physics'} {'name':'jerry', 'subjects':'Maths'} I have one json file is testData.json as {names:",t

how to code a right sibling left child tree

im super stuck on my assignment i have found a code to make a basic version of this tree but i have no idea how its works. Can someone pls help explain how it w

Compare 2 csv files and remove the common lines from 1st file | python

I want to compare 2 csv files master.csv and exclude.csv and remove all the matching lines based on column1 and write the final output in mater.csv file. master

Error tokenizing remove pattern re.findall

I have error like this while cleaning text, i just tried to following code from web def remove_pattern(text, pattern): r = re.findall(pattern, text) fo

How would I call a function by using a dictionary?

I recently found some code that calls a function from a different directory like this: modules["module_name"].function(parameters) Then I had a thought about c

How to fix "EOF when reading a line" using plugin Python-Notepad++

I'm using python plugin in Notepad++ and trying to use input() in a script I get this error >>> name=input() Traceback (most recent call last): File "&

Redirect URI mismatch , why?

Following the directions here using latest/last python 2.7: https://github.com/youtube/api-samples/tree/master/python For the https://github.com/youtube/api-sam

Problem in performing peak calling with macs2

I am trying to install the WACS algorithm which is an extension of macs2 callpeak (available on software page of Perkinslab). In the process, I created a new co

Invalid syntax error using Requests library with Python 2.7

I'm using the Requests library with Python 2.7 and get the following error: Traceback (most recent call last): File "/home/user/Documents/workspaces/controlle

Detection and classification of objects placed in front of a video camera

Through this code, I aim to detect an object in real-time that will be put in front of the video camera and classify it. My reasoning is the following I tried t

Can't migrate after makemigrations on django

everyone. I newbie in this field. So, After I finished makemigrations. then I migrate this error code occurs. I try to solve it but still stuck. please guide, I

My Kali linux showing 'No module named importlib' 'from importlib import import_module'

Trying to install build dependencies with pip which is installing in /usr/local/lib/python2.7/dist-packages As I try to install proceed gives an error Collectin

CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team

I'm getting this error: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/crypto.py:14: CryptographyDeprecationWarning: Python

How to create ratios using value counts and separate fields in Python?

Using the data frame shown below I'd like to create manager to assistant and manager to associate percentages/ ratios based/ per location. I'm looking for the

How to import other Python files

I have this file, abc.py: def asb(): print("Hello, ") def xyz(): print("World!") In my main.py file, from abc import asb from abc import xyz I want

Run a UNIX script to use different versions of python

I have a UNIX script which is used to initialize the environment and properties of the project. It uses python. I had to refer the path. This will be used as a

Zipping a list of folders with Python

everyone. I'm really new to Python, so I need some help here. I have a list of folders names inside a .CSV file. All these folders are inside the same path. I n

input() error - NameError: name '...' is not defined

I am getting an error when I try to run this simple script: input_variable = input("Enter your name: ") print("your name is" + input_variable) Let's say I type

Need to add row above the headers of Dataframe in pandas

I have a dataframes, I need to add 8 rows above the header of dataframe, I am sharing dataframe and the desired output Dataframe:- Toll No. Vr.name