Re: [docs] Defining new keyword (extension of default keywords) in Python 3.3.2
![](https://secure.gravatar.com/avatar/c2dfd679b7f3fbe8de8b22199b86f2a1.jpg?s=120&d=mm&r=g)
I did some research and found this article maybe of use, http://stackoverflow.com/questions/2315044/how-to-generate-a-module-object-f... Thus, I followed the example but not successful. The screen-dumps below illustrate the problem (iii) in my last message. Can you advice what's the right syntax for exec in this case ? From: George G ADVANI/HBAP/HSBC To: docs@python.org Date: 08/15/2013 11:08 AM Subject: Defining new keyword (extension of default keywords) in Python 3.3.2 Hi team, Actually this is not a bug but a question. I started using Python recently on building prototype analytics. FYI, my Python version is 3.3.2 & I used IPython/WinPython in development. Basic packages are all installed, e.g. numpy version is 1.7.1 scipy version is 0.12.0 Path & PythonPath settings as below:- My question is related to this thread somebody posts on adding new keywords in Python. http://stackoverflow.com/questions/214881/can-you-add-new-statements-to-pyth... Looking at the suggestions, there are couple of ways to achieve this and I prefer this way since it sounds easiest:- However, I cannot simply use these statements owing to the following reasons:- (i) the new package is replaced by Types package; (ii) In the Types Package (checking on documentation), there is nothing like types.module( ....). How to re-write the statements ? (iii) When I execute this line exec data in mod.__dict__ I got message like syntax error highlighting the word "data" My understanding is that this support group is runned on voluntary basis. Grateful if somebody may help and revert with valid examples that can run on Python 3.3.2. Thx & Rgds, George Advani ----------------------------------------- ******************************************************************* This e-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return e-mail. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. ******************************************************************* "SAVE PAPER - THINK BEFORE YOU PRINT!"
participants (1)
-
georgegadvani@hsbc.com.hk