예제 #1
0
# A module is basically a file containing a set of functions to include in your application. There are core python modules, modules you can install using the pip package manager (including Django) as well as custom modules
# pip is like npm in js

# Core modules
import datetime
from datetime import date
from time import time

# Pip module
from camelcase import CamelCase

# Import custom module
import validator
from validator import validate_email

# today = datetime.date.today()
today = date.today()
timestamp = time()

c = CamelCase()
print(c.hump("hello there world"))

email = "test#test.com"
if validate_email(email):
    print("Email is valid")
else:
    print("Email is bad")

print(timestamp)
예제 #2
0
from time import time

timestamp_2 = time()
print(timestamp_2)
'''
pip modules
pip (package manager for python)
pip install --upgrade pip (to update pip)
pip install <module_name> (installs the package globally on your sys)
pip freeze (to check what all is installed in the current scope; scope may be global or a virtual environment)
'''

from camelcase import CamelCase

cc = CamelCase()
print(cc.hump('selena marie gomez'))

# custom model
from validator import validate_email  # (check out validator.py in this folder)

email = '*****@*****.**'
if validate_email(email):
    print('email is valid')
else:
    print('email is not valid')
'''
A module is a single file (or files) that are imported under one import and used. 
e.g. import my_module

A package is a collection of modules in directories that give a package hierarchy.
e.g. from my_package.timing.danger.internets import function_of_love
예제 #3
0
# A file containing a set of functions

# import datetime
from datetime import date
from time import time

# Pip module
from camelcase import CamelCase

c = CamelCase()
print(c.hump("hello there"))

# today = datetime.date.today()
today = date.today()
timestamp = time()

# pip3 install camelcase

# pip3 freeze
"""
appdirs==1.4.4
apturl==0.5.2
...
six==1.11.0
system-service==0.3
systemd-python==234
toml==0.10.1
typed-ast==1.4.1
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
예제 #4
0
from camelcase import CamelCase

c = CamelCase()
s = 'this is a sentence that needs CamelCasing!'
print(c.hump(s))
예제 #5
0
from modulos import saludo, mascotas
from camelcase import CamelCase

print(mascotas)
saludo('Daniel')

c = CamelCase()
s = 'esta oración necesita CamelCase'

camelcased = c.hump(s)
print(camelcased)
예제 #6
0
# Core

from validators import validate_email
from camelcase import CamelCase
import datetime
from datetime import date

import time

today = datetime.date.today()
today = date.today()
print(today)
timestamp = time.time()
# time.sleep(10.0)
print(today)

# pip modules - pip3 install camelcase
# import camelcase
camel = CamelCase()
text = 'hello there peeps'
print(camel.hump(text))


# import from other files
email = 'daniel#devIns.com'

if validate_email(email):
    print('the email is Valid')
else:
    print('email not valid')
import boto3
from camelcase import CamelCase
c = CamelCase()
txt = "hello world"
print(c.hump(txt))
예제 #8
0
# Import a pip module #
from camelcase import CamelCase

# Import a custom module such as the one in the validator.py file #
from validator import validate_email

# Using the imported core module #
today = datetime.date.today()

print(today)

# Using the imported part of the core module #
now = date.today()
timestamp = time()

print(now)
print(timestamp)

# Using the imported pip module #
test = CamelCase()

print(test.hump('hello there world'))

# Using the imported custom module #
email = '*****@*****.**'

if validate_email(email):
    print(f'{email} is a valid email')
else:
    print(f'{email} is not a valid email')
예제 #9
0
# Modules are files containing a set of functions to include in your app. There are core python modules, modules you can install using the pip package manager (including Django)
#as well as custom modules

# Core modules
import datetime
from datetime import date
import time
from time import time

#pip module
from camelcase import CamelCase

# today = datetime.date.today()
today = date.today()
timestamp = time()

c = CamelCase()
print(c.hump('hello there world'))

print(timestamp)
예제 #10
0
# modules contain set of functions to include in your apps

# Core modules - look online for other functions
import datetime
# from datetime import date # import only date
# could use today = date.today()
import time

# Pip module
from camelcase import CamelCase

# import custom module
from validator import validate_email

today = datetime.date.today()
timestamp = time.time()  # in seconds
print(timestamp)

# installing from pip modules
#> pip3 install 'modulename'
#> pip3 freeze                      # show installed pip modules
c = CamelCase()
print(c.hump('hello there world'))  #> Hello There World

# custom modules
email = '*****@*****.**'
if validate_email(email):
    print('Email valid!')
else:
    print('Email not valid!')
예제 #11
0
# A module is basically a file containing a set of functions to include in your application.
# There are core python modules, modules you can install using the pip package manager as well as custom modules

# import datetime
from datetime import date

from camelcase import CamelCase

today = date.today()
print(today)

c = CamelCase()
print(c.hump("this is a camel case string"))
예제 #12
0
from modulos import saludo , mascotas                   # funcion muy importante para repartir codigo en diferentes sectores de la aplicacion
from camelcase import CamelCase


 #Instalando y probando el modulo CamelCase
 #pip install camelcase
 #desinstalando un modulo
 #pip uninstall camelcase

saludo('Abel')

c = CamelCase()
s = "esta oracion necesita CamelCase"

camelcase = c.hump(s)

print(camelcase)
예제 #13
0
# or
from time import time

#import custom module from validator.py file
import validator
from validator import validate_email

# Pip module
from camelcase import CamelCase

today = date.today()
# timestamp = time.time()
timestamp = time()
# today = datetime.date.today()

#Makes every word start with an uppercase
c = CamelCase()

#validator email from validator.py
email = '*****@*****.**'
if validate_email(email):
    print('Email is valid')
else:
    print('Email is muy mal')

print(today)
print(timestamp)
# converts words first letter to uppercase # Hello There Big World Of Python from camelcase pip
print(c.hump('hello there big world of python'))

# installing pip3 install camelcase
예제 #14
0
from camelcase import CamelCase

camello = CamelCase('texto')
texto = "este texto lo vamos a convertir"
print(camello.hump(texto))
예제 #15
0
import datetime
from datetime import date  #to import only date
import time
from time import time

#pip module
from camelcase import CamelCase

#import custom module

import validator
from validator import validate_email

today = date.today()
print(today)

timestamp = time()
print(timestamp)

# pip is the package manager of python
# to install something with pip type pip install package name
# When using a environment you can do pipenv to install locally to an environment

c = CamelCase()
print(c.hump('hello world'))
email = 'test1test.com'
if (validate_email(email)):
    print('valid email')
else:
    print('in-valid email')
예제 #16
0
# A module is basically a file containing a set of functions to include in your application. There are core python modules, modules you can install using the pip package manager (including Django) as well as custom modules

# core modules
# import datetime # importing the whole module
from datetime import date  # importing ony needed funcitons from the module.
from time import time

# pip modules
from camelcase import CamelCase

# custom modules
from validator import validate_email

# print(date.today())

# for i in range(0,1000):
#     print(f'Time is {time()}')

c = CamelCase()

print(c.hump('Hello sweetheart'))

print(validate_email('*****@*****.**'))