TEACH ME HOW TO BOT – Building a simple Twitter Bot

--Originally published at Coding The Future

Greetings everyone! I am back, and although this is long overdue, it's finally here!

Today I am releasing my tutorial on how to build a simple Twitter Bot. I have been working on a bot called Manny's Fortune Ball, a simple bot that replies with future predictions every time you ask it a question. You can go check it out by visiting its Twitter profile, and asking him a question. Its handle is @askemanuel.

Above I have attached a interactive slideshow. To move on to the next slide, just click on it, or tap the arrows.

Finally, this is the link to the GitHub repository so that you can check my source code: https://github.com/emamex98/TwitterFortuneBall

I hope you enjoy the tutorial! If you have any questions, do not hesitate to contact me:
Twitter: @emamex98
Email: em (at) nuel.xyz

comments powered by Disqus

#SinComentarios

--Originally published at Eduardo's Projectz

Aunque parezcan irrelevantes a veces, los comentarios son una de las herramientas más importantes que podemos utilizar en el día a día de la programación.

Los comentarios son una excelente forma de explicar al humano como funciona nuestro programa. Esto puede sonar un poco tonto pero en realidad es muy importante el uso de comentarios en muchos aspectos. Desde el trabajo en equipo, donde los comentarios ayudan a que se entiendan los miembros del equipo entre si, hasta un trabajo en solitario que se alarga por mucho tiempo, donde los comentarios pueden ayudar a que no te pierdas y comprendas que estabas haciendo antes más rápido.

