Jul 18 22:47:02 <--SESSION STARTED--> Jul 18 22:47:15 * Prakhar (n=prakhar@122.163.69.101) has joined #dgplug Jul 18 22:47:50 Roll Call Jul 18 22:47:57 Ria Das Jul 18 22:47:58 amrita mukherjee Jul 18 22:48:07 kishan goyal Jul 18 22:48:11 * Kishan|away is now known as kishanGoyal Jul 18 22:48:21 Prakhar Agarwal Jul 18 22:48:31 debashree banerjee Jul 18 22:48:33 khushbu mohta Jul 18 22:49:56 * Kkhushi_ (n=khushbu@59.180.137.132) has joined #dgplug Jul 18 22:49:57 * Kkhushi has quit ("Ex-Chat") Jul 18 22:50:07 ok Jul 18 22:50:14 * amrita_ (n=amrita@117.201.98.125) has joined #dgplug Jul 18 22:50:17 * amrita_ has quit (Read error: 104 (Connection reset by peer)) Jul 18 22:51:52 so what about problems Jul 18 22:51:57 * amrita_ (n=amrita@117.201.98.125) has joined #dgplug Jul 18 22:51:57 * amrita_ has quit (Client Quit) Jul 18 22:52:59 * Kkhushi_ (n=khushbu@59.180.137.132) has left #dgplug ("Ex-Chat") Jul 18 22:53:00 * Kkhushi_ (n=khushbu@59.180.137.132) has joined #dgplug Jul 18 22:53:22 http://wiki.dgplug.org/index.php/User:Khushbu/Python_assignment Jul 18 22:54:02 kushal, i mailed you Jul 18 22:54:13 kushal, how to show you now? Jul 18 22:55:01 i am not getting any message, getting very late all of a sudden Jul 18 22:55:20 ok Jul 18 22:55:45 ria, make a wiki page please Jul 18 22:55:55 kushal, i already have one Jul 18 22:56:04 ria, for python assignments / Jul 18 22:56:04 ? Jul 18 22:56:25 kushal, no i have a wiki page, but not for assign ments Jul 18 22:56:34 ok will make it then Jul 18 22:56:52 but i mailed you, you can check from there for now kushal Jul 18 22:57:07 ria, no Jul 18 22:57:23 kushal, will i make the wiki now Jul 18 22:57:24 ? Jul 18 22:58:20 ria, yes Jul 18 22:58:27 what about others Jul 18 22:58:28 ok kushal Jul 18 22:58:53 kushal: making wiki now. Jul 18 22:59:13 * arpita (n=arpita@117.201.96.255) has joined #dgplug Jul 18 22:59:49 kishanGoyal, you can show in rafb also Jul 18 23:00:02 arpita, amrita Debashree Prakhar what about you people Jul 18 23:00:06 kushal, i am also using it now Jul 18 23:00:07 * karunakarg has quit ("Leaving") Jul 18 23:00:29 arpita kapoor Jul 18 23:00:33 http://rafb.net/p/AIR4IT92.html Jul 18 23:00:48 http://rafb.net/p/mDe4Ox49.html Jul 18 23:01:03 kushal: I couldn't do it, sorry. Jul 18 23:01:19 Prakhar, you tried ? Jul 18 23:01:25 kushal, i tried it Jul 18 23:01:59 http://rafb.net/p/tySDzl21.html Jul 18 23:02:10 kishanGoyal, what is this http://rafb.net/p/mDe4Ox49.html ? Jul 18 23:02:20 kushal: no, I did not. I was caught up with some work at my university Jul 18 23:02:37 Prakhar, ok :) Jul 18 23:02:45 kushal: conversion to binary. Jul 18 23:02:45 kushal: sorry about that. Jul 18 23:02:52 kushal, i have started but not completed Jul 18 23:02:57 amrita, ok Jul 18 23:03:10 kishanGoyal, show me the code so that I can just copy and paste Jul 18 23:03:30 kushal, i have only started with the first problem..........not yet finished.... Jul 18 23:03:42 kushal, http://rafb.net/p/4nckQQ58.html Jul 18 23:03:47 arpita, ok, just don't type so many dots Jul 18 23:03:51 arpita: mind those "." Jul 18 23:03:54 kushal, http://rafb.net/p/9PXkL461.html Jul 18 23:04:05 kushal, http://rafb.net/p/ErUIXJ96.html Jul 18 23:04:07 ria, I wanted a function Jul 18 23:04:22 kushal, o.k sorry Jul 18 23:04:32 eh?...code not saved...i was just doing it in the evening and pasted it from there.. Jul 18 23:04:33 kushal, you never said so Jul 18 23:04:37 ria, second one, a must be inside the function Jul 18 23:04:52 kishanGoyal, so, now is a good time to save it Jul 18 23:04:54 kushal, ok then just putting a function Jul 18 23:05:04 ok.. Jul 18 23:05:06 ria, I am asking you now Jul 18 23:05:13 * techno_freak has quit ("Leaving") Jul 18 23:06:55 * amrita_ (n=amrita@117.201.98.125) has joined #dgplug Jul 18 23:07:00 * amrita_ has quit (Client Quit) Jul 18 23:12:54 so any one needs anything to be talked about Jul 18 23:13:36 http://rafb.net/p/1iBk1h70.html Jul 18 23:13:46 conversion to binary... Jul 18 23:14:13 kushal: i am getting it in the form of a list...not as a string.. Jul 18 23:14:23 kushal: i could not do that.. Jul 18 23:14:37 kushal, your book "python for you and me" is really helpful Jul 18 23:14:43 that is ok, we need list only Jul 18 23:14:48 Kkhushi_, thanks :p Jul 18 23:15:50 kushal, i checked it for type conversion...etc Jul 18 23:16:02 * bose_aritra (n=ARITRA@117.201.96.15) has joined #dgplug Jul 18 23:17:04 kushal, it would be great if you can give us some more problems so we can explore it more Jul 18 23:17:25 Kkhushi_, yes, but before that I need to talk some more Jul 18 23:18:03 kushal: I would request you to ask Kkhushi_ to stay on track, otherwise her recently acquired enthusiasm will die. she has this habit :) Jul 18 23:18:20 Prakhar, :) Jul 18 23:19:13 * ria_ (n=ria@121.245.23.226) has joined #dgplug Jul 18 23:19:21 so Jul 18 23:19:43 * ria has quit (Nick collision from services.) Jul 18 23:19:49 * ria_ is now known as ria Jul 18 23:20:17 kushal, http://rafb.net/p/fdslwn78.html Jul 18 23:20:25 i used function Jul 18 23:20:36 ok Jul 18 23:20:54 So , you all will read about files in python http://kushal.fedorapeople.org/book/pythonforyouandme-File-opening.html Jul 18 23:20:57 from there Jul 18 23:21:41 kushal, you can check it Jul 18 23:21:56 ria, just read, good work Jul 18 23:21:59 moving on Jul 18 23:22:02 modules Jul 18 23:23:57 * ecntrk (n=ecntrk_@117.194.1.67) has joined #dgplug Jul 18 23:23:58 so, some times you need to reuse your code Jul 18 23:24:23 for that we keep the code in another file, and use from there Jul 18 23:24:29 we call them as modules Jul 18 23:24:39 One module may have many files Jul 18 23:25:16 Python is so much powerful because of these so many modules available for any work Jul 18 23:25:57 * munichlinux has quit (Read error: 104 (Connection reset by peer)) Jul 18 23:26:00 now to use any module you have to import it Jul 18 23:26:14 like to use math module Jul 18 23:26:17 import math Jul 18 23:26:51 now like in you code you need to use pi Jul 18 23:27:00 so you can get that by math.pi Jul 18 23:27:12 see the value what it is showing Jul 18 23:27:13 ? Jul 18 23:27:39 3.1415926535897931 Jul 18 23:27:46 ok Jul 18 23:28:05 we do have math.sin cos and other methods Jul 18 23:28:32 to know more about this module read http://docs.python.org/lib/module-math.html Jul 18 23:29:58 ! Jul 18 23:30:15 ecntrk, yes Jul 18 23:30:25 What if we need to viwe what are the functions under any module...? Jul 18 23:30:33 *view Jul 18 23:30:37 Jul 18 23:30:54 ecntrk, do RTFM , simple :) Jul 18 23:30:55 * Soumya (n=Soumya@117.192.4.233) has joined #dgplug Jul 18 23:31:02 ecntrk, like import pwd Jul 18 23:31:05 help(pwd) Jul 18 23:31:07 or Jul 18 23:31:24 http://docs.python.org/lib/module-pwd.html Jul 18 23:31:28 ecntrk, ^^ Jul 18 23:31:46 http://docs.python.org/modindex.html here you can find all the default modules in python Jul 18 23:31:49 okok..i forgot Jul 18 23:32:16 any other question ? Jul 18 23:32:35 kushal: please continue Jul 18 23:33:02 roll call... Aritra Bose :) Jul 18 23:33:21 ! Jul 18 23:33:28 amrita, yes Jul 18 23:33:50 kushal, how to use pi here couldn't understand Jul 18 23:34:16 amrita, like in a code you need to divide some value by pi Jul 18 23:34:24 like 3 / math.pi Jul 18 23:34:26 :) Jul 18 23:34:48 ! Jul 18 23:34:58 arpita, yes Jul 18 23:35:05 kushal, it is showing error ....math is not defined Jul 18 23:35:05 brb Jul 18 23:35:13 arpita, scroll back and read Jul 18 23:35:19 will be back after 10 minutes Jul 18 23:35:27 people discuss here among yourself Jul 18 23:36:15 arpita, first write import math Jul 18 23:36:47 yes arpita Jul 18 23:36:57 Kkhushi_, yes now working...thanks ... Jul 18 23:40:02 * kishanGoyal has quit (Remote closed the connection) Jul 18 23:40:31 * munichlinux (n=prashant@59.92.114.224) has joined #dgplug Jul 18 23:40:41 * kishanGoyal (n=kishan@218.248.70.235) has joined #dgplug Jul 18 23:40:51 * Subhodip has quit (Read error: 110 (Connection timed out)) Jul 18 23:44:49 back Jul 18 23:44:54 any question ? Jul 18 23:45:35 To do anything file paths Jul 18 23:45:43 we have os.path module Jul 18 23:45:58 So please write some code which will Jul 18 23:46:31 Ask user to enter a path and then the code will tell whether it is file or directory or link Jul 18 23:46:47 I will see it after 5 minutes Jul 18 23:47:01 any question on ^^ Jul 18 23:47:42 no , ok Jul 18 23:47:45 5 minutes Jul 18 23:49:16 * munichlinux has quit ("Ex-Chat") Jul 18 23:53:20 :/ Jul 18 23:53:23 * viggy_prabh1 (n=viggy@210.212.5.85) has joined #dgplug Jul 18 23:56:17 kushal, ! Jul 18 23:58:38 kushal, over Jul 18 23:59:08 over Jul 18 23:59:30 http://rafb.net/p/v2Rcl878.html Jul 19 00:00:37 * stephaniewhiting has quit ("ChatZilla 0.9.83 [Firefox 2.0.0.16/2008070205]") Jul 19 00:02:21 kushal, are you there? Jul 19 00:02:52 }:) Jul 19 00:02:53 I don't think so. Jul 19 00:03:06 kushal, ??? Jul 19 00:04:08 back Jul 19 00:04:12 sorry for the delay Jul 19 00:04:20 kushal, http://rafb.net/p/e63f7j23.html Jul 19 00:04:34 kushal, check it Jul 19 00:04:38 ecntrk, that is not complete Jul 19 00:04:57 ria, good work Jul 19 00:05:04 anyone else ? Jul 19 00:05:05 :) Jul 19 00:05:20 kushal, ok... Jul 19 00:05:34 http://rafb.net/p/HCPV1o92.html Jul 19 00:05:47 ecntrk, you missed links Jul 19 00:06:12 Kkhushi_, nice code Jul 19 00:06:17 kushal, I found my mistake... Jul 19 00:06:28 ecntrk, just add few new lines Jul 19 00:06:55 kushal: ok... Jul 19 00:07:11 amrita, arpita Debashree bose_aritra ? Jul 19 00:07:23 ya Jul 19 00:07:41 kushal, yes i am doing Jul 19 00:07:47 Debashree, ok :) Jul 19 00:08:35 from now on, I will not teach very less, will ask you people to read and find stuffs Jul 19 00:09:40 :\ Jul 19 00:09:58 http://rafb.net/p/epD4bW86.html Jul 19 00:10:06 is it ok now kushal? Jul 19 00:11:05 ecntrk, what about links ? Jul 19 00:11:13 you only asked for file or directory... so i didn't do much. Jul 19 00:11:19 ecntrk, eh Jul 19 00:11:36 ok. i'll include that Jul 19 00:11:38 ecntrk, kushal> Ask user to enter a path and then the code will tell whether it is file or directory or link Jul 19 00:11:50 ecntrk, I told about link Jul 19 00:11:56 ah... i see.. sorry kushal Jul 19 00:12:19 no problem Jul 19 00:13:27 next, ask for a username, and show all details about that user, like real name, home directory etc Jul 19 00:13:36 http://rafb.net/p/OcfE7x14.html Jul 19 00:14:31 ecntrk, ok, also check the indentation Jul 19 00:14:54 amrita, arpita Debashree bose_aritra you people never asked anything , I will assume you never understood anything Jul 19 00:15:11 ok, i'm still not very keen at python syntax. Jul 19 00:15:19 I'm trying hard..:) Jul 19 00:15:20 ecntrk, any reason ? Jul 19 00:15:23 ok :) Jul 19 00:15:46 kushal: I missed your earlier classes... I was ill. Jul 19 00:17:05 ecntrk, ok Jul 19 00:17:21 hints : use pwd module for the above problem Jul 19 00:18:17 I am waiting Jul 19 00:18:56 ok Jul 19 00:21:10 * indradg (n=indradg@59.93.198.133) has joined #dgplug Jul 19 00:23:19 drunkencoder, kushal, acchis naki Jul 19 00:23:33 indradg, yes, pm Jul 19 00:24:54 so, anyone any solution ? Jul 19 00:25:11 any idea how we should go forward on this problem Jul 19 00:26:02 ya i think Jul 19 00:26:32 getpwuid(uid) all these will help to get the required Jul 19 00:26:42 there are 3 like that which returns Jul 19 00:26:55 pw_name, pw_dir etc Jul 19 00:26:58 i think so Jul 19 00:27:06 may I paste the code kushal? Jul 19 00:27:08 this i found after googling Jul 19 00:27:11 ecntrk, yes please Jul 19 00:27:16 http://rafb.net/p/eC1jTb25.html Jul 19 00:27:24 ria, I gave the link for the modules page in python Jul 19 00:27:36 that i have seen Jul 19 00:27:37 ria, try to read python documentation :) Jul 19 00:27:49 but was not able to understand the attribute part Jul 19 00:27:55 so i checked Jul 19 00:27:56 ok Jul 19 00:28:06 kushal, give your book link Jul 19 00:28:24 ria: Help(pwd) :) Jul 19 00:28:31 :) Jul 19 00:28:52 ecntrk, is it working ? Jul 19 00:28:59 ecntrk, I don't think so Jul 19 00:32:30 kushal, what will be the input? Jul 19 00:32:36 * amrita_ (n=amrita@117.201.98.125) has joined #dgplug Jul 19 00:32:40 * amrita_ has quit (Client Quit) Jul 19 00:32:40 kushal, will giving ria work? Jul 19 00:32:48 only ria? Jul 19 00:32:54 yes Jul 19 00:33:01 ria, only your username Jul 19 00:33:10 ok Jul 19 00:33:14 not working Jul 19 00:33:32 :) Jul 19 00:33:48 now working is better than not doing anything Jul 19 00:33:55 always :D Jul 19 00:34:21 kushal, it worked Jul 19 00:34:30 ria, so, show us the code Jul 19 00:34:51 kushal, i did in interpreter Jul 19 00:35:09 * ecntr1 (n=ecntrk_@117.194.0.133) has joined #dgplug Jul 19 00:35:38 sorry kushal a bug in previous problem... Jul 19 00:35:43 here's the new one.. Jul 19 00:35:45 http://rafb.net/p/og5j2C47.html Jul 19 00:35:50 sorry, got dc. Jul 19 00:35:52 kushal, http://rafb.net/p/JzyLYH13.html Jul 19 00:36:00 kushal, ^^ Jul 19 00:36:27 ria, correct , but just get that username from the user Jul 19 00:36:29 :) Jul 19 00:36:38 ok Jul 19 00:36:47 ecntr1, ok Jul 19 00:36:47 kushal: ^^ Jul 19 00:36:47 that i was just testing quickly Jul 19 00:36:53 that's why Jul 19 00:37:11 ok Jul 19 00:37:16 no problem Jul 19 00:38:08 http://rafb.net/p/3SsDSZ88.html kushal Jul 19 00:38:17 its user-defined now Jul 19 00:38:26 :) Jul 19 00:38:52 amrita, Debashree arpita are you getting what is going on ? Jul 19 00:39:06 kushal, little bit Jul 19 00:39:31 kushal, yes but still not quite sure with syntax in python Jul 19 00:39:43 kushal, i can't use pwd now because i am in xp now Jul 19 00:40:19 Debashree, oh, ok :) Jul 19 00:40:27 arpita, so ask what you want to know Jul 19 00:40:31 amrita, ask please Jul 19 00:41:06 kushal, i am doing the program Jul 19 00:41:29 amrita, ok Jul 19 00:41:49 arpita, tell us about your problem on the syntax Jul 19 00:41:58 arpita, I know its kind of new :D Jul 19 00:44:33 kushal, pwd.getpwnam(user) is showing error Jul 19 00:44:52 arpita, show us the error Jul 19 00:46:20 kushal, it worked now i had made a mistake Jul 19 00:46:22 * amrita_ (n=amrita@117.201.96.125) has joined #dgplug Jul 19 00:46:24 kushal, http://rafb.net/p/gh3Ahg83.html Jul 19 00:46:42 . Jul 19 00:46:42 am i online? Jul 19 00:46:51 ecntr1, no Jul 19 00:47:01 kushal, its taking time to understand as learning for the first time Jul 19 00:47:08 sorry kushal Jul 19 00:47:09 amrita_, ok, no problem Jul 19 00:47:21 ecntr1, no need to be sorry Jul 19 00:47:33 amrita_, just try and try again in the day time Jul 19 00:47:40 you all have to spend time Jul 19 00:47:49 kushal, yes i am trying Jul 19 00:48:09 amrita_, good :) Jul 19 00:48:34 kushal, :) Jul 19 00:48:59 kushal, i got it too Jul 19 00:50:20 ok Jul 19 00:50:23 next task Jul 19 00:50:36 http://rafb.net/p/MgtTmI43.html Jul 19 00:50:52 i hv givven the error i was gettin before too Jul 19 00:51:05 have Jul 19 00:51:13 Jul 19 00:51:33 yes kushal... Jul 19 00:52:03 now a difficult problem :p Jul 19 00:52:11 :-( Jul 19 00:52:12 :( Jul 19 00:52:15 :( Jul 19 00:52:19 :D Jul 19 00:52:20 :D Jul 19 00:52:21 :) Jul 19 00:52:42 * amritaaa (n=amrita@117.201.96.125) has joined #dgplug Jul 19 00:52:48 * amritaaa has quit (Client Quit) Jul 19 00:53:03 you all know all some sites show share values Jul 19 00:53:14 ? Jul 19 00:53:31 i dont know :( Jul 19 00:53:36 me too Jul 19 00:53:38 me not either. Jul 19 00:53:41 let me explain Jul 19 00:53:55 open http://finance.yahoo.com/ Jul 19 00:54:02 ok.. i got it. Jul 19 00:54:14 share market vaues.. Jul 19 00:54:19 l Jul 19 00:54:20 *values Jul 19 00:54:24 :) Jul 19 00:54:55 i see here Microsoft :) Jul 19 00:55:03 :P Jul 19 00:55:12 :) he he Jul 19 00:55:22 now you have to enter a company id there to see the latest share trade value Jul 19 00:55:44 o got it Jul 19 00:55:58 stil in vauge..:( Jul 19 00:56:07 type ibm there and click get quotes Jul 19 00:56:44 i did it already with tcs Jul 19 00:56:46 :P Jul 19 00:56:50 ria, :D Jul 19 00:57:02 ria: HMm.. Jul 19 00:57:26 done Jul 19 00:57:41 * amritaaa (n=amrita@117.201.96.88) has joined #dgplug Jul 19 00:57:43 ok, now you can see share details on IBM Jul 19 00:57:48 yes Jul 19 00:57:48 s/on/of Jul 19 00:57:55 the last trade value Jul 19 00:58:11 129.75:) Jul 19 00:58:16 * Soumya_ (n=Soumya@117.192.2.58) has joined #dgplug Jul 19 00:58:27 can any one tell me what is url it is accessing now ? Jul 19 00:58:51 * ecntrk has quit (Read error: 110 (Connection timed out)) Jul 19 00:59:07 http://finance.yahoo.com/q?s=ibm is it this? Jul 19 00:59:12 ria, correct Jul 19 00:59:19 :) Jul 19 00:59:20 everyone can see it ^^ Jul 19 00:59:20 ? Jul 19 00:59:25 yes Jul 19 00:59:26 finance.yahoo.com/q?s=ibm# Jul 19 00:59:27 ya Jul 19 00:59:31 yes Jul 19 01:00:00 so to see any other company's values, you just have to change the company code in the url Jul 19 01:00:03 like Jul 19 01:00:08 http://finance.yahoo.com/q?s=TCS.NS Jul 19 01:00:30 what that graph indicates?? Jul 19 01:00:35 kushal, ^^^^ Jul 19 01:00:42 growth of shares Jul 19 01:00:50 ok.. Jul 19 01:00:51 is it so, am i correct? Jul 19 01:01:02 ! Jul 19 01:01:09 http://finance.yahoo.com/q?s=WIT Jul 19 01:01:21 bose_aritra, no idea, and not on topic here Jul 19 01:01:24 ecntr1, yes Jul 19 01:01:30 do we need to know about streamapi of yahoo finance? Jul 19 01:01:36 Jul 19 01:02:09 no Jul 19 01:02:20 only the url how we access it Jul 19 01:02:25 amrita, arpita undertood ? Jul 19 01:02:34 * understood Jul 19 01:02:41 kushal, yes Jul 19 01:02:44 yes Jul 19 01:02:47 ok Jul 19 01:02:53 * amrita has quit (Read error: 110 (Connection timed out)) Jul 19 01:02:58 lets move on to the problem Jul 19 01:03:19 :( Jul 19 01:03:20 * amrita (n=amrita@117.201.96.88) has joined #dgplug Jul 19 01:03:25 * amritaaa has quit ("Leaving") Jul 19 01:03:28 bose_aritra, what ? Jul 19 01:03:40 kushal, cant we know more about shares Jul 19 01:03:45 :d Jul 19 01:03:48 hahaha Jul 19 01:03:49 kushal, it was fine Jul 19 01:03:51 :D Jul 19 01:03:54 :D Jul 19 01:03:55 :D Jul 19 01:03:57 bose_aritra, go somewhere else Jul 19 01:04:03 * indradg_ (n=indradg@59.93.255.38) has joined #dgplug Jul 19 01:04:05 bose_aritra, like IIM Jul 19 01:04:14 anyway back to the point Jul 19 01:04:17 nope.. proggraming's more interesting than finance Jul 19 01:04:41 there is a module called urllib2 Jul 19 01:04:46 anyway..carry on Jul 19 01:04:53 which will help you to work on urls Jul 19 01:04:55 *programming.. Jul 19 01:05:13 now the problem Jul 19 01:05:35 Ask the user about a company id (like WIT, IBM etc) Jul 19 01:06:05 then get the details from that page using urllib2 (only get , don't show the page) Jul 19 01:06:16 then show the value of the last trade Jul 19 01:06:25 ^^ that is it Jul 19 01:06:41 kushal, can you explain with an example please? Jul 19 01:06:50 ria, ok Jul 19 01:07:05 where do we get the information about functions to get these details?? Jul 19 01:07:10 ria, like I wrote a function called part1 Jul 19 01:07:35 so part1('WIT') will return 10.88 Jul 19 01:07:46 arpita, in the modules page Jul 19 01:07:53 kushal, o.k Jul 19 01:07:59 arpita, memorize docs.python.org :p Jul 19 01:08:04 arpita, for this case http://docs.python.org/lib/module-urllib2.html Jul 19 01:08:14 Debashree, you can also try this from windows Jul 19 01:08:33 kushal, ok :) Jul 19 01:10:23 * Soumya has quit (Read error: 110 (Connection timed out)) Jul 19 01:10:57 ok, some hints again Jul 19 01:11:03 to read a page Jul 19 01:11:05 do like Jul 19 01:11:25 link = urllib2.urlopen("http://dgplug.org") Jul 19 01:11:32 data = link.read() Jul 19 01:11:41 now data contains the webpage Jul 19 01:11:54 you just have to *find* the right data from it Jul 19 01:13:21 kushal tell me one thing, how to join 2 strings. Jul 19 01:13:33 ecntr1, + Jul 19 01:13:39 ecntr1, :p Jul 19 01:13:55 no.. i have 2 string variables.. a, b. Jul 19 01:14:00 how do i join them? Jul 19 01:14:06 only a+b? Jul 19 01:14:10 yes Jul 19 01:14:14 c = a + b Jul 19 01:14:41 ecntr1: power of python! Jul 19 01:14:41 ok Jul 19 01:14:48 :D Jul 19 01:14:59 * amrita_ has quit (Read error: 110 (Connection timed out)) Jul 19 01:16:23 * munichlinux (n=prashant@59.92.112.216) has joined #dgplug Jul 19 01:17:04 http://rafb.net/p/y9lLQ411.html Jul 19 01:17:17 is it right? i mean the main logic? Jul 19 01:17:47 let me check Jul 19 01:18:02 ok Jul 19 01:18:04 * kishanGoyal has quit (Read error: 113 (No route to host)) Jul 19 01:19:04 ecntr1, what is a ? Jul 19 01:19:17 a is the function parameter. Jul 19 01:19:23 ecntr1, you went up to some distance and then lost :p Jul 19 01:19:29 ecntr1, think think :p Jul 19 01:19:30 in where we'll take infosys as argument Jul 19 01:19:31 * amrita_ (n=amrita@117.201.96.27) has joined #dgplug Jul 19 01:19:42 ecntr1, in some variable Jul 19 01:19:44 ah.. Jul 19 01:19:55 like a, but you never did that :p Jul 19 01:20:17 and rest of the url , you already know Jul 19 01:20:22 * indradg has quit (Read error: 110 (Connection timed out)) Jul 19 01:20:29 try try Jul 19 01:20:29 kushal, ! Jul 19 01:20:31 yes....ss Jul 19 01:20:35 sorrry Jul 19 01:20:36 amrita_, yes please Jul 19 01:20:50 kushal, i did something Jul 19 01:20:54 amrita_, ok Jul 19 01:21:21 http://rafb.net/p/bqTP4639.html Jul 19 01:22:30 kushal, why are we writing data = none in last line? Jul 19 01:22:46 arpita, actually we don't need it Jul 19 01:22:56 ecntr1, data's default value is none Jul 19 01:23:06 ok kushal Jul 19 01:23:08 ecntr1, so you can just call it with url Jul 19 01:23:10 kushal, http://rafb.net/p/qD9TFi56.html Jul 19 01:23:22 can i approach in this way? Jul 19 01:23:30 kushal, little bit done Jul 19 01:23:31 kushal, http://rafb.net/p/jFb1fE36.html Jul 19 01:23:46 ria, yes, now you have to search the value required Jul 19 01:23:53 amrita, checking Jul 19 01:23:54 ya ya Jul 19 01:23:57 that i know Jul 19 01:24:00 i am doing Jul 19 01:24:41 amrita_, urllib2.urlopen("http://finance.yahoo.com/q?s=id") here id becomes a part of the string , not as a varible Jul 19 01:24:45 variable Jul 19 01:25:11 ok Jul 19 01:25:15 * munichlinux has quit (Read error: 60 (Operation timed out)) Jul 19 01:25:15 so kushal da.. was my program all right? Jul 19 01:25:21 amrita, not yet Jul 19 01:25:23 oops Jul 19 01:25:32 s/amrita/ ecntr1 Jul 19 01:25:53 indentation? Jul 19 01:26:36 * munichlinux (n=prashant@59.92.115.236) has joined #dgplug Jul 19 01:26:39 ecntr1, plus it is not solving the whole problem, write the rest of it Jul 19 01:26:59 ok. Jul 19 01:27:25 kushal, so there should be a "plus" before id? Jul 19 01:27:45 amrita_, don't think like that Jul 19 01:28:06 amrita_, think you have to add the value of id to the string, how you should do it Jul 19 01:28:11 amrita_, + only :) Jul 19 01:29:06 kushal, yes that only i meant Jul 19 01:29:12 amrita_, :D Jul 19 01:29:38 kushal: I didn't understand what else have to be written... Jul 19 01:30:09 ecntr1, you have to find the value of "Last Trade" from that page Jul 19 01:30:36 kushal, i did something and got a large html value Jul 19 01:30:45 perhaps the page source Jul 19 01:30:46 ria, yes, Jul 19 01:30:49 coorect Jul 19 01:31:35 http://rafb.net/p/9paFpk82.html kushal Jul 19 01:32:01 ria, yes, now don't print data, find the last trade value into that Jul 19 01:32:12 data is nothing but a string variable Jul 19 01:32:22 ok kushal Jul 19 01:32:31 but what will i actually do? Jul 19 01:32:34 return? Jul 19 01:32:44 I told Jul 19 01:32:45 kushal, ? Jul 19 01:33:02 * amritaaa (n=amrita@117.201.96.19) has joined #dgplug Jul 19 01:33:05 ria, like for WIT , you will return 10.82 Jul 19 01:33:21 kushal, ya Jul 19 01:33:45 brb Jul 19 01:35:30 kushal can we do like find the position of last trade in string data Jul 19 01:35:42 Kkhushi_, yes Jul 19 01:36:03 and then increment the index returned untill we find a digit Jul 19 01:36:06 * amritaa_ (n=amrita@117.201.96.73) has joined #dgplug Jul 19 01:36:54 i mean i have found the position of last trade using getitem Jul 19 01:37:18 Kkhushi_, that you figure out :o Jul 19 01:38:48 Kkhushi_, that is the tricky part :p Jul 19 01:40:16 * amritaa (n=amrita@117.201.96.43) has joined #dgplug Jul 19 01:41:13 * Soumya_ has quit (Read error: 110 (Connection timed out)) Jul 19 01:41:29 * amrita has quit (Nick collision from services.) Jul 19 01:42:32 * amrita (n=amrita@117.201.96.68) has joined #dgplug Jul 19 01:46:11 so any idea ? Jul 19 01:46:30 kushal: is request class has anything to do with? Jul 19 01:48:36 kushal, i could not do after that Jul 19 01:48:38 trying Jul 19 01:49:50 ecntr1, no, see how ria is doing Jul 19 01:50:01 ecntr1, Kkhushi_ got some idea Jul 19 01:50:02 * amrita_ has quit (Read error: 110 (Connection timed out)) Jul 19 01:50:34 kushal, is the data here link trade? Jul 19 01:50:42 or the value of link trade? Jul 19 01:50:43 I didn't understand...:( Jul 19 01:50:47 nope :( Jul 19 01:51:00 * amrita has quit (Read error: 104 (Connection reset by peer)) Jul 19 01:51:15 kushal, i am unable to understand how to get the value Jul 19 01:51:27 Kkhushi_, tell us what was your idea Jul 19 01:52:28 kushal as we have the html file as string in data Jul 19 01:52:49 we cah find the position of Last Trade in the string Jul 19 01:53:04 using .find() Jul 19 01:53:19 Kkhushi_, yes, correct Jul 19 01:53:26 but then i dont know what to do with it Jul 19 01:53:43 i mean i have some idea but it seems little clumsy Jul 19 01:53:46 * amritaaa has quit (Read error: 110 (Connection timed out)) Jul 19 01:54:15 Kkhushi_, yes, its ok, from that you can try to find a way to solve :p Jul 19 01:54:30 we can get the next 20 characters from the file from that position Jul 19 01:54:39 Kkhushi_, yes Jul 19 01:55:00 this will reduce our work string Jul 19 01:55:03 Kkhushi_, yes Jul 19 01:55:15 Kkhushi_, I followed almost the same way :p Jul 19 01:55:39 me too Jul 19 01:56:10 * amritaa_ has quit (Read error: 110 (Connection timed out)) Jul 19 01:56:45 Prakhar, :) Jul 19 01:56:49 kushal: can you please help me with find()? I don't know the syntax Jul 19 01:56:54 * Prakhar is now known as PR4KH4R Jul 19 01:56:54 Kkhushi_, please tell how do we find position of last trade in data using .find()?? Jul 19 01:56:59 ecntr1, help(str.find) Jul 19 01:57:07 ok Jul 19 01:57:17 arpita, help(str.find) Jul 19 01:57:20 :p Jul 19 01:57:28 guys, "help" Jul 19 01:57:34 i did the same help(str) Jul 19 01:57:56 * Debashree_ (n=Debashre@117.201.96.31) has joined #dgplug Jul 19 01:58:10 when kushal gave the hint that its a string now Jul 19 01:58:26 * Debashree has quit (Nick collision from services.) Jul 19 01:58:37 * Debashree_ is now known as Debashree Jul 19 01:58:42 help(str) Jul 19 01:58:52 oops sorry Jul 19 02:00:09 * amritaa has quit (Read error: 110 (Connection timed out)) Jul 19 02:00:49 * amrita (n=amrita@117.201.96.45) has joined #dgplug Jul 19 02:03:30 * amrita_ (n=amrita@117.201.96.110) has joined #dgplug Jul 19 02:03:57 Kkhushi_, in help(str.find).. S.find(sub [,start [,end]]) -> int what does sub mean over here? Jul 19 02:04:20 sub means substring we want to find Jul 19 02:04:32 arpita, ^^ written there :p Jul 19 02:05:00 start and end are indices which are optional Jul 19 02:05:33 kushal, can you please say me how to return... Jul 19 02:05:49 ria, return Jul 19 02:05:53 a string at any paricular position Jul 19 02:06:29 kushal, ^^ Jul 19 02:06:49 if the string is s Jul 19 02:06:50 then Jul 19 02:07:13 s[10:20] will give from 10th position to 19th position Jul 19 02:07:40 ya ok thanks Jul 19 02:07:46 i was searching just Jul 19 02:07:48 :) Jul 19 02:08:19 kushal can we just strip all the characters other than digits Jul 19 02:08:53 * amritaaa (n=amrita@117.201.96.101) has joined #dgplug Jul 19 02:09:29 Kkhushi_, yes Jul 19 02:09:58 kushal, is there a simple way to write it Jul 19 02:10:23 Kkhushi_, not much, you have to find a way Jul 19 02:10:33 Kkhushi_, I tried with some hard coded values : Jul 19 02:10:42 * amritas (n=amrita@117.201.96.93) has joined #dgplug Jul 19 02:11:43 kushal: I've used find to get the index of Last Trade in that html file Jul 19 02:11:49 kushal, i think i got it Jul 19 02:11:57 let me write the code and check Jul 19 02:12:02 ecntr1, yes Jul 19 02:12:15 but.. how do I strip any other values except integer? Jul 19 02:12:17 ecntr1, and then the value after that somehow Jul 19 02:12:27 i mean numbers.. Jul 19 02:12:27 ecntr1, that is the problem :p Jul 19 02:12:34 * amrita_ has quit (Read error: 104 (Connection reset by peer)) Jul 19 02:12:34 :( Jul 19 02:12:44 I'm stuck into that.. Jul 19 02:13:07 It seems like ria has got it..:) Jul 19 02:13:30 i have to code ecntr1 Jul 19 02:13:34 logic works Jul 19 02:13:55 :) Jul 19 02:17:38 kushal, Jul 19 02:17:43 ria, yes Jul 19 02:17:47 http://rafb.net/p/ipmvxQ34.html Jul 19 02:17:50 kushal, check it Jul 19 02:17:58 it is not working Jul 19 02:18:06 but the logic think is ok Jul 19 02:18:35 i used a small string with this logic and it works fine kushal Jul 19 02:18:50 kushal, i used the page source Jul 19 02:19:01 ria, logic is almost ok :) Jul 19 02:19:03 kushal, did you understand it? Jul 19 02:19:07 ria, try with http://finance.yahoo.com/q?s=TCS.NS Jul 19 02:19:11 ria, no :) Jul 19 02:19:28 kushal, i did x + 74 Jul 19 02:19:32 yes Jul 19 02:19:37 as i counted in page source Jul 19 02:19:50 how far is it from last trade Jul 19 02:20:04 i mean the value 10 Jul 19 02:20:15 ria, count count :p Jul 19 02:20:16 kushal, ^^ Jul 19 02:20:22 ya count Jul 19 02:20:22 this is a nice problem Jul 19 02:20:24 :p Jul 19 02:20:26 yeh.. but in my case.. not working Jul 19 02:20:39 ecntr1, its not working either Jul 19 02:20:40 kushal: shouldn't the solution be generic Jul 19 02:20:45 ria: you must have made some mistake counting.. Jul 19 02:20:51 kushal, but see it should work Jul 19 02:21:00 PR4KH4R, yes Jul 19 02:21:03 ecntr1, anyways it should show something Jul 19 02:21:05 yah ria.. Jul 19 02:21:16 ecntr1, actually not showing now Jul 19 02:21:32 * amrita has quit (Read error: 110 (Connection timed out)) Jul 19 02:21:32 ecntr1, otherwise i can change the values to get the desired Jul 19 02:21:37 ria: you'r logic is right.. just we have to count good..:) Jul 19 02:21:44 ecntr1, correct Jul 19 02:21:46 kushal, shouldn't it be located through programming Jul 19 02:21:50 kushal: so, hard coding the values like "74" should be discouraged Jul 19 02:21:57 Kkhushi_, yes Jul 19 02:21:58 ecntr1, ya i know the counting part is bad Jul 19 02:22:09 :) Jul 19 02:22:13 Kkhushi_, PR4KH4R but you can hard code some amount Jul 19 02:22:26 Kkhushi_, which will not effect any thing Jul 19 02:22:26 kushal, but in the page source a number is encountered earlier Jul 19 02:22:32 PR4KH4R: Mate.. you suggest a better way..:) Jul 19 02:22:52 ecntr1: thinking buddy :) Jul 19 02:22:59 so i could not wait for a number to come kushal Jul 19 02:23:00 PR4KH4R: we're working hard on it mate.. Jul 19 02:23:06 kushal, did you get that Jul 19 02:23:08 ? Jul 19 02:23:11 ria, no, Jul 19 02:23:19 ria, I am just waiting for a resultr Jul 19 02:23:22 PR4KH4R: and ria made a significant code.. Jul 19 02:23:32 kushal: :) Jul 19 02:23:45 as I am still in office Jul 19 02:23:46 :D Jul 19 02:23:59 kushal, can you say why is it not giving any output? Jul 19 02:24:03 ecntr1: yeah, right Jul 19 02:24:14 ria, no idea Jul 19 02:24:28 ria.. Jul 19 02:24:32 kushal, let me do in interpreter, it may work Jul 19 02:24:34 ria, what is the input Jul 19 02:24:35 ecntr1, :) Jul 19 02:24:38 ria, yes Jul 19 02:24:42 WIT Jul 19 02:24:44 ok Jul 19 02:24:53 i think you should assign a variable and then add 5 into it.. Jul 19 02:25:02 not data[a:5] Jul 19 02:25:14 ria, btw, you should paste without the line numbers, or else I can not test the code Jul 19 02:25:15 i mean aa=a+5 Jul 19 02:25:20 then data[a:aa] Jul 19 02:25:25 ya i know Jul 19 02:25:30 sorry kushal Jul 19 02:25:36 ecntr1, yes, just have to find a and aa : Jul 19 02:25:37 :p Jul 19 02:25:39 i was in a hurry to paste that's why Jul 19 02:25:46 ria, no problem :p Jul 19 02:25:54 :) Jul 19 02:25:57 ria, to disable nu in vi , :set nu! Jul 19 02:26:09 ya i always do that Jul 19 02:26:20 when i show something Jul 19 02:26:29 but now i am thinking only here Jul 19 02:26:30 :P Jul 19 02:29:21 * amritaaa has quit (Read error: 110 (Connection timed out)) Jul 19 02:30:24 kushal, when i did in interpreter it gave ' ' Jul 19 02:30:50 ok Jul 19 02:30:51 :p Jul 19 02:31:22 kushal, the logic is right i think, still not working Jul 19 02:31:27 :) Jul 19 02:31:31 kushal, http://rafb.net/p/nH3ecC83.html Jul 19 02:31:34 check it Jul 19 02:31:41 * amritas has quit (Read error: 110 (Connection timed out)) Jul 19 02:31:42 i removed the line numbers Jul 19 02:31:44 ria, then there is some problem in the logic :po Jul 19 02:31:46 the same code Jul 19 02:32:08 kushal, but i used a small string and it worked Jul 19 02:32:13 the last part Jul 19 02:32:47 ria, why you are sending data="Last Trade" ? Jul 19 02:33:24 kushal, it was working Jul 19 02:33:28 eh Jul 19 02:33:33 kushal.. i got it. Jul 19 02:33:44 kushal, it was giving the page source Jul 19 02:33:47 ria, don't do only if it is working Jul 19 02:33:48 earlier Jul 19 02:33:56 ok kushal Jul 19 02:34:00 ria, it may harm somewhere else Jul 19 02:34:06 ecntr1, tell Jul 19 02:34:09 rather shwo Jul 19 02:34:10 show Jul 19 02:34:17 kushal, should i remove the request part? Jul 19 02:34:22 kushal, ? Jul 19 02:34:33 you can Jul 19 02:34:33 http://rafb.net/p/xtKkLh21.html Jul 19 02:34:45 ok Jul 19 02:34:46 it's the experiment version.. it's working well Jul 19 02:35:06 wait for the more sophistication...:) Jul 19 02:35:16 hehe Jul 19 02:35:31 he he Jul 19 02:35:38 ecntr1, will it work with http://finance.yahoo.com/q?s=TCS.NS Jul 19 02:36:02 ecntr1: again "129" Jul 19 02:36:58 * munichlinux has quit ("Ex-Chat") Jul 19 02:37:09 anyway you all can solve this tomorrow also Jul 19 02:37:29 http://rafb.net/p/QWYPJJ36.html Jul 19 02:37:39 It's working well with IBM Jul 19 02:37:42 :) Jul 19 02:37:44 kushal, will link.read() give the page source? Jul 19 02:37:59 ecntr1, why did you use 129? Jul 19 02:38:12 kushal, ? Jul 19 02:38:16 ? Jul 19 02:38:18 129? Jul 19 02:38:19 will see you guys tomorrow Jul 19 02:38:22 ya Jul 19 02:38:26 oh Jul 19 02:38:27 going to do other works Jul 19 02:38:34 ok.. it's the last share value.. Jul 19 02:38:44 ok Jul 19 02:38:45 kushal: ok Jul 19 02:38:50 so bu the lowest index of it.. Jul 19 02:38:57 so you found that too:P Jul 19 02:38:58 *by Jul 19 02:39:03 kushal: see you tomorrow Jul 19 02:39:05 is it for all? Jul 19 02:39:09 ecntr1, ? Jul 19 02:39:12 I found out how many letters to strip. Jul 19 02:39:29 PR4KH4R, may be in Sunday Jul 19 02:39:30 last share value for all 129 ecntr1 ? Jul 19 02:39:38 on sunday Jul 19 02:39:41 kushal, ^^ Jul 19 02:39:43 yes Jul 19 02:39:46 * ecntr1 says thank you and good night kushal da Jul 19 02:39:49 wrong english Jul 19 02:39:50 :P Jul 19 02:39:51 bye all