Re: [ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
On Sun, Dec 21, 2008 at 12:48 PM, Parthan SR parth.technofr...@gmail.com wrote: Mir Nazim wrote: Hi guys, sorry for the off topic posting, but I know there are a couple of python guys on the list, so could not resist asking here Just a quick question. From next time, please join and ask it in a Python mailing list or a LUG list, until it is directly related to Ubuntu. Thank you. Hello Parth I understand that it is not related to Ubuntu list. That is why labeled it OT. I was stuck and thought its day time in India and had a better chance of getting reply. Thanks -- --- With Regards, Parthan technofreak gpg 2FF01026 blog http://blog.technofreak.in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
Re: [ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
Mir Nazim wrote: Hello Parth I understand that it is not related to Ubuntu list. That is why labeled it OT. I was stuck and thought its day time in India and had a better chance of getting reply Well, mailing lists exists to enhance discussion and mutual help between people interested on a topic. This mailing list caters to interests related to Ubuntu. For discussing or seeking help about a particular programming language, especially when it is a very generalized, language specific and unrelated to Ubuntu questions, it is better to be asked in the mailing list catering to that particular programming language or in a wide-topic mailing lists like LUGs. It's not just because it is not ON TOPIC here, but also because the chance of [1] getting a meaningful reply, [2] involving a discussion of people having more clue about it and [3] of the question and it's reply helping people searching for the same at future instance and finding it, is more in such a mailing list than here. If you're looking for quick reply, you should rather be jumping to #python and getting it sorted out. Thanks. -- --- With Regards, Parthan technofreak gpg 2FF01026 blog http://blog.technofreak.in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
Re: [ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
Aye Aye Captin I understand. You are doing a great work as moderator. Mir Nazim Cell: +91 9469071855 Blog: http://saunzal.org Company:http://www.ikraftsoft.com On Sun, Dec 21, 2008 at 3:03 PM, Parthan SR parth.technofr...@gmail.com wrote: Mir Nazim wrote: Hello Parth I understand that it is not related to Ubuntu list. That is why labeled it OT. I was stuck and thought its day time in India and had a better chance of getting reply Well, mailing lists exists to enhance discussion and mutual help between people interested on a topic. This mailing list caters to interests related to Ubuntu. For discussing or seeking help about a particular programming language, especially when it is a very generalized, language specific and unrelated to Ubuntu questions, it is better to be asked in the mailing list catering to that particular programming language or in a wide-topic mailing lists like LUGs. It's not just because it is not ON TOPIC here, but also because the chance of [1] getting a meaningful reply, [2] involving a discussion of people having more clue about it and [3] of the question and it's reply helping people searching for the same at future instance and finding it, is more in such a mailing list than here. If you're looking for quick reply, you should rather be jumping to #python and getting it sorted out. Thanks. -- --- With Regards, Parthan technofreak gpg 2FF01026 blog http://blog.technofreak.in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
Re: [ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
Mir Nazim wrote: Aye Aye Captin I understand. You are doing a great work as moderator. LOL. Well, my duty is make sure all discussions are to the best interest and to the purpose of this mailing list. When there is a better place to carry discussions which doesn't concur to the purpose of this list, I just make efforts people to understand the same. Some people take in the right way, some people get offended a bit. But, am just doing my duty ;) -- --- With Regards, Parthan technofreak gpg 2FF01026 blog http://blog.technofreak.in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
[ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
Hi guys, sorry for the off topic posting, but I know there are a couple of python guys on the list, so could not resist asking here Just a quick question. For example I have class X pass Then I do x = X() x.name = 'Nazim Now my question is whether something like below is possible and how y = 'name' print x.y # How can x.y can be evaluated to x.name PS: In PHP this can be done by a $x-$y. I sure there is some way in Python also, just don't seem to remember/find it right now. Thanks in advance. Mir Nazim Cell: +91 9469071855 Blog: http://saunzal.org Company:http://www.ikraftsoft.com -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
Re: [ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
On Sun, Dec 21, 2008 at 12:21, Mir Nazim mirna...@gmail.com wrote: Hi guys, sorry for the off topic posting, but I know there are a couple of python guys on the list, so could not resist asking here Just a quick question. For example I have class X pass Then I do x = X() x.name = 'Nazim Now my question is whether something like below is possible and how y = 'name' print x.y # How can x.y can be evaluated to x.name You can use: print x.__dict__[y] It will have the same result as: print x.name -- Aditya Manthramurthy -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
Re: [ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
Mir Nazim wrote: Hi guys, sorry for the off topic posting, but I know there are a couple of python guys on the list, so could not resist asking here Just a quick question. From next time, please join and ask it in a Python mailing list or a LUG list, until it is directly related to Ubuntu. Thank you. -- --- With Regards, Parthan technofreak gpg 2FF01026 blog http://blog.technofreak.in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in
Re: [ubuntu-in] OT: Evaluate an string variable's value to a variable in Python
Thanks Aditya. Mir Nazim Cell: +91 9469071855 Blog: http://saunzal.org Company:http://www.ikraftsoft.com On Sun, Dec 21, 2008 at 12:45 PM, Aditya M adity...@gmail.com wrote: On Sun, Dec 21, 2008 at 12:21, Mir Nazim mirna...@gmail.com wrote: Hi guys, sorry for the off topic posting, but I know there are a couple of python guys on the list, so could not resist asking here Just a quick question. For example I have class X pass Then I do x = X() x.name = 'Nazim Now my question is whether something like below is possible and how y = 'name' print x.y # How can x.y can be evaluated to x.name You can use: print x.__dict__[y] It will have the same result as: print x.name -- Aditya Manthramurthy -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in -- ubuntu-in mailing list ubuntu-in@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-in