=== tenach is now known as ph | ||
=== ph is now known as PHP | ||
=== PHP is now known as tenach | ||
=== nigel_lernid is now known as Guest85724 | ||
Hutley | \window splith 50 | 04:27 |
---|---|---|
FusionX | how do i get taught? | 07:17 |
meHrishi | Happy Software freedom day everyone! | 07:49 |
tazz | http://is.gd/8rtIi the timing is in gmt right? | 15:08 |
simulacrum | Events shown in time zone: GMT (no daylight saving) | 15:19 |
technoid_ | why can i not login here with lernid...any ideas? | 16:05 |
technoid_ | should I be able to use lernid for this session? | 16:13 |
ean5533 | I don't see why not. All Lernid does is automatically connect to this channel and the chat channel | 16:13 |
=== IAmNotThatGuy is now known as Mohan_chml | ||
gizmodo | hi | 16:24 |
=== saji89 is now known as Guest34491 | ||
=== Guest34491 is now known as opensorcerer | ||
=== opensorcerer is now known as info | ||
=== info is now known as opensorcerer | ||
=== opensorcerer is now known as saji89_ | ||
technoid_ | Anyone using Lernid to connect in here? | 16:50 |
gizmodo | technoid_: xchat | 16:51 |
technoid_ | gizmodo: same here...thought that this is what lernid was for, so wanted to give it a try | 16:52 |
technoid_ | but never connects to irc | 16:53 |
gizmodo | afaik this is a python class but i wonder when its starts | 16:53 |
saji89_ | technoid_, I have now joined in from lernid as saji_nedi | 16:53 |
gizmodo | and btw <---- NOT from the website | 16:53 |
sdagdfd | the python thing starts in 1 hour I think | 16:53 |
technoid_ | good, i did't want to have to worry about loosing my fone | 16:54 |
* gizmodo has no phone | 16:54 | |
technoid_ | that why I am here, the python class, but can' | 16:54 |
nUboon2Age | gizmodo: afaik 1700 urc | 16:54 |
gizmodo | atleast none that work | 16:54 |
nUboon2Age | s/urc/utc | 16:54 |
technoid_ | can't get lernid to connect...so will be here with xchat. | 16:54 |
saji89_ | technoid_, I could connect from Lernid. | 16:55 |
technoid_ | saj: how did you get it to connect? | 16:55 |
technoid_ | I get the schedule, but never the chatroom or class room | 16:55 |
nUboon2Age | technoid_: lernid connected for me | 16:55 |
saji89_ | technoid_, IS your nick registered? | 16:55 |
gizmodo | btw which distro do you guys run? | 16:55 |
technoid_ | yes...but i tried with an unregged nick | 16:56 |
thomashc | gizmodo, it's #ubuntu-classroom | 16:56 |
gizmodo | thomashc: so? | 16:56 |
saji89_ | gizmodo, Obviously most of us run Ubuntu. | 16:56 |
thomashc | ^^ | 16:56 |
gizmodo | there always exceptions | 16:56 |
technoid_ | when you got the schedule did it automagically enter you into the chatroom? | 16:56 |
Mohan_chml | gizmodo, what about you? | 16:56 |
gizmodo | linux mint debian atm | 16:57 |
Mohan_chml | gizmodo, cool | 16:57 |
saji89_ | technoid_, Please add the nick of the person you are talking to. YEs it automatically entered me in both #ubuntu-classroom and #ubuntu-classroom-chat | 16:58 |
nUboon2Age | technoid_: i tried the 'vertical layout' and that doesn't seem to work for me in lernid. its as | 16:59 |
nUboon2Age | technoid_: i take that back. its working now | 16:59 |
technoid_ | nUboon2Age, thanks, tried that and no go.... | 17:00 |
technoid_ | hmm | 17:00 |
nUboon2Age | technoid_: there was a long pause for me before classroom and chatrom came up. | 17:01 |
technoid_ | nUboon2Age, okay, i will wait a bit then | 17:02 |
nUboon2Age | technoid_: i don't know if this matters, but i clicked on today's class in the schedule | 17:02 |
saji89_ | technoid_, I too had that long pause. :) | 17:02 |
saji89_ | nUboon2Age, I have tried the vertical layout now. Its working fine for me. | 17:02 |
technoid_ | nUboon2Age, saji89_: do I have to use a registered nick? | 17:02 |
saji89_ | technoid_, I don't think... unregistered niok shuld also work fine. | 17:03 |
saji89_ | technoid_, But in any case its wise to register your nick. | 17:03 |
nUboon2Age | technoid_: i don't think so because on lernid i'm not using a registered nick (i'm typing to you via Konversation right now) | 17:04 |
technoid_ | saji89_, it is just a secondary nick since i am already on freenode with xchat | 17:04 |
saji89_ | technoid_, Even me. I have joined in as saji89_ from Xchat and saji_nedi from Lernid. saji_nedi is an unregistered nick. So, it shuld work fine for you too. | 17:05 |
nUboon2Age | afaik when the class starts this channel is for the teacher, and students us #ubuntu-classroom-chat to talk. | 17:05 |
technoid_ | saji89_, thank you | 17:05 |
saji89_ | technoid_, No mention dude. :) | 17:05 |
saji89_ | nUboon2Age, Yes. | 17:06 |
=== saji89_ is now known as IamThatGuy | ||
=== IamThatGuy is now known as IAmThatGuy | ||
=== IAmThatGuy is now known as saji89 | ||
=== saji89 is now known as IAmThatGuy | ||
gizmodo | is it started yet? | 17:36 |
pedro3005 | half an hour | 17:36 |
=== IAmNotThatGuy is now known as Mohan_chml | ||
=== IAmThatGuy is now known as saji89 | ||
gizmodo | pedro3005: is it already busy for half an hour or does it starts in half an hour | 17:37 |
pedro3005 | gizmodo, it starts in half an hour | 17:37 |
gizmodo | k | 17:38 |
nUboon2Age | gizmodo: you probably realize that when it starts this channel will be for pedro3005 only and we'll be typing our questions and stuff in #ubuntu-classroom-chat and a bot will forward questions to pedro3005, right? | 17:51 |
pedro3005 | nUboon2Age, is it so? I set it to not moderated | 17:52 |
gizmodo | nUboon2Age: i know | 17:52 |
nUboon2Age | pedro3005: afaik, that's usually the procedure. otherwise the logs get really chaotic and hard to follow. | 17:52 |
nUboon2Age | gizmodo: sorry, just checking. | 17:53 |
gizmodo | nUboon2Age: no problem | 17:53 |
saji89 | pedro3005, You better set this channel as moderated, else ur session will be mioxed with talks from participantrs. | 17:53 |
pedro3005 | saji89, If it doesn't get abusive, that doesn't bother me | 17:53 |
Mohan_chml | nUboon2Age, pedro likes live interaction! | 17:53 |
saji89 | pedro3005, Why take unwanted chances. | 17:54 |
nUboon2Age | pedro3005: but you'll still get questions via bot even w/ moderation afaik | 17:54 |
saji89 | pedro3005, also it seems every Ubuntu classroom session is logged and posted. OS its better to kepp the session moderated. | 17:54 |
nUboon2Age | saji89: do you know how we ask questions via the bot? | 17:54 |
saji89 | pedro3005, Moderated in the sense only u're ableto talk here. | 17:54 |
pedro3005 | saji89, alright | 17:55 |
saji89 | nUboon2Age, Yes. just add a QUESTION: before your questions and post at chat channel. | 17:55 |
* Mohan_chml gives the Mic to pedro3005 | 17:56 | |
sxj | is the class on | 18:00 |
pedro3005 | should be | 18:00 |
pedro3005 | I think the bot says something though | 18:00 |
saji89 | pedro3005, Lernid said the session has started. | 18:01 |
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Beginners Team Dev Academy - Current Session: Introduction to Python - Instructor: pedro3005 | ||
pedro3005 | Hello folks | 18:01 |
gizmodo | hi | 18:02 |
norax | hi | 18:02 |
pedro3005 | We'll be going over an introduction to Python. In this course I plan to teach the basics of python that will allow you to go on learning any interface you would like to use, such as Django or PyQt | 18:02 |
pedro3005 | We will be using Python 2.7 so make sure you have that | 18:03 |
pedro3005 | Let's inverse the roles here for a bit. I'll ask you a question: do you guys have prior programming experience, with Python or any other languages? | 18:04 |
pedro3005 | Oh, about the version | 18:04 |
pedro3005 | If you have python 2.6.x it should be fine | 18:05 |
norax | 2.6.5 | 18:05 |
sxj | nope | 18:05 |
norax | some in C and python but long time ago. | 18:05 |
qwebirc84215 | Hello | Hola | 18:06 |
qwebirc84215 | :D | 18:06 |
pedro3005 | Ok, it seems we have all sorts of people here | 18:06 |
pedro3005 | Since some have no programming experience, we'll be going over all the basic concepts | 18:06 |
pedro3005 | Also, everyone join #ubuntu-classroom-chat and please talk/respond there | 18:07 |
JuanCarlosPaco | ok | 18:07 |
pedro3005 | The +m thing is being taken care of | 18:09 |
pedro3005 | Let us continue | 18:09 |
shadeslayer | has it started? | 18:09 |
pedro3005 | shadeslayer, yes, we're just beginning. #ubuntu-classroom-chat please | 18:09 |
pedro3005 | Alright guys, let me introduce you to your new best friend | 18:10 |
pedro3005 | The python docs: http://docs.python.org | 18:10 |
pedro3005 | If you have any doubts about syntax, or want to check what a function does, that's where you cgo | 18:11 |
pedro3005 | go* | 18:11 |
pedro3005 | Alright, now everyone open a python shell | 18:11 |
pedro3005 | type 'python' in a terminal | 18:12 |
pedro3005 | We are using python 2.x also because that's what I'm experienced in :) | 18:12 |
pedro3005 | What you have now is the python interpreter | 18:13 |
pedro3005 | You can type python commands in, and they'll be evaluated | 18:13 |
pedro3005 | This is useful for testing small pieces of code and basic learning | 18:13 |
pedro3005 | We'll begin with the all-time classic | 18:13 |
pedro3005 | type this into your shell: | 18:14 |
pedro3005 | print "Hello, world!" | 18:14 |
=== saji89 is now known as saji89|dinner | ||
pedro3005 | As you can see, if you typed this command correctly it will nicely show "Hello, world" in your screen | 18:14 |
pedro3005 | That is the purpose of the command print | 18:15 |
pedro3005 | You can use either single-quotes '', or double quotes "" | 18:15 |
pedro3005 | You can use triple-quotes for multi-line strings | 18:15 |
pedro3005 | such as | 18:15 |
pedro3005 | print '''Hello, | 18:15 |
pedro3005 | world!''' | 18:15 |
pedro3005 | As you see, the formatting is kept | 18:16 |
pedro3005 | Python does not differentiate '' and "" | 18:16 |
pedro3005 | But yes | 18:16 |
pedro3005 | there is the escaping issue | 18:16 |
pedro3005 | take this example | 18:16 |
pedro3005 | print "It's an example" | 18:16 |
pedro3005 | in this instance, you do not have to escape the quotes | 18:16 |
pedro3005 | if you're using single quotes, you must escape it | 18:17 |
pedro3005 | print 'It\'s an example" | 18:17 |
pedro3005 | oops | 18:17 |
pedro3005 | print 'It\'s an example' | 18:17 |
pedro3005 | Are we all cool with that? | 18:18 |
pedro3005 | Alright, let's move on | 18:18 |
pedro3005 | Python can also do arithmetics! | 18:18 |
pedro3005 | You can evaluate expressions such as 2 + 2 | 18:19 |
pedro3005 | for multiplication it is * and division is / | 18:19 |
pedro3005 | Exponentials are done with ** | 18:19 |
pedro3005 | you can use parenthesis to indent the expressions | 18:20 |
pedro3005 | such as (2 + 3) * 4 | 18:20 |
pedro3005 | Now when python catches an expression such as 2 + 2 and returns 4, we say that the expression was evaluated | 18:21 |
pedro3005 | what is the maximum number it can calculates? | 18:22 |
pedro3005 | that is a good question | 18:22 |
pedro3005 | It is the same value as a floating-point in C | 18:23 |
pedro3005 | what's the difference between typing "1+1" or "print 1+1" | 18:23 |
pedro3005 | When you type 1+1, the expression is evaluated then thrown away | 18:23 |
pedro3005 | the second command calls print with the evaluated expression | 18:23 |
pedro3005 | when you're in the shell, you don't notice the difference | 18:23 |
pedro3005 | but it will become apparent when you work with source code | 18:24 |
pedro3005 | But let's move on | 18:24 |
pedro3005 | are we all cool? | 18:24 |
pedro3005 | let's move on | 18:25 |
pedro3005 | Python can also evaluate boolean expressions, a very important aspect of programming | 18:25 |
pedro3005 | Boolean expressions are the ones where you ask a question and get a response, True or False | 18:25 |
pedro3005 | for instance | 18:25 |
pedro3005 | "is 1 equal to 2?" | 18:26 |
pedro3005 | that is False | 18:26 |
pedro3005 | In python, we have certain operators to denote that | 18:26 |
pedro3005 | == means equal to | 18:26 |
pedro3005 | so type out 1 == 2 | 18:26 |
pedro3005 | you will see False | 18:26 |
pedro3005 | > and < mean respectively bigger than and smaller then | 18:27 |
=== IAmNotThatGuy is now known as Mohan_chml | ||
pedro3005 | Question: is there any difference between == and "is" ? | 18:27 |
pedro3005 | I think they are equal, but I haven't used "is" so I don't know for certain | 18:27 |
=== saji89|dinner is now known as saji89 | ||
pedro3005 | Ok, let me correct something | 18:31 |
pedro3005 | "is" also does a type-check | 18:31 |
pedro3005 | we'll be going over types shortly | 18:31 |
=== simulacrum is now known as Google-fu | ||
pedro3005 | I forgot to mention | 18:32 |
pedro3005 | we also have >= and <= | 18:32 |
pedro3005 | these mean bigger than or equal and smaller than or equal | 18:32 |
pedro3005 | and != means not equal to | 18:32 |
=== Google-fu is now known as google-fu | ||
pedro3005 | Yes, "is" is confusing, but you'll see when we go over types | 18:33 |
pedro3005 | Any questions about boolean expressions? | 18:33 |
pedro3005 | <c-schmidt> QUESTIOn is there an XOR, as in c++ ? | 18:34 |
pedro3005 | Yes, in fact, there is | 18:34 |
pedro3005 | let me get you the docs link | 18:35 |
pedro3005 | one minute | 18:35 |
pedro3005 | http://docs.python.org/library/stdtypes.html#bit-string-operations-on-integer-types | 18:35 |
pedro3005 | I don't want to confuse everyone with bitwise algebra so I didn't mention that | 18:36 |
pedro3005 | can we move on or more questions? | 18:36 |
pedro3005 | Great | 18:36 |
pedro3005 | Let's go over an important concept: variables | 18:37 |
pedro3005 | A variable in programming is sort of like a variable in math. It holds a value | 18:37 |
pedro3005 | you can assign variables with = | 18:38 |
=== adrian is now known as Guest76050 | ||
pedro3005 | Incidentally, that is why equal to (==) has two symbols. It must differentiate from =, the assignment operator | 18:39 |
pedro3005 | Let's go over that | 18:39 |
pedro3005 | You can do for instance | 18:39 |
pedro3005 | x = 2 | 18:39 |
pedro3005 | In python, you do not need to declare variables before using them | 18:39 |
pedro3005 | So that is telling python to grab the x variable and set it equal to two | 18:39 |
pedro3005 | Python is case-sensitive | 18:40 |
pedro3005 | That means VARIABLE is different from VaRiAbLe | 18:40 |
pedro3005 | When we say x = 2, we are defining x to be an integer of value 2 | 18:41 |
pedro3005 | An integer is a whole number, positive or negative | 18:41 |
pedro3005 | e.g. -1, 0, 1, 2, 3 ... | 18:41 |
pedro3005 | we have other types | 18:41 |
pedro3005 | for instance, a string | 18:41 |
pedro3005 | a string is a list of characters | 18:42 |
pedro3005 | for instance, "hello world" | 18:42 |
pedro3005 | we can say x = "hello world" | 18:42 |
pedro3005 | and then do | 18:42 |
pedro3005 | print x | 18:42 |
pedro3005 | The type of x is a string | 18:42 |
pedro3005 | so it does not make sense to say x + 2 | 18:42 |
pedro3005 | because 2 is an integer and x is a string | 18:42 |
pedro3005 | in fact, if you try that, you'll get an error | 18:43 |
pedro3005 | Traceback (most recent call last): | 18:43 |
pedro3005 | File "<stdin>", line 1, in <module> | 18:43 |
pedro3005 | TypeError: cannot concatenate 'str' and 'int' objects | 18:43 |
pedro3005 | str and int are shorts for string and integer | 18:43 |
pedro3005 | However, we can use multiplication with strings | 18:43 |
pedro3005 | that simply repeats the string an x number of times | 18:43 |
pedro3005 | for instance | 18:44 |
pedro3005 | x = "a" | 18:44 |
pedro3005 | x * 2 | 18:44 |
pedro3005 | that gives "aa" | 18:44 |
pedro3005 | We also have the type float | 18:44 |
pedro3005 | which is a floating-point number | 18:44 |
pedro3005 | we use that to store non-whole numbers | 18:44 |
pedro3005 | for instance | 18:45 |
pedro3005 | x = 2.5 | 18:45 |
pedro3005 | We can do x + 2, of course | 18:45 |
pedro3005 | Since we have types, we have functions for type conversion | 18:47 |
pedro3005 | what does that mean? | 18:47 |
pedro3005 | if we have a string, say "2" | 18:47 |
pedro3005 | that string is obviously a digit | 18:47 |
pedro3005 | and I want to make it so | 18:47 |
pedro3005 | I'll use an int conversion | 18:47 |
pedro3005 | int("2") == 2 | 18:47 |
pedro3005 | But, what if we try to convert something that doesn't look like it can be converted? | 18:48 |
pedro3005 | int("a") | 18:48 |
pedro3005 | that will return an error | 18:48 |
pedro3005 | ValueError: invalid literal for int() with base 10: 'a' | 18:48 |
pedro3005 | we also have the function str(), to make something a string | 18:48 |
pedro3005 | and of course float() | 18:49 |
pedro3005 | Guys | 18:50 |
pedro3005 | The session is nearly over and I would like to go over one more thing | 18:51 |
ClassBot | There are are 10 minutes remaining in the current session. | 18:51 |
pedro3005 | Do you all understand types and type conversion? | 18:51 |
pedro3005 | that is great | 18:51 |
pedro3005 | So we'll look at if now | 18:52 |
pedro3005 | Well, since we can get answers from boolean expressions, we need a way of directing our program towards that | 18:53 |
pedro3005 | for instance, say we have a variable x | 18:53 |
pedro3005 | if it is equal to one, we want to say "X is one!" | 18:53 |
pedro3005 | if not, we want to say "X is not one!" | 18:53 |
pedro3005 | we would use if for that, just like in english | 18:54 |
pedro3005 | if x == 1: | 18:54 |
pedro3005 | print "x is one!" | 18:54 |
pedro3005 | else: | 18:54 |
pedro3005 | print "x is not one!" | 18:54 |
pedro3005 | We use colons after the expressions, not {} as some other languages do | 18:55 |
pedro3005 | In python, indentation is crucial | 18:55 |
ClassBot | There are are 5 minutes remaining in the current session. | 18:56 |
pedro3005 | <Otto35> QUESTION: If {} aren't used, how is the end of the else block known to the interpreter? | 18:56 |
pedro3005 | excellent question | 18:56 |
pedro3005 | That is known by indentation | 18:56 |
pedro3005 | the spaces before a line | 18:56 |
pedro3005 | one level of indentation is normally 4 spaces | 18:56 |
pedro3005 | but python is intelligent and will pick up on tabs and such | 18:56 |
pedro3005 | but it is recommended that you set your editor for 4 spaces | 18:56 |
pedro3005 | <Otto35> QUESTION: If whitespace is necessary to identify blocks, are spaces or tabs used? does the number matter? | 18:57 |
pedro3005 | yes, the number differentiates how many levels deep the block is | 18:57 |
pedro3005 | for instance, if we have an if inside an if | 18:57 |
pedro3005 | we need to raise the level of indentation accordingly | 18:57 |
pedro3005 | And one last word | 18:58 |
pedro3005 | We can get input by the user calling the function raw_input() | 18:58 |
pedro3005 | that input will be of type string | 18:58 |
pedro3005 | you will want to assign that to a variable | 18:59 |
pedro3005 | everyone got that? | 18:59 |
pedro3005 | Great | 18:59 |
pedro3005 | So by now you should know enough to code your first program | 18:59 |
pedro3005 | <Seven_Six_Two> can you show a line with raw_input | 19:00 |
pedro3005 | sure | 19:00 |
pedro3005 | name = raw_input() | 19:00 |
pedro3005 | So, I would like for you to play with if, else, variables, type conversion and input this week | 19:00 |
pedro3005 | in your python shell | 19:01 |
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - http://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi | ||
pedro3005 | ideally, you should be able to make something so you type a value, like "2", it is converted to int, and you perform a check over it to check if it's positive or negative (for example) | 19:01 |
pedro3005 | I am available for any questions you guys might have | 19:02 |
pedro3005 | and also #python is of great help | 19:02 |
pedro3005 | or #ubuntu-beginners-dev if you prefer | 19:02 |
pedro3005 | Thank you all for the time, have fun playing with python | 19:02 |
Se7en | thank YOU sir | 19:03 |
gizmodo | indeed thank you pedro3005 | 19:03 |
sxj | where can are the logs | 19:04 |
sdagdfd | thanks for the lesson | 19:04 |
sxj | sorry - when can one get the logs from | 19:04 |
pedro3005 | http://irclogs.ubuntu.com/2010/09/18/%23ubuntu-classroom.html | 19:04 |
sxj | thanks | 19:05 |
liel | pedro3005: Hello, why doesn't the lesson begin? | 19:28 |
Mohan_chml | liel, session ended | 19:28 |
Mohan_chml | liel, look at the logs from http://irclogs.ubuntu.com/2010/09/18/%23ubuntu-classroom.html | 19:29 |
liel | Mohan_chml: OK, I just thought that the times are UTC and the calendar showed 19:00 | 19:32 |
Mohan_chml | ahha! | 19:33 |
google-fu | It's 19:38 in London | 19:38 |
=== Ddorda1 is now known as Ddorda | ||
=== yofel_ is now known as yofel | ||
=== XCFDJ is now known as xcfdjse7en |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!