Python Programming Language

Python Interview Questions: Read Latest interview questions on Python Frameworks like Python Pyramid, Python Flask, CherryPy, Django and more...

  • What are Python dictionaries? How to implement it?
    Python

    Posted By: Ray

  • What are immutable data types?
    Python

    Posted By: Ayesha Badepir

  • What is proprioception?
    Python

    Posted By: Roland

  • How to achieve Multithreading in Python?
    Python

    Posted By: Tolbert

  • What is monkey patching in Python?
    Python

    Posted By: Author

  • What are *args and **kwargs in Python?
    Python

    Posted By: Justus

  • Explain few differences between range & xrange?
    Python

    Posted By: Tilman

  • What is the difference between NumPy and SciPy?
    Python

    Posted By: Prosper

  • What is pickling and unpickling in Python?
    Python

    Posted By: Harmon

  • Explain lambda in Python?
    Python

    Posted By: Stacy

  • How to share global variables across modules in Python?
    Python

    Posted By: Anonymous

  • Enlist some Mutable datatypes in Python?
    Python

    Posted By: S.K.Mahalingam

  • What is difference Between List and Tuple in Python?
    Python

    Posted By: Raman verma

  • What Is The Purpose Of Id() Function In Python?
    Python

    Posted By: Benjamin

  • What Is GIL In Python Language?
    Python

    Posted By: Peter

  • Is Python is Thread Safe? Explain how?
    Python

    Posted By: Ajeet Prajapati

  • What are generators in Python?
    Python

    Posted By: KUMAR KANISHK

  • Explain Decorators in Python?
    Python

    Posted By: Austin

  • What Architecture Django follows ?
    Django

    Posted By: Elbridge

    Django follows model-template-view (MTV) architectural pattern.

  • What is difference between MVT and MVC?
    Django

    Posted By: Roll

  • What are Middlewares? Lists some important Middlewares you have used in Django?
    Django

    Posted By: Harlan

  • What is Decorator? How to write custom decorator in Django ?
    Django

    Posted By: Homer

  • What is the usage of ALLOWED_HOST in Django project settings?
    Django

    Posted By: Shannon

  • What is Inheritance in Models ?
    Django

    Posted By: Rose

  • What are signals in Django?
    Django

    Posted By: Davis

  • When to use the iterator in Django ORM?
    Django

    Posted By: Surakasula Revathi

  • Explain mixins in Django?
    Django

    Posted By: Gordon

  • How to create an Constant in Django?
    Django

    Posted By: Worth

  • What are Class-based views in Django?
    Django

    Posted By: Robertrof

  • How to Configure Database in Django.
    Django

    Posted By: Dandut

  • What constitutes Django templates?
    Django

    Posted By: Bedford

  • What is Flask-WTF?
    Python Flask

    Posted By: Waldo

    Flask-WTF is an inbuilt module of flask framework that provides an extensive way to designing HTML forms in flask web applications.

  • For what python flask is used?
    Python Flask

    Posted By: Jarrett

    Python flask is a web development framework. It can be used for

    1) Creating web services.
    2) Creating websites
    3) Building complex web applications
    4) Creating CRM or shopping websites.
    5) Creating Twitter/Facebook bot

  • How to install python flask on linux?
    Python Flask

    Posted By: Ethel

    pip install flask

  • How to deploy python flask app on Heroku?
    Python Flask

    Posted By: Haridass

  • How to structure python flask project?
    Python Flask

    Posted By: laxmi

  • How to check request is json type in flask?
    Python Flask

    Posted By: WilliamyxVioto

    request.content_type is used to check the request type in Flask. To check request is of json type use if request.content_type == 'application/json':

  • What is Jsonify in flask?
    Python Flask

    Posted By: fernandofarmer

    jsonify() function is used to return flask.Response() object with content-type header 'application/json'.

  • How to change Flask server host/port using config file?
    Python Flask

    Posted By: Cas

  • How to log request body in python flask?
    Python Flask

    Posted By: Bryanblina

    You can take advantage of Flask.before_request hook to log the request body in python flask. Here is an example:

    @app.before_request
    def log_request_info():
        app.logger.debug('Headers: %s', request.headers)
        app.logger.debug('Body: %s', request.get_data())
    

  • How to divide flask app into multiple py files?
    Python Flask

    Posted By: Dixon

  • Is python flask multithreaded?
    Python Flask

    Posted By: brij

    Yes, Flask is multithreaded.

  • How to create an array with checkboxes in Flask?
    Python Flask

    Posted By: Maxwell

  • How to get visitor ip address in Flask?
    Python Flask

    Posted By: Merle

    request.remote_addr is used to get visitor IP address in Flask. Here is an example:

    from flask import request
    from flask import jsonify
    
    @app.route("/get_user_ip", methods=["GET"])
    def get_user_ip():
        return jsonify({'ip': request.remote_addr}), 200
    

  • What is g in python flask?
    Python Flask

    Posted By: S.K.Mahalingam

    Occasionally you might find a situation in which using a global variable is a perfectly reasonable solution to a problem. However, in a Flask app, your code is likely to end up running in an environment with multiple requests being handled at the same time. If you used a normal global variable, one request might modify the global variable and interfere with another request that happens to be executing simultaneously. To avoid that, Flask provides this g object to which you can attach such variables. Each request gets a different g object, so simultaneous requests can't interfere with each other, but you still have the same convenience as a global variable.

    Further Reading: Read More Flask g

  • What is Flask Sijax?
    Python Flask

    Posted By: raghu

    Flask Sijax is Python/jQuery library to perform  Ajax function in Flask.

    You can install Flask-Sijax by using below command

    easy_install flask-sijax
    pip install flask-sijax

  • For what url_for() function is used in Flask?
    Python Flask

    Posted By: Godfrey

    url_for() function in flask is used for generating dynamic URL for a specific function.url_for() accept the name of a function as the first parameter and one or more arguments for the variable part of URL.

  • What is WSGI?
    Python Flask

    Posted By: Aden

  • How to get http headers in flask?
    Python Flask

    Posted By: Larry

  • How to serve static files in Flask?
    Python Flask

    Posted By: Ernest

  • How to get a query string in Flask?
    Python Flask

    Posted By: Larry

  • How to import function into main file in flask?
    Python Flask

    Posted By: Tom

  • How to disable csrf for a view with flask-wft for a restapi?
    Python Flask

    Posted By: James

  • How to share the global app object in flask?
    Python Flask

    Posted By: Esequiel

  • What is the purpose of Flask's context stacks?
    Python Flask

    Posted By: Arvid

  • How to get logged user id in flask?
    Python Flask

    Posted By: Axel

    current_user.get_id() is used to get logged in user id in flask.

    Here is an example:

    from flask import g
    if current_user.is_authenticated():
            g.user = current_user.get_id()
    

  • Define OpenCV?
    Opencv

    Posted By: Unknown

  • Enlist different types of video filters available in OpenCV?
    Opencv

    Posted By: Carter

  • What is use of Mat class in OpenCV?
    Opencv

    Posted By: Tamuna

  • How to read and write an image in OpenCV?
    Opencv

    Posted By: Merton

  • What is use of sobel operation in OpenCV?
    Opencv

    Posted By: AnthonySen

  • Which function is used to draw line in OpenCV?
    Opencv

    Posted By: Abercormlen

  • Where opencv libraries are installed?
    Opencv

    Posted By: Collins

  • What is cv_8uc1 in opencv?
    Opencv

    Posted By: Colonel

  • What is Ansible?
    Ansible

    Posted By: Robertrof

  • What are requirements to instal Ansible Server?
    Ansible

    Posted By: Ernest

  • In which language Ansible is written in?
    Ansible

    Posted By: Hudson

  • What are the advantages of Ansible?
    Ansible

    Posted By: SMK

  • What are different ways to Install Ansible?
    Ansible

    Posted By: Al

  • What is Ansible galaxy?
    Ansible

    Posted By: Rose

  • What is Cowsay in Ansible?
    Ansible

    Posted By: Edd

  • What is Ansible tower?
    Ansible

    Posted By: bculsv

  • What is difference between variable and environment variable?
    Ansible

    Posted By: Osborne

  • What are ad-hoc commands?
    Ansible

    Posted By: King

  • How to create a role in ansible?
    Ansible

    Posted By: Whit

  • What is local action in Ansible?
    Ansible

    Posted By: Vaughn

  • What is callback plugin in Ansible?
    Ansible

    Posted By: Ravi Jaiwasl

  • What is a module in Ansible?
    Ansible

    Posted By: Florence

  • How many types of variables are available in Ansible?
    Ansible

    Posted By: Allan

  • What is an Inventory in Ansible?
    Ansible

    Posted By: Carroll

  • What are Ansible Playbooks?
    Ansible

    Posted By: Eddierot

  • What is CMDB?
    Ansible

    Posted By: Gilbert

  • What is Ansible Task?
    Ansible

    Posted By: MichaeltoX

  • What are Ansible Vaults?
    Ansible

    Posted By: Gerald

  • Explain ask_pass module in Ansible?
    Ansible

    Posted By: Ajith Gumudavelly

  • What is Docker?
    Docker

    Posted By: Salomon

  • Enlist major advantages of using Docker?
    Docker

    Posted By: Lucian

  • Enlist the major components of the Docker?
    Docker

    Posted By: Elder

  • What is Docker Container?
    Docker

    Posted By: Rufus

  • Explain the life-cycle of Docker Container?
    Docker

    Posted By: Elder

  • How is a Docker container different from a hypervisor?
    Docker

    Posted By: Mary

  • What is Docker Image?
    Docker

    Posted By: Anonymous

  • What is memory-swap flag in Docker?
    Docker

    Posted By: Casimiro

  • What is difference between Docker and Virtual Machine?
    Docker

    Posted By: sowmini

  • What is Docker Hub?
    Docker

    Posted By: Katherine

  • What is Docker cloud?
    Docker

    Posted By: Evan

  • What is Docker swarm?
    Docker

    Posted By: Ashby

  • What is a Docker Registry?
    Docker

    Posted By: Mande Amulya

  • What are Docker Objects?
    Docker

    Posted By: Michael

  • List few important commands used in Docker?
    Docker

    Posted By: Carl