Most viewed questions in Python

0 votes
1 answer

__init__ and self in python

The self variable represents an instance of ...READ MORE

Sep 18, 2018 in Python by SayantiniDeb
• 200 points
719 views
0 votes
0 answers
0 votes
0 answers

What does NameError: name 'withdrawal' is not defined mean ?

READ MORE

Jun 6, 2020 in Python by Shanice
• 120 points

recategorized Jun 8, 2020 by Gitika 717 views
0 votes
1 answer

How to install bottle in python?

You can install bottle on python using ...READ MORE

Aug 19, 2019 in Python by Mohammad
• 3,230 points
717 views
0 votes
1 answer

How can I deal with python eggs for multiple platforms in one location?

Try virtualenv : http://pypi.python.org/pypi/virtualenv This helps you create isolated ...READ MORE

May 28, 2019 in Python by SDeb
• 13,300 points
716 views
+1 vote
1 answer

How can I reverse list in Python?

Reversing a list is a commonly used ...READ MORE

May 13, 2019 in Python by Taj
• 1,080 points
716 views
0 votes
1 answer

how do i print only the last two letters in a string using regular expression in python?

$ to match the end of the ...READ MORE

Mar 15, 2019 in Python by Waseem
• 4,540 points
716 views
0 votes
1 answer

how do i get anova table of split plot design or factorial experimental design in python?

Hello @ kapil, For your query you can refer ...READ MORE

Aug 24, 2020 in Python by Niroj
• 82,880 points
715 views
0 votes
1 answer

Re-order XML for HTML printing

You don't have a template matching tabularQueryResult in your ...READ MORE

Oct 8, 2018 in Python by Priyaj
• 58,090 points
715 views
0 votes
1 answer

Create and open a file in Python

