This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import first_module | |
print(first_module.temp) | |
first_module.hello() | |
print(my_module.__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(0,5): | |
print(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=0 | |
while i<5: | |
print(i) | |
i=i+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# String input | |
name = input("Enter a name:") | |
# Integer input | |
no1 = int(input("Enter a number:")) | |
# Decimal input | |
no2 = int(input("Enter a decimal number:")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code for disabling space feature | |
print('z','o','h','o',sep='') # zoho | |
# For formatting a date | |
print('23','09','2018',sep='-') # 23-09-2018 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('c','a',end='') | |
print('t') | |
# Output: cat | |
# n provides new line after printing the year | |
print('23','09',sep='-',end='-2018n') | |
# 23-09-2018 | |
print("tom","cruise",sep='',end='@') | |
print("gmail.com") | |
#[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/',endpoint='index') | |
def index(): | |
return "<h1>Hello world! We are using Flask!</h1>" | |
if __name__ == "__main__": | |
app.run(host="0.0.0.0",port=5000,debug=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here we are creating an image for python alphine image.(https://hub.docker.com/r/library/python/) | |
FROM python:3 | |
# Copying the requirements.txt first to leverage Docker cache | |
COPY ./requirements.txt /app/requirements.txt | |
# WORKDIR is nothing but current directory (cd app) | |
WORKDIR /app | |
# Install the requirements in the current directory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id":"5", | |
"name":"Barot Bellingham", | |
"shortname":"Barot_Bellingham", | |
"reknown":"Royal Academy of Painting and Sculpture", | |
"bio":"Barot has just finished" | |
}, | |
{ | |
"id":"6", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
elasticsearch: | |
image: "elasticsearch:5" | |
networks: | |
- frontend | |
restart: always | |
volumes: | |
- ./ES_DATA:/usr/share/elasticsearch/data | |
environment: |