473,387 Members | 1,545 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,387 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 986

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.