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