/srv/irclogs.ubuntu.com/2010/09/18/#ubuntu-classroom.txt

=== 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 5004:27
FusionXhow do i get taught?07:17
meHrishiHappy Software freedom day everyone!07:49
tazzhttp://is.gd/8rtIi the timing is in gmt right?15:08
simulacrumEvents 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
ean5533I don't see why not. All Lernid does is automatically connect to this channel and the chat channel16:13
=== IAmNotThatGuy is now known as Mohan_chml
gizmodohi16: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
gizmodotechnoid_: xchat16:51
technoid_gizmodo: same here...thought that this is what lernid was for, so wanted to give it a try16:52
technoid_but never connects to irc16:53
gizmodoafaik this is a python class but i wonder when its starts16:53
saji89_technoid_, I have now joined in from lernid as saji_nedi16:53
gizmodoand btw <---- NOT from the website16:53
sdagdfdthe python thing starts in 1 hour I think16:53
technoid_good, i did't want to have to worry about loosing my fone16:54
* gizmodo has no phone16:54
technoid_that why I am here, the python class, but can'16:54
nUboon2Agegizmodo: afaik 1700 urc16:54
gizmodoatleast none that work16:54
nUboon2Ages/urc/utc16: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 room16:55
nUboon2Agetechnoid_: lernid connected for me16:55
saji89_technoid_, IS your nick registered?16:55
gizmodobtw which distro do you guys run?16:55
technoid_yes...but i tried with an unregged nick16:56
thomashcgizmodo, it's #ubuntu-classroom16:56
gizmodothomashc: so?16:56
saji89_gizmodo, Obviously  most of us run Ubuntu.16:56
thomashc^^16:56
gizmodothere always exceptions16:56
technoid_when you got the schedule did it automagically enter you into the chatroom?16:56
Mohan_chmlgizmodo, what about you?16:56
gizmodolinux mint debian atm16:57
Mohan_chmlgizmodo, cool16: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-chat16:58
nUboon2Agetechnoid_: i tried the 'vertical layout' and that doesn't seem to work for me in lernid.  its as16:59
nUboon2Agetechnoid_: i take that back.  its working now16:59
technoid_nUboon2Age, thanks, tried that and no go....17:00
technoid_hmm17:00
nUboon2Agetechnoid_: there was a long pause for me before classroom and chatrom came up.17:01
technoid_nUboon2Age, okay, i will wait a bit then17:02
nUboon2Agetechnoid_: i don't know if this matters, but i clicked on today's class in the schedule17: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
nUboon2Agetechnoid_: 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 xchat17: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
nUboon2Ageafaik when the class starts this channel is for the teacher, and students us #ubuntu-classroom-chat to talk.17:05
technoid_saji89_, thank you17: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
gizmodois it started yet?17:36
pedro3005half an hour17:36
=== IAmNotThatGuy is now known as Mohan_chml
=== IAmThatGuy is now known as saji89
gizmodopedro3005: is it already busy for half an hour or does it starts in half an hour17:37
pedro3005gizmodo, it starts in half an hour17:37
gizmodok17:38
nUboon2Agegizmodo: 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
pedro3005nUboon2Age, is it so? I set it to not moderated17:52
gizmodonUboon2Age: i know17:52
nUboon2Agepedro3005: afaik, that's usually the procedure.  otherwise the logs get really chaotic and hard to follow.17:52
nUboon2Agegizmodo: sorry, just checking.17:53
gizmodonUboon2Age: no problem17:53
saji89pedro3005, You better set this channel as moderated, else ur session will be mioxed with talks from participantrs.17:53
pedro3005saji89, If it doesn't get abusive, that doesn't bother me17:53
Mohan_chmlnUboon2Age, pedro likes live interaction!17:53
saji89pedro3005, Why take unwanted chances.17:54
nUboon2Agepedro3005: but you'll still get questions via bot even w/ moderation afaik17:54
saji89pedro3005, also it seems every Ubuntu classroom session is logged and posted. OS its better to kepp the session moderated.17:54
nUboon2Agesaji89: do you know how we ask questions via the bot?17:54
saji89pedro3005, Moderated in the sense only u're ableto talk here.17:54
pedro3005saji89, alright17:55
saji89nUboon2Age, Yes. just add a QUESTION: before your questions and post at chat channel.17:55
* Mohan_chml gives the Mic to pedro3005 17:56
sxjis the class on18:00
pedro3005should be18:00
pedro3005I think the bot says something though18:00
saji89pedro3005, 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
pedro3005Hello folks18:01
gizmodohi18:02
noraxhi18:02
pedro3005We'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 PyQt18:02
pedro3005We will be using Python 2.7 so make sure you have that18:03
pedro3005Let'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
pedro3005Oh, about the version18:04
pedro3005If you have python 2.6.x it should be fine18:05
norax2.6.518:05
sxjnope18:05
noraxsome in C and python but long time ago.18:05
qwebirc84215Hello | Hola18:06
qwebirc84215:D18:06
pedro3005Ok, it seems we have all sorts of people here18:06
pedro3005Since some have no programming experience, we'll be going over all the basic concepts18:06
pedro3005Also, everyone join #ubuntu-classroom-chat and please talk/respond there18:07
JuanCarlosPacook18:07
pedro3005The +m thing is being taken care of18:09
pedro3005Let us continue18:09
shadeslayerhas it started?18:09
pedro3005shadeslayer, yes, we're just beginning. #ubuntu-classroom-chat please18:09
pedro3005Alright guys, let me introduce you to your new best friend18:10
pedro3005The python docs: http://docs.python.org18:10
pedro3005If you have any doubts about syntax, or want to check what a function does, that's where you cgo18:11
pedro3005go*18:11
pedro3005Alright, now everyone open a python shell18:11
pedro3005type 'python' in a terminal18:12
pedro3005We are using python 2.x also because that's what I'm experienced in :)18:12
pedro3005What you have now is the python interpreter18:13
pedro3005You can type python commands in, and they'll be evaluated18:13
pedro3005This is useful for testing small pieces of code and basic learning18:13
pedro3005We'll begin with the all-time classic18:13
pedro3005type this into your shell:18:14
pedro3005print "Hello, world!"18:14
=== saji89 is now known as saji89|dinner
pedro3005As you can see, if you typed this command correctly it will nicely show "Hello, world" in your screen18:14
pedro3005That is the purpose of the command print18:15
pedro3005You can use either single-quotes '', or double quotes ""18:15
pedro3005You can use triple-quotes for multi-line strings18:15
pedro3005such as18:15
pedro3005print '''Hello,18:15
pedro3005world!'''18:15
pedro3005As you see, the formatting is kept18:16
pedro3005Python does not differentiate '' and ""18:16
pedro3005But yes18:16
pedro3005there is the escaping issue18:16
pedro3005take this example18:16
pedro3005print "It's an example"18:16
pedro3005in this instance, you do not have to escape the quotes18:16
pedro3005if you're using single quotes, you must escape it18:17
pedro3005print 'It\'s an example"18:17
pedro3005oops18:17
pedro3005print 'It\'s an example'18:17
pedro3005Are we all cool with that?18:18
pedro3005Alright, let's move on18:18
pedro3005Python can also do arithmetics!18:18
pedro3005You can evaluate expressions such as 2 + 218:19
pedro3005for multiplication it is * and division is /18:19
pedro3005Exponentials are done with **18:19
pedro3005you can use parenthesis to indent the expressions18:20
pedro3005such as (2 + 3) * 418:20
pedro3005Now when python catches an expression such as 2 + 2 and returns 4, we say that the expression was evaluated18:21
pedro3005what is the maximum number it can calculates?18:22
pedro3005that is a good question18:22
pedro3005It is the same value as a floating-point in C18:23
pedro3005what's the difference between typing "1+1" or "print 1+1"18:23
pedro3005When you type 1+1, the expression is evaluated then thrown away18:23
pedro3005the second command calls print with the evaluated expression18:23
pedro3005when you're in the shell, you don't notice the difference18:23
pedro3005but it will become apparent when you work with source code18:24
pedro3005But let's move on18:24
pedro3005are we all cool?18:24
pedro3005let's move on18:25
pedro3005Python can also evaluate boolean expressions, a very important aspect of programming18:25
pedro3005Boolean expressions are the ones where you ask a question and get a response, True or False18:25
pedro3005for instance18:25
pedro3005"is 1 equal to 2?"18:26
pedro3005that is False18:26
pedro3005In python, we have certain operators to denote that18:26
pedro3005== means equal to18:26
pedro3005so type out 1 == 218:26
pedro3005you will see False18:26
pedro3005> and < mean respectively bigger than and smaller then18:27
=== IAmNotThatGuy is now known as Mohan_chml
pedro3005Question: is there any difference between == and "is" ?18:27
pedro3005I think they are equal, but I haven't used "is" so I don't know for certain18:27
=== saji89|dinner is now known as saji89
pedro3005Ok, let me correct something18:31
pedro3005"is" also does a type-check18:31
pedro3005we'll be going over types shortly18:31
=== simulacrum is now known as Google-fu
pedro3005I forgot to mention18:32
pedro3005we also have >= and <=18:32
pedro3005these mean bigger than or equal and smaller than or equal18:32
pedro3005and != means not equal to18:32
=== Google-fu is now known as google-fu
pedro3005Yes, "is" is confusing, but you'll see when we go over types18:33
pedro3005Any questions about boolean expressions?18:33
pedro3005<c-schmidt> QUESTIOn is there an XOR, as in c++ ?18:34
pedro3005Yes, in fact, there is18:34
pedro3005let me get you the docs link18:35
pedro3005one minute18:35
pedro3005http://docs.python.org/library/stdtypes.html#bit-string-operations-on-integer-types18:35
pedro3005I don't want to confuse everyone with bitwise algebra so I didn't mention that18:36
pedro3005can we move on or more questions?18:36
pedro3005Great18:36
pedro3005Let's go over an important concept: variables18:37
pedro3005A variable in programming is sort of like a variable in math. It holds a value18:37
pedro3005you can assign variables with =18:38
=== adrian is now known as Guest76050
pedro3005Incidentally, that is why equal to (==) has two symbols. It must differentiate from =, the assignment operator18:39
pedro3005Let's go over that18:39
pedro3005You can do for instance18:39
pedro3005x = 218:39
pedro3005In python, you do not need to declare variables before using them18:39
pedro3005So that is telling python to grab the x variable and set it equal to two18:39
pedro3005Python is case-sensitive18:40
pedro3005That means VARIABLE is different from VaRiAbLe18:40
pedro3005When we say x = 2, we are defining x to be an integer of value 218:41
pedro3005An integer is a whole number, positive or negative18:41
pedro3005e.g. -1, 0, 1, 2, 3 ...18:41
pedro3005we have other types18:41
pedro3005for instance, a string18:41
pedro3005a string is a list of characters18:42
pedro3005for instance, "hello world"18:42
pedro3005we can say x = "hello world"18:42
pedro3005and then do18:42
pedro3005print x18:42
pedro3005The type of x is a string18:42
pedro3005so it does not make sense to say x + 218:42
pedro3005because 2 is an integer and x is a string18:42
pedro3005in fact, if you try that, you'll get an error18:43
pedro3005Traceback (most recent call last):18:43
pedro3005  File "<stdin>", line 1, in <module>18:43
pedro3005TypeError: cannot concatenate 'str' and 'int' objects18:43
pedro3005str and int are shorts for string and integer18:43
pedro3005However, we can use multiplication with strings18:43
pedro3005that simply repeats the string an x number of times18:43
pedro3005for instance18:44
pedro3005x = "a"18:44
pedro3005x * 218:44
pedro3005that gives "aa"18:44
pedro3005We also have the type float18:44
pedro3005which is a floating-point number18:44
pedro3005we use that to store non-whole numbers18:44
pedro3005for instance18:45
pedro3005x = 2.518:45
pedro3005We can do x + 2, of course18:45
pedro3005Since we have types, we have functions for type conversion18:47
pedro3005what does that mean?18:47
pedro3005if we have a string, say "2"18:47
pedro3005that string is obviously a digit18:47
pedro3005and I want to make it so18:47
pedro3005I'll use an int conversion18:47
pedro3005int("2") == 218:47
pedro3005But, what if we try to convert something that doesn't look like it can be converted?18:48
pedro3005int("a")18:48
pedro3005that will return an error18:48
pedro3005ValueError: invalid literal for int() with base 10: 'a'18:48
pedro3005we also have the function str(), to make something a string18:48
pedro3005and of course float()18:49
pedro3005Guys18:50
pedro3005The session is nearly over and I would like to go over one more thing18:51
ClassBotThere are are 10 minutes remaining in the current session.18:51
pedro3005Do you all understand types and type conversion?18:51
pedro3005that is great18:51
pedro3005So we'll look at if now18:52
pedro3005Well, since we can get answers from boolean expressions, we need a way of directing our program towards that18:53
pedro3005for instance, say we have a variable x18:53
pedro3005if it is equal to one, we want to say "X is one!"18:53
pedro3005if not, we want to say "X is not one!"18:53
pedro3005we would use if for that, just like in english18:54
pedro3005if x == 1:18:54
pedro3005    print "x is one!"18:54
pedro3005else:18:54
pedro3005    print "x is not one!"18:54
pedro3005We use colons after the expressions, not {} as some other languages do18:55
pedro3005In python, indentation is crucial18:55
ClassBotThere 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
pedro3005excellent question18:56
pedro3005That is known by indentation18:56
pedro3005the spaces before a line18:56
pedro3005one level of indentation is normally 4 spaces18:56
pedro3005but python is intelligent and will pick up on tabs and such18:56
pedro3005but it is recommended that you set your editor for 4 spaces18:56
pedro3005<Otto35> QUESTION: If whitespace is necessary to identify blocks, are spaces or tabs used? does the number matter?18:57
pedro3005yes, the number differentiates how many levels deep the block is18:57
pedro3005for instance, if we have an if inside an if18:57
pedro3005we need to raise the level of indentation accordingly18:57
pedro3005And one last word18:58
pedro3005We can get input by the user calling the function raw_input()18:58
pedro3005that input will be of type string18:58
pedro3005you will want to assign that to a variable18:59
pedro3005everyone got that?18:59
pedro3005Great18:59
pedro3005So by now you should know enough to code your first program18:59
pedro3005<Seven_Six_Two> can you show a line with raw_input19:00
pedro3005sure19:00
pedro3005name = raw_input()19:00
pedro3005So, I would like for you to play with if, else, variables, type conversion and input this week19:00
pedro3005in your python shell19: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
pedro3005ideally, 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
pedro3005I am available for any questions you guys might have19:02
pedro3005and also #python is of great help19:02
pedro3005or #ubuntu-beginners-dev if you prefer19:02
pedro3005Thank you all for the time, have fun playing with python19:02
Se7enthank YOU sir19:03
gizmodoindeed thank you pedro300519:03
sxj    where can are the logs19:04
sdagdfdthanks for the lesson19:04
sxjsorry - when can one get the logs from19:04
pedro3005http://irclogs.ubuntu.com/2010/09/18/%23ubuntu-classroom.html19:04
sxjthanks19:05
lielpedro3005: Hello, why doesn't the lesson begin?19:28
Mohan_chmlliel, session ended19:28
Mohan_chmlliel, look at the logs from http://irclogs.ubuntu.com/2010/09/18/%23ubuntu-classroom.html19:29
lielMohan_chml: OK, I just thought that the times are UTC and the calendar showed 19:0019:32
Mohan_chmlahha!19:33
google-fuIt's 19:38 in London19: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!