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
/etc/init.d/apache2 start | |
/etc/init.d/apache2 stop | |
/etc/init.d/apache2 restart | |
sudo systemctl restart apache2 |
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
# 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']! |
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
# 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} |
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
# 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() |
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 tkinter import * | |
root = Tk() | |
e = Entry(root, width=63) | |
e.pack() | |
e.focus_set() | |
######### | |
diccionario = { | |
'identificador' : 1, | |
'nombre' : 'Leandro', |
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 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() |
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 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() |
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 random | |
from tkinter import * | |
root = Tk() | |
e = Entry(root) | |
e.pack() | |
e.focus_set() | |
######### | |
a = 5 | |
b = "2" |
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 tkinter import * | |
root = Tk() | |
e = Entry(root) | |
e.pack() | |
e.focus_set() | |
######### | |
a = 5 | |
b = "2" | |
c = str(a) + b |
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 tkinter import * | |
root = Tk() | |
e = Entry(root) | |
e.pack() | |
e.focus_set() | |
######### | |
a = 5 | |
b = "2" | |
c = a + int(b) |