file = open('text.txt', 'w+) READ MORE

May 24, 2018 in Python by Nietzsche's daemon
• 4,260 points
715 views
0 votes
1 answer

Python join: why is it string.join(list) instead of list.join(string)?

950down voteaccepted It's because any iterable can be ...READ MORE

May 15, 2018 in Python by aryya
• 7,450 points
715 views
0 votes
1 answer

Error: 'int' object is not subscriptable - Python

int([x[age1]]) You are attempting to access the age1 index ...READ MORE

Feb 16, 2023 in Python by Rishu
• 300 points
714 views
0 votes
0 answers

i want to ask that how can i run one file of python in another file in jupyter notebook

motion_detection.ipynb # Python program to implement # Webcam ...READ MORE

Dec 16, 2020 in Python by Ramsha
• 120 points
714 views
0 votes
1 answer

What is the purpose of hash function in python?

The hash() method returns the hash value of an object if it ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
712 views
0 votes
1 answer

site.py deleted

You can download a new copy from ...READ MORE

Nov 29, 2018 in Python by SDeb
• 13,300 points
712 views
0 votes
1 answer

What's the canonical way to check for type in Python?

To check if o is an instance ...READ MORE

Aug 24, 2018 in Python by Priyaj
• 58,090 points
711 views
0 votes
1 answer

Map function with example in python

The map function executes the function_object for each ...READ MORE

May 23, 2019 in Python by Imran
710 views
0 votes
1 answer

__all__ in python

That is the list of public objects ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
710 views
+1 vote
2 answers

View onto a numpy array?

 just index it as you normally would. ...READ MORE

Oct 18, 2018 in Python by roberto
709 views
0 votes
1 answer

How to set up a PostgreSQL database in Django?

Hello @kartik, Steps that I use: - sudo apt-get ...READ MORE

Jun 30, 2020 in Python by Niroj
• 82,880 points
708 views
0 votes
1 answer

What are the python libraries that can be used to perform web scraping in python?

for web scraping in python we can ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
708 views
0 votes
1 answer

How to install django 1.4?

This can be done by using this ...READ MORE

Jul 11, 2019 in Python by SDeb
• 13,300 points
708 views
0 votes
2 answers

Help me solve the code

The fetchone() method fetches the result of ...READ MORE

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

Break for loop in an if statement

You'll need to break out of each ...READ MORE

Oct 23, 2018 in Python by SDeb
• 13,300 points
707 views
0 votes
0 answers

how to solve this

from nsepy import get_history from datetime import date import ...READ MORE

Dec 12, 2020 in Python by Pawan
• 120 points
706 views
0 votes
0 answers
0 votes
1 answer

Install .desktop file with setup.py

This looks like a good approach but ...READ MORE

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

How to get textual output when using exceptions in Python?

Hi, the answer is pretty simple.  Without the ...READ MORE

Jan 17, 2019 in Python by Nymeria
• 3,560 points
705 views
0 votes
1 answer

What is the difference between visual studio and idle in python programming??

Both are actually IDE-s I don't know ...READ MORE

Oct 16, 2020 in Python by Gitika
• 65,910 points
704 views
0 votes
2 answers

How to lock a thread in Python?

Lock objects can release the lock at ...READ MORE

Jul 23, 2020 in Python by sahil
• 580 points
704 views
0 votes
1 answer

print the random list's item index number in python

Hey @Alia, you can use a python ...READ MORE

May 28, 2019 in Python by Patrick
704 views
0 votes
1 answer

What is setup.py in Python?

Suppose you want to install a module ...READ MORE

Jul 10, 2019 in Python by Neel
• 3,020 points
703 views
0 votes
1 answer

Best way to create a simple python web service

web.py is probably the simplest web framework ...READ MORE

Jul 20, 2018 in Python by Priyaj
• 58,090 points
703 views
0 votes
1 answer

How to Remove specific characters from a string in Python?

Strings in Python are immutable (can't be changed). Because ...READ MORE

Jan 5, 2021 in Python by Gitika
• 65,910 points
702 views
0 votes
1 answer

What is abs in Python?

The abs() method returns the absolute value ...READ MORE

Jul 16, 2019 in Python by Arvind
• 3,040 points
702 views
0 votes
2 answers

Indentation Error in Python

Use tabs instead of spaces. This is ...READ MORE

Feb 15, 2019 in Python by Shashank
• 1,370 points
702 views
0 votes
1 answer

Check if a given key already exists in a dictionary?

in is the intended way to test for ...READ MORE

Nov 26, 2020 in Python by Gitika
• 65,910 points
701 views
0 votes
1 answer

How to stop input in SublimeREPL?

You have to do ctrl+break or ctrl+space ...READ MORE

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

How do I merge two dictionaries in a single expression in Python?

Hello, For dictionaries x and y, z becomes a shallowly merged dictionary with ...READ MORE

Apr 13, 2020 in Python by Niroj
• 82,880 points
700 views
0 votes
1 answer

How to generate all permutations of a list?

Hello @kartik, Try this: def permutations(head, tail=''): ...READ MORE

Nov 17, 2020 in Python by Niroj
• 82,880 points
697 views
0 votes
2 answers

How to declare constants in python?

In python we don't require to declare ...READ MORE

Aug 18, 2019 in Python by anonymous
• 460 points
697 views
0 votes
1 answer

How to find all occurrences of a substring?

There is no simple built-in string function ...READ MORE

Nov 25, 2020 in Python by Gitika
• 65,910 points
696 views
0 votes
1 answer

How to a write reg expression that confirms an email id using the python reg expression module “re”?

Hey, @Roshni, Python has a regular expression module ...READ MORE

Jun 26, 2020 in Python by Gitika
• 65,910 points
696 views
0 votes
1 answer

How to manage local vs production settings in Django?

Hello @kartik, In settings.py: try: from local_settings ...READ MORE

Jun 22, 2020 in Python by Niroj
• 82,880 points
695 views
0 votes
1 answer

How to crop face from a photo using cv2 in python?

Hi@akhtar, You can do this task using cv2 ...READ MORE

Apr 9, 2020 in Python by MD
• 95,440 points
695 views
0 votes
1 answer

Select more than one item randomly from the list

You can use random.sample() function in the ...READ MORE

May 28, 2019 in Python by Yesha
695 views
0 votes
1 answer

What does the operator "/=" do in python?

x = 20 res = x /= 5 print(res) The ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
694 views
0 votes
2 answers

difference between class and instance attributes

Apart from the performance, there is a ...READ MORE

Sep 17, 2018 in Python by SDeb
• 13,300 points
694 views
0 votes
1 answer

How do you break out of a while loop in python?

Usually the execution moves out of the ...READ MORE

Aug 2, 2019 in Python by Mohammad
• 3,230 points
692 views
0 votes
1 answer

Python Null Object

Use the 'None' keyword to denote the ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
692 views