Skip to content

Instantly share code, notes, and snippets.

View dineshsonachalam's full-sized avatar
🌟
Per aspera ad astra

Dinesh Sonachalam dineshsonachalam

🌟
Per aspera ad astra
View GitHub Profile
import first_module
print(first_module.temp)
first_module.hello()
print(my_module.__name__)
for i in range(0,5):
print(i)
i=0
while i<5:
print(i)
i=i+1
# String input
name = input("Enter a name:")
# Integer input
no1 = int(input("Enter a number:"))
# Decimal input
no2 = int(input("Enter a decimal number:"))
# Code for disabling space feature
print('z','o','h','o',sep='') # zoho
# For formatting a date
print('23','09','2018',sep='-') # 23-09-2018
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]
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)
# 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.
@dineshsonachalam
dineshsonachalam / data.json
Last active December 9, 2018 14:20 — forked from planetoftheweb/data.json
JSON file for artists
[
{
"id":"5",
"name":"Barot Bellingham",
"shortname":"Barot_Bellingham",
"reknown":"Royal Academy of Painting and Sculpture",
"bio":"Barot has just finished"
},
{
"id":"6",
@dineshsonachalam
dineshsonachalam / DockerFile
Created January 15, 2019 14:00
Elastic Search docker-compose file
version: '3'
services:
elasticsearch:
image: "elasticsearch:5"
networks:
- frontend
restart: always
volumes:
- ./ES_DATA:/usr/share/elasticsearch/data
environment: