473,289 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Shed my a light :)

Hi,
I using eval for quite strange reason, as long as I don't know a different
way to implement.

An example:

actions= ('print', 'sum', 'divide', 'myfunction')
parameters=(5, 'nothing',5.63, object)

for routines in actions:
routines(parameters)

I'd like to note that actions are string or string expressions of the program
functions or python itself, so I've in my program something like:

for nn in actions:
eval('cp.%s' %nn)

Where cp is an instance.

So I'm asking here whether exist a way that these string become functions
inside my program, without using eval()

--
Mailsweeper Home : http://it.geocities.com/call_me_not_now/index.html
Jun 2 '08 #1
0 982

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Dufour | last post by:
>> Hehe. Okay. It will probably always be the case that you have to lose >> some Python features if you want the code to run really fast. I >> suppose PyPy's restricted Python subset doesn't...
0
by: Mark Dufour | last post by:
Hi! Shed Skin 0.0.2 is up on SourceForge. It should install easily under Windows 2000/XP and OSX. Please give it a try and let me know if there are still some problems. If you would like to...
1
by: Mark Dufour | last post by:
Hi all, Thanks to the people trying out Shed Skin 0.0.2 and letting me know about several problems they encountered. I have released an updated version, 0.0.3. It contains some fixes, adds...
0
by: Mark Dufour | last post by:
Hi all, I have just released Shed Skin 0.0.5. It fixes many bugs and adds many minor features to the Python builtins, most notably, the 'set' class. There have also been some optimizations on...
1
by: Mark Dufour | last post by:
Hello Python lovers, I have just released Shed Skin 0.0.5.9. It's almost where I want it to be for 0.0.6. What remains to be coded is some kind of connection to the standard library (probably a...
18
by: Chris Hills | last post by:
A lesson in Posting How many C.L.C group posters does it take to change a C light bulb? 1 to change the light bulb and to post that the light bulb has been changed 14 to share similar...
0
by: Mark Dufour | last post by:
Hi all, After getting bogged down with work for a few months, I'm finally back to Shed Skin development. I have just released 0.0.15, with the following changes: -python2.5...
31
by: Mark Dufour | last post by:
Hi all, I have recently released version 0.0.20 and 0.0.21 of Shed Skin, an optimizing Python-to-C++ compiler. Shed Skin allows for translation of pure (unmodified), implicitly statically typed...
0
by: Mark Dufour | last post by:
Hi all, I've just released Shed Skin 0.0.25. Together with the (unannounced) 0.0.24 release, there have been some interesting changes. Most importantly perhaps, Shed Skin now caches (most)...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.