Latest questions in Python

0 votes
1 answer

Need help bootstrapping Python module installation on Amazon EMR

Hello! The easiest way to definitely do this ...READ MORE

Feb 11, 2019 in Python by Nymeria
• 3,560 points
2,377 views
0 votes
1 answer

How to access different Anaconda environments from PyCharm for coding in Python?

Hi! In PyCharm, you can add any number ...READ MORE

Feb 11, 2019 in Python by Nymeria
• 3,560 points
1,226 views
0 votes
1 answer

How to solve indentation in the below code?

Python does not use brackets, it uses ...READ MORE

Feb 9, 2019 in Python by Omkar
• 69,230 points
525 views
0 votes
1 answer

Python program to read the excel file which contains more than 65K records

Hi @Rashmi! I read your code and there ...READ MORE

Feb 9, 2019 in Python by Omkar
• 69,230 points
1,065 views
0 votes
1 answer

Python convert all sheets of excel to csv

You will have to parse through the ...READ MORE

Feb 9, 2019 in Python by Omkar
• 69,230 points
7,035 views
0 votes
1 answer

Python TypeError: 'list' object is not callable.

The error says the list is not ...READ MORE

Feb 9, 2019 in Python by Omkar
• 69,230 points
28,811 views
+1 vote
2 answers

Python convert XLS and XLSX file to csv

XLSX tables are usually created in MS ...READ MORE

Aug 30, 2019 in Python by Mian Tanzeel
17,414 views
+1 vote
2 answers

Python convert extracted excel file to csv

Some services require table data in CSV ...READ MORE

Aug 30, 2019 in Python by Mian Tanzeel
6,587 views
–1 vote
1 answer

Python convert excel file to csv

Here you go: import glob path_to_excel_files = glob.glob('path/to/excel/files/*.xlsx') for ...READ MORE

Feb 8, 2019 in Python by Omkar
• 69,230 points
984 views
0 votes
1 answer

How to get base class type in Python?

Yes, There is an alternative. You can ...READ MORE

Feb 8, 2019 in Python by SDeb
• 13,300 points
1,843 views
0 votes
1 answer

Python command line 'file input stream'

You can use argparse to create an ...READ MORE

Feb 8, 2019 in Python by SDeb
• 13,300 points
1,578 views
0 votes
1 answer

Why are dictionary objects unhashable in Python?

Hi, it is not possible to hash ...READ MORE

Feb 8, 2019 in Python by Nymeria
• 3,560 points
491 views
0 votes
1 answer

How can I make use of getopt or optarg in Python?

Hi, I was asked this by one ...READ MORE

Feb 8, 2019 in Python by Nymeria
• 3,560 points
982 views
0 votes
1 answer

Regarding pyc file in Python

When you run a Python script, Python ...READ MORE

Feb 7, 2019 in Python by Yogi
1,439 views
0 votes
1 answer

Permission denied for .pyc file

Did you run the python script as ...READ MORE

Feb 7, 2019 in Python by Omkar
• 69,230 points
5,099 views
0 votes
1 answer

What is the purpose of inner class in Python?

Advantages of inner class: Logical grouping of classes: ...READ MORE

Feb 7, 2019 in Python by SDeb
• 13,300 points
2,030 views
0 votes
1 answer

Circular buffer in Python

You can use collections.deque with a maxlen ...READ MORE

Feb 7, 2019 in Python by SDeb
• 13,300 points
1,680 views
0 votes
1 answer

How to zip with a list output in Python instead of a tuple output?

Good question - Considering that you are ...READ MORE

Feb 7, 2019 in Python by Nymeria
• 3,560 points
1,440 views
+1 vote
1 answer

How do I find out the sum of digits of a number in Python?

Hi, good question. If you are considering ...READ MORE

Feb 7, 2019 in Python by Nymeria
• 3,560 points
7,744 views
0 votes
1 answer

Multi-threading program in python

