473,388 Members | 1,209 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,388 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 987

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)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.