Skip to content

Instantly share code, notes, and snippets.

View lfalanga's full-sized avatar
🏠
Working from home.

Leandro Falanga lfalanga

🏠
Working from home.
  • Buenos Aires, Argentina.
View GitHub Profile
/etc/init.d/apache2 start
/etc/init.d/apache2 stop
/etc/init.d/apache2 restart
sudo systemctl restart apache2
# Example 1
x = 1
y = 2
z = ['juan']
print(x, y, z, sep=' ') # 1 2 ['juan']
print(x, y, z, sep=' , ') # 1 , 2 , ['juan']
# Example 2
print(x, y, z, sep=' , ', end='!\n') #1 , 2 , ['juan']!
@lfalanga
lfalanga / sets.py
Last active February 7, 2020 01:51
# Creating set
F = {1, 2, 3, 4, 5, 3}
print(F) # {1, 2, 3, 4, 5}
print(len(F)) # 5
# Creating an empty set
F3 = set()
# Creating Intersection
print(F & F1) # {1, 2, 3, 4}
# Example 1: Writing to a .txt file
my_list = [i ** 2 for i in range(1, 11)]
# Generates a list of squares of the numbers 1 - 10
f = open("output.txt", "w")
for item in my_list:
f.write(str(item) + "\n")
f.close()
from tkinter import *
root = Tk()
e = Entry(root, width=63)
e.pack()
e.focus_set()
#########
diccionario = {
'identificador' : 1,
'nombre' : 'Leandro',
from tkinter import *
root = Tk()
e = Entry(root, width=36)
e.pack()
e.focus_set()
#########
lista = ["bananas", "manzanas"]
a = "Hoy compré %s y %s." % (lista[0], lista[1])
var = IntVar()
from tkinter import *
root = Tk()
e = Entry(root)
e.pack()
e.focus_set()
#########
frutas = ["banana", "manzana", "pera", "limon", "frutilla", "kiwi", "pomelo"]
a = frutas[2]
var = IntVar()
import random
from tkinter import *
root = Tk()
e = Entry(root)
e.pack()
e.focus_set()
#########
a = 5
b = "2"
from tkinter import *
root = Tk()
e = Entry(root)
e.pack()
e.focus_set()
#########
a = 5
b = "2"
c = str(a) + b
from tkinter import *
root = Tk()
e = Entry(root)
e.pack()
e.focus_set()
#########
a = 5
b = "2"
c = a + int(b)