import threading import os def task1(): print("Task 1 assigned ...READ MORE

Feb 7, 2019 in Python by Omkar
• 69,230 points
578 views
0 votes
1 answer

Convert the keys of a dictionary to list

Unpacking with * works with any object ...READ MORE

Feb 7, 2019 in Python by Omkar
• 69,230 points
344 views
0 votes
1 answer

Print a list in both ascending and descending order

You can use listName.sort(reverse=True). This will sort the ...READ MORE

Feb 7, 2019 in Python by Omkar
• 69,230 points
1,392 views
0 votes
2 answers

Difference between sort and sorted

when to use which? Use list.sort when you ...READ MORE

Mar 26, 2020 in Python by rahul
• 360 points
4,395 views
0 votes
1 answer

How can I lookup hostname using the IP address with a timeout in Python?

Good question. I actually was stuck with ...READ MORE

Feb 6, 2019 in Python by Nymeria
• 3,560 points
2,264 views
0 votes
1 answer

How can I read numbers in Python from a custom file?

Hi, good question. Let us first assume that ...READ MORE

Feb 6, 2019 in Python by Nymeria
• 3,560 points
880 views
0 votes
0 answers
0 votes
1 answer

Convert HTML to an image in Python

webkit2png. The original version is OSX-only, but luckily ...READ MORE

Feb 5, 2019 in Python by SDeb
• 13,300 points
17,381 views
0 votes
1 answer

How can i combine flask and nameko?

You absolutely can use nameko and Flask together.  In that ...READ MORE

Feb 5, 2019 in Python by SDeb
• 13,300 points
1,273 views
0 votes
1 answer

How to set a random seed for prn generation?

The main python module that is run ...READ MORE

Feb 4, 2019 in Python by charlie_brown
• 7,720 points
564 views
0 votes
1 answer

What is the process to kill a particular thread in python?

A multiprocessing.Process can p.terminate() In the cases where I want to ...READ MORE

Feb 4, 2019 in Python by charlie_brown
• 7,720 points
3,501 views
0 votes
1 answer

How to get path with filename in python?

There is no direct way to get ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,230 points
3,375 views
0 votes
1 answer

How to list only text files in a directory using python?

Well, you are using a complex way. ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,230 points
2,468 views
0 votes
1 answer

How to get absolute path in python?

Instead of using os.path.dirname method which returns the relative ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,230 points
7,616 views
0 votes
1 answer

How to list only files in a directory?

Before printing, you can use a check ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,230 points
440 views
0 votes
1 answer

How to list files/directories in python

You can use the os module to list the ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,230 points
577 views
0 votes
1 answer

How can I run terminal commands in python?

You can use the subprocess or os module to do this. Using ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,230 points
974 views
0 votes
1 answer

How to add integer to python array?

You have defined a numpy array but ...READ MORE

Feb 4, 2019 in Python by Omkar
• 69,230 points
5,162 views
0 votes
1 answer

Python AST with preserved comments

The ast module doesn't include comments. The ...READ MORE

Feb 2, 2019 in Python by SDeb
• 13,300 points
1,299 views
0 votes
1 answer

Weird closure behavior in python

Closures don't refer to variables but rather ...READ MORE

Feb 2, 2019 in Python by SDeb
• 13,300 points
599 views
0 votes
1 answer

Not able to take input in python

You are using python 2 in which ...READ MORE

Jan 31, 2019 in Python by Omkar
• 69,230 points
3,341 views
0 votes
1 answer

Need a python script to login into a website but username and password are in a txt file (Selenium automation script)

I had a similar requirement. I had ...READ MORE

Jan 31, 2019 in Python by Omkar
• 69,230 points
7,950 views
+1 vote
2 answers

python nmap can't find PortScanner attribute

you want install        1.pip uninstall nmap        2.pip install python-nmap in ...READ MORE

Jan 25, 2020 in Python by Rangertech_hacker234
8,205 views
–1 vote
1 answer

nmap.nmap.PortScannerError: 'nmap program was not found in path

python-nmap module used in python happens to use nmap binary ...READ MORE

Jan 30, 2019 in Python by Omkar
• 69,230 points
14,783 views
0 votes
0 answers

'module' object has no attribute 'PortScanner'

I am trying to run nmap in ...READ MORE

Jan 30, 2019 in Python by Karan
1,232 views
0 votes
1 answer

Command 'pip' not found

Seems like python is installed in your ...READ MORE

Jan 30, 2019 in Python by Omkar
• 69,230 points
6,172 views
0 votes
1 answer

How to use an index to get an item?

What you show, ('A','B','C','D','E'), is not a ...READ MORE

Jan 30, 2019 in Python by SDeb
• 13,300 points
400 views
0 votes
1 answer

Shuffling a Word

You can try the following: import random word = ...READ MORE

Jan 30, 2019 in Python by SDeb
• 13,300 points
822 views
0 votes
1 answer

How can I have only positive decimal numbers in Django using Python?

Hi, are you aware of something called ...READ MORE

Jan 30, 2019 in Python by Nymeria
• 3,560 points
5,918 views
0 votes
1 answer

How do I obtain the index list in a NumPy Array of all the NaN values present using Python?

Hi, it is pretty simple, to be ...READ MORE

Jan 30, 2019 in Python by Nymeria
• 3,560 points
16,864 views
0 votes
1 answer

How to find if setuptools is installed in python?

You can use python interpreter to check ...READ MORE

Jan 29, 2019 in Python by Omkar
• 69,230 points
1,740 views