Tag Archives: #mastery14

Mastery14

Creating and using a Python module

A module is a file containing Python definitions and statements. The file name is the module name with the suffix “.py”

Example:

  • Create “hello.py” then write the following function:
def helloworld():
   print "hello"

import hello
hello.helloworld()
>>>'hello'

AWESOME PAGE

14 1014

Creating your own and using C++ libraries #TC1017 #Mastery14

Creating your own and using C++ libraries 1017 14

There are many easy ways I found this 

  1. Create your file  with the name that you want like this “myfirstlibrary.cpp” and “a.h”. Then compile the library without a main program
  2. It will create a file called “a.o”.
  3. Then can your library with  
  4. Compile the program and add the library “a.o”.  

I found also this link for you guys 🙂 

http://stackoverflow.com/questions/4496411/c-how-to-build-my-own-utility-library

Creating your own and using C++ libraries

 

 

Mastery 14

I just did the Mastery 14 video, which is the creation of a module and importing into a code.

Video: http://youtube.com/watch?v=-qApsrxsF4s

14 1014

#Mastery14 – Creating your own and using C++ libraries

Creación y uso de librerias en C++ 

Una de las ventajas de C++ es la facilidad de poder crear tus propias librerias, estas se pueden crear para definir variables con un significado mas especifico.

El ultimo caso que use fue el de la libreria:, esta libreria te permite utilizar el nombre de una variable y darle algun uso segun nuestras necesidades.

Por ejemplo:

GREEN “33[32m” 

PURPLE “33[35m”

BLUE “33[34m” 

 

Para aprender mas acerca de la creación de librerias pueden consultar los siguientes enlaces:

Libreria estatica   Libreria dinamica

 

14 1017

Mastery14

This is my video for Mastery14

https://www.youtube.com/watch?v=UjTTS1bev9k

14

#Mastery14 #TC1014

14 1014

Hello guys. So this is my video explaining how to create and use modules in python.

Youtube link:

https://youtu.be/syp18exl36s

Creating your own and using C++ libraries

As a programmer you’re going to find out that the libraries in C++ are limited, so sometimes you’re going to need to create your own libraries, this is actually very tricky.

Had to look up for some videos, I’m going to leave the links of a couple of them.

https://www.youtube.com/watch?v=DdNfbcsL-28

https://www.youtube.com/watch?v=t4t26x8IAyA

Once you’ve created your own library, you need to add it to your program file, just as you did in the WSQ of YoSoy196.

In order to call your library you need to type in this “whatevernameyouhave.h” so the program can us the library.

I hope these links and my explanation can be useful.

 

#Mastery14 https://youtu.be/GmUM73gnxjY

Learn To Program 2015-04-24 19:15:00

Mastery14

Los modulos en Python son archivos que generalmente se ejecutan desde la ruta C:Python34Lib de nuestra PC, por lo que si creamos un modulo Nombre.py no debemos olvidarnos de la extensión .py
Además, las funciones y variables no se pierden mientras el archivo subsista en la ruta de instalación, por lo que se puede usar un numero inteterminado de veces.
La manera de llamar el modulo importado se realiza de la siguiente manera:

import Nombre
Cuerpo del programa principal
    Nombre.Funcion(Parámetro)

return

Donde Nombre.Funcion es la función a llamar del modulo y Parámetro son los valores para que opere en caso de ser necesario, junto con el return.

Señalar para aclarar dudas que no es lo mismo el modulo que el programa principal, pues desde el programa principal que esta ubicado en ruta X, se llama al modulo generalmente ubicado en la ruta escrita, para que haga operaciones específicas de algo.

**********************
Programa hecho en Python:
**********************
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery14a.py
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery14b.py

Learn To Program 2015-04-24 19:15:00

Mastery14

Los modulos en Python son archivos que generalmente se ejecutan desde la ruta C:\Python34\Lib de nuestra PC, por lo que si creamos un modulo Nombre.py no debemos olvidarnos de la extensión .py
Además, las funciones y variables no se pierden mientras el archivo subsista en la ruta de instalación, por lo que se puede usar un numero inteterminado de veces.
La manera de llamar el modulo importado se realiza de la siguiente manera:

import Nombre
Cuerpo del programa principal
    Nombre.Funcion(Parámetro)

return

Donde Nombre.Funcion es la función a llamar del modulo y Parámetro son los valores para que opere en caso de ser necesario, junto con el return.

Señalar para aclarar dudas que no es lo mismo el modulo que el programa principal, pues desde el programa principal que esta ubicado en ruta X, se llama al modulo generalmente ubicado en la ruta escrita, para que haga operaciones específicas de algo.

**********************
Programa hecho en Python:
**********************
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery14a.py
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery14b.py