Trending questions in Python

0 votes
1 answer

How to create and read from a temporary file in Python?

Hi, there is a very simple solution ...READ MORE

Jan 29, 2019 in Python by Nymeria
• 3,560 points
2,097 views
+1 vote
2 answers

Best Python Programming Courses

you can also check letsfindcourse  for best ...READ MORE

May 15, 2019 in Python by anonymous
888 views
0 votes
1 answer

Graphviz vs PyGraphViz

graphviz is lightweight library which calls graphviz ...READ MORE

Jan 9, 2019 in Python by ana1504.k
• 7,910 points
2,932 views
0 votes
1 answer

Signed angle between vectors

If you have an atan2() function in ...READ MORE

Dec 11, 2018 in Python by SDeb
• 13,300 points
4,119 views
0 votes
2 answers

How to add a certain time delay to the code using Python?

You can use time.sleep(duration in second) READ MORE

Feb 14, 2019 in Python by Shashank
• 1,370 points
1,265 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,433 views
0 votes
1 answer

How can I differentiate between column vectors and row vectors using Python?

Hi, good question. What you can do ...READ MORE

Jan 23, 2019 in Python by Nymeria
• 3,560 points
2,208 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,220 points
1,577 views
0 votes
1 answer

How to create a GUID/UUID in Python

The uuid module, in Python 2.5 and ...READ MORE

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

Best way to open a socket in Python

Opening sockets in python is pretty simple. ...READ MORE

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

Need help checking the validity of an image file in Python

I went through the Python documentation and ...READ MORE

Jan 18, 2019 in Python by Nymeria
• 3,560 points
2,341 views
0 votes
1 answer

Debug Pylons application through eclipse

First you can create a new launch ...READ MORE

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

What is the equivalent of NotImplementedError using Python?

Hi, good question! One simple answer to your ...READ MORE

Jan 17, 2019 in Python by Nymeria
• 3,560 points
2,360 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,220 points
1,371 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
1,381 views
0 votes
1 answer

How to increase plt.title font size?

Try the following : import matplotlib.pyplot as plt plt.figtext(.5,.9,'Temperature', ...READ MORE

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

Is there a Python equivalent to `perl -pi -e`?

The command line usage from 'python -h' ...READ MORE

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

How to print a message or the error if a file is not found?

To print the message that file is not ...READ MORE

Jan 2, 2019 in Python by Omkar
• 69,220 points
2,918 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,587 views
0 votes
1 answer

Shorter way to write a Python for loop

You can use the enumerate iterator: for i, ...READ MORE

Jan 17, 2019 in Python by SDeb
• 13,300 points
2,240 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,220 points
1,315 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,442 views
–1 vote
1 answer

Pyspark rdd How to get partition number in output ?

The glom function is what you are looking for: glom(self): ...READ MORE

Jan 8, 2019 in Python by Omkar
• 69,220 points
2,646 views
0 votes
1 answer

What is .pydistutils.cfg?

I don't immediately see a reason why ...READ MORE

Jan 21, 2019 in Python by SDeb
• 13,300 points
2,028 views
0 votes
1 answer

error while installing pyautoit

Hi @reddy!  According to the Python Documentation, Error code ...READ MORE

Jan 27, 2019 in Python by Omkar
• 69,220 points
1,726 views
0 votes
1 answer

How to enable python3 in vim?

You didn't tell us the platform you're ...READ MORE

Jan 21, 2019 in Python by SDeb
• 13,300 points
1,929 views
+3 votes
1 answer

Tensorflow 1.5 ImportError: No module named tensorflow.python.client

I think it's a bug in Tensorflow ...READ MORE

Sep 25, 2018 in Python by charlie_brown
• 7,720 points
6,981 views
0 votes
1 answer

Embed R code in python

You can try this : from rpy import ...READ MORE

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

Need help with making use of Pluck in Python

Hi, good question. Easy solution to be ...READ MORE

Jan 24, 2019 in Python by Nymeria
• 3,560 points
1,757 views
+1 vote
2 answers

Measuring the distance between pixels on OpenCv with Python

You can try this: Mat pts1(nPts, 1, CV_8UC2), ...READ MORE

Aug 24, 2018 in Python by Omkar
• 69,220 points
10,583 views
0 votes
1 answer

How to upgrade all packages using pip at once?

pip doesn’t have a default command for ...READ MORE

Jan 29, 2019 in Python by Omkar
• 69,220 points
1,503 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
1,176 views
0 votes
0 answers

How can I update Git Code into a Docker container directly?

Hi all, with regard to the above ...READ MORE

Jan 22, 2019 in Python by Anirudh
• 2,090 points
1,857 views
0 votes
1 answer

Path separator char in Python

There is an alternative way. you can ...READ MORE

Jan 4, 2019 in Python by SDeb
• 13,300 points
2,571 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,220 points
1,272 views
0 votes
1 answer

Confusion in Python Pandas code

I have added the explanation of code ...READ MORE

Jan 26, 2019 in Python by Omkar
• 69,220 points
1,661 views
0 votes
1 answer

K-means or Hierarchical clustering?

You can use hierarchical clustering for this ...READ MORE

Feb 14, 2019 in Python by Dinesh
825 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,470 views
0 votes
1 answer

Python inheritance: TypeError: object.__init__() takes no parameters

You are calling the wrong class name ...READ MORE

Nov 15, 2018 in Python by Nymeria
• 3,560 points
4,714 views
0 votes
2 answers

How to calculate square root of a number in python?

calculate square root in python >>> import math ...READ MORE

Apr 2, 2019 in Python by anonymous
5,895 views
0 votes
1 answer

Need help understanding python code

In this particular code, I think you ...READ MORE

Feb 19, 2019 in Python by Omkar
• 69,220 points
536 views
0 votes
2 answers

In List of Dicts, find min() value of a common Dict field

lst = [{'price': 99, 'barcode': '2342355'}, {'price': ...READ MORE

Aug 31, 2018 in Python by Omkar
• 69,220 points
7,951 views
0 votes
1 answer

How can I go about using var == False in Python?

Hi. Simple answer.  All you need to do ...READ MORE

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

Empty while loop in Python

while file.readline().startswith("#"):     pass The pass statement does nothing. It ...READ MORE

Dec 5, 2018 in Python by SDeb
• 13,300 points
3,791 views
+2 votes
1 answer

“OSError: Unable to open file (bad superblock version number)" in python h5py file read

File could indeed be opened on Linux ...READ MORE

Sep 26, 2018 in Python by Priyaj
• 58,020 points
6,700 views
0 votes
1 answer

Problem while using local dynamoDB container (Boto3 put_item error)

DynamoDB does not autogenerate the ID when ...READ MORE

Dec 3, 2018 in Python by charlie_brown
• 7,720 points
3,839 views
0 votes
1 answer

how to read a JSON from a file?

You can use with statement with open('strings.json') as ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,020 points
5,557 views
0 votes
2 answers

Why do we use return statement in python?

def maximum(x, y):     if x > y:     return x     else:    return ...READ MORE

Apr 4, 2019 in Python by anonymous
2,057 views
+6 votes
4 answers

Python and Pygame: Difference

Python is a programming language. PyGame is a ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,020 points
5,173 views
0 votes
1 answer

How to convert string into epoch time?

you are passing the parsed datetime object to ...READ MORE

Sep 22, 2018 in Python by SDeb
• 13,300 points
6,882 views