Para crear un comentario basta con poner el símbolo gato (“#”) antes de lo que quieras definir como comentario.

captura-de-pantalla-de-2016-09-14-19-32-51

Como he mencionado anteriormente, los comentarios son generalmente utilizados para explicar lineas de código.

captura-de-pantalla-de-2016-09-14-20-19-23

El símbolo gato (“#”) automáticamente marca como comentario todo lo que esté a la derecha de él, no importa si tenias variables declaradas o funciones definidas, si está a la derecha del símbolo gato (“#”) será tomado como comentario y no contará para el desarrollo del código.

captura-de-pantalla-de-2016-09-14-20-29-47

Esta propiedad puede ser aprovechada para probar distintas lineas de código sin eliminarlo.

captura-de-pantalla-de-2016-09-14-20-34-20    captura-de-pantalla-de-2016-09-14-20-38-21

En el caso anterior, el valor de “c” es el que está en la linea 7, ya que las lineas 3 a la 6 están designadas como comentarios y no influyen en el desarrollo del código.

 

Para información más completa, visita: http://www.tutorialpython.com/comentarios-en-python/ http://www.pythonforbeginners.com/comments/comments-in-python http://lineadecodigo.com/python/comentarios-en-python/

Para una explicación más ilustrativa ve el siguiente video-tutorial: https://youtu.be/Uu7C99-hG60

 

 

 

images

 

 


¡Nadie entiende mi código!, primera consulta al doctor Alexis

--Originally published at TC101 – Doctor Alexis Freud

“No tengo mucho escribiendo código en Python, se que debo tener problemas, pero lo que sucede es que nadie puede ayudarme a resolverlos cuando los tengo” Son algunas de las palabras de frustración con las que se desahogaba mi primera paciente como doctor en código, Alexis Freud.

14328865_1206778556010072_207677668_nPaula estaba en conflicto: Si ella escribía su código, nadie mas lo entendería. Solo ella.

Me comentó que ademas, estaba deprimida porque sentía que no era muy atractiva, debido a su ojo gigante, su piel morada o a su cabello maltratado.

Estaba claro que yo soy doctor de código, y no la podía ayudar con su físico, pero si en algo podía apoyarla, era con su código.

Decidí recetarle un poco de mi amplio conocimiento sobre algo llamado “comentarios” (que no adquirí en este video de Youtube, ni mucho menos en este libro súper barato, porque, obvio, soy doctor).

Le hable sobre los comentarios, que son textos que la computadora no reconoce como código y se utilizan para dar a entender mejor el código. Le mencione que para escribir comentarios en Python puedes utilizar 2 tipos:

  • Para una línea
  • Para varias líneas, o comentarios más largos.

Para el primer tipo de comentarios debes colocar un “#” antes de comenzar a escribir. Python no detectara lo que se escriba ahí, ya que esta diseñado para que sea interpretado por humanos y no por la computadora.

Para el segundo tipo de comentarios utilizas tres comillas (“””) al iniciar y tres comillas (“””) al finalizar el comentario.

Le deje en una nota ambos ejemplos, para que pudiera recordarlos mas tarde:

14329311_1206798206008107_1475673851_o

Desde ese momento, Paula se hizo mas bella, la gente entendió sus códigos y desarrollo su propio sistema operativo, mas de 50,000 comentarios.

Hasta aquí mi reporte sobre la primera paciente.


FOR ALL THOSE PROCRASTINATORS

--Originally published at Coding The Future

If you are reading this right now, you were probably procrastinating, and just started studying for tomorrow's test, right?

Well, as always, I've got you covered. Here's a quick video summary of what you need to know for the first partial. I hope things are not too strange.

Good luck!

Comments

--Originally published at Python

Code:
print(“This program just shows comments and how they affect the program.”)
#3
print(“As you can see, comments are only visible inside the code, they aren’t shown when the program runs. Otherwise, you’d see a 3 above this message.”)
#I shouldn’t be writing this much
print(“Comments help you understand what you are seeing in case the code was written by someone else. They can also help you remember what you were doing, in case you closed the program and decided to open it again some time later.”)
#Bye
Comments


Lord of the Comments

--Originally published at Codebuster

As you navigate your way trhough programming you will acquire more knowledhe, and will create more complex programs each time, this programs can become hard to read, thus comments are used. Comments are the notes that you leave in a program to remind yourself, or to explain to another person what the program is doing. Since you can’t reach from the other side of the screen, comments are a pretty important deal. The very best thing about comments is, they are completely ignored by the interpreter, so feel free to use them as often as needed to make your program more readable.

There are two types of comments, if it’s a one liner,

comment i g.PNG

To put a comment just type a #before what you wish to say

Should’nt be hard, since we constantly navigate a #infected world in twitter and instagram.

Or in case of long comments,

other comment

If you have a lot to say, just use “”” before the comment “””

 

 

 

 


#COMMENTS

--Originally published at angelmendozas

Comments have two ways to be done, but first, why we put a comment in python?

According to python for beginners:

Comments in Python are used to explain what the code does.

1.The first is by using a hashtag (#) before the comment like:

#SUM

and then you do the sum of x number of values or do whatever you put in the comment.

2.The second way to put a comment is using (“””) before and after the comment and this way you can write a paragraph as if you were in Word.

Resources:

http://www.pythonforbeginners.com/comments/comments-in-python


#Comments??

--Originally published at Py(t)hon

8ici2juxmrk88
Image via GIPHY

Continuing with Python, it’s time to learn about the comments, which are no more than pieces of codes that are not supposed to be run by the interpreter. This comments help the programmer understand better the code, and also if for any reason you get confuse, you can find your path once again by reading the comments.

For us to start a comment in Python there is only one requirement, to star with a number sing #.comentarios 1

As you can see, the comments where not run, only the function “print”. There is another use for the comments, let say you have a piece of the code that you don’t want the interpreter to run, but also you don’t want to erase it. What to do? The answer is simple, just turn it into a comment.

comentarios 2 comentarios3

For the people that is using eclipse to program, there are certain thing you can do to make your life easier, and your programing, on the top left corner in there is the option “Source” in there you will find two buttons one is Comment and the other one Uncomment, by selecting the piece of code and clicking on of these buttons you will be able to turn that piece of code into a comment or make that comment a piece of code again?.

comentarios4

Here is the video that help me understand comments …

#TC101#Pug#Comments#Nomoreplease#ISC#Tec

 


I DON’T SPEAK GERMAN (BUT I CAN IF YOU LIKE)

--Originally published at Coding The Future

If you are a Lady Gaga fan, you are probably familiar with her famous line "I don't speak German, but I can if you like" from her song SchieBe. This lyric line has always intrigued me, but it has acquired a new meaning since I started programming. Why? Because once you learn an object-oriented language, all others come naturally in a matter of days.

I started coding on Python 3 for the first time last week, and coming from C# on Visual Studio 2008 felt like a natural transition. All the syntax is pretty much the same, and some is even simpler, which is an amazing thing!

I have taken the time to compile the most basic syntax that I've learned on Python so far. Enjoy!

1. Comments

When we think about coding, commenting often goes as an underestimated feature. Consequently, I decided to start my post with comments.

#COMMENTS: To comment, use a number sign and then write your comment.

2. Declaring variables (and arrays)

Unlike other programming languages, I've realized that on Python, you don't have to declare the variable type when declaring a variable. To declare a variable, just type the name, and if you want to, give it a value. Even though you don't need to, I usually give integer-type variables a default value of zero. You can also declare strings and arrays using the appropriate brackets.

i = 5 j = 6
k = i + j
y = [1,3,5,8]
x = ('Emanuel')

3. Output

To output a variable or just some text, you can use the print class. Remember you can always combine several variables or variables with text by concatenating using the plus sign.

print ('Hello World!') print ('Hello, ' + x)
print (k)
print (y)
print (y[2])

4. Input

I'll be Continue reading "I DON’T SPEAK GERMAN (BUT I CAN IF YOU LIKE)"

I DON’T SPEAK GERMAN… But I can if you like

--Originally published at Coding The Future

If you are a Lady Gaga fan, you are probably familiar with her famous line "I don't speak German, but I can if you like" from her song SchieBe. This lyric line has always intrigued me, but it has acquired a new meaning since I started programming. Why? Because once you learn an object-oriented language, all others come naturally in a matter of days.

I started coding on Python 3 for the first time last week, and coming from C# on Visual Studio 2008 felt like a natural transition. All the syntax is pretty much the same, and some is even simpler, which is an amazing thing!

I have taken the time to compile the most basic syntax that I've learned on Python so far. Enjoy!

1. Comments

When we think about coding, commenting often goes as an underestimated feature. Consequently, I decided to start my post with comments.

#COMMENTS: To comment, use a number sign and then write your comment.

2. Declaring variables (and arrays)

Unlike other programming languages, I've realized that on Python, you don't have to declare the variable type when declaring a variable. To declare a variable, just type the name, and if you want to, give it a value. Even though you don't need to, I usually give integer-type variables a default value of zero. You can also declare strings and arrays using the appropriate brackets.

i = 5
j = 6
k = i + j
y = [1,3,5,8]
x = ('Emanuel')

3. Output

To output a variable or just some text, you can use the print class. Remember you can always combine several variables or variables with text by concatenating using the plus sign.

print ('Hello World!')
print ('Hello, ' + x)
print (k)
print (y)
print (y[2])

4. Input

I'll be Continue reading "I DON’T SPEAK GERMAN… But I can if you like"