Softpedia
 


SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Koken 0.8.2
  • ContentBox 1.5.2
  • jQPlayer 0.5.2
  • SPOILER ALERT! 0.0.2
  • jQuery Mask Plugin 0.9.0
  • Easing Slider 2.1.2
  • Btapp.js 0.2.0
  • WiiFlash 0.4.5
  • Breeze.js 1.3.3
  • TinyMCE Templates 3.0.2
  • Home > Scripts > Text Management

    Evaluating code inside strings 1.0

    Download button


    Downloads: 313  Tell us about an update
    User Rating:
    Rated by:
    Good (3.2/5)
    15 user(s)
    Developer:

    Website:

    License / Price:

    Platforms:

    Databases:

    Language:

    Last Updated:

    Category:
    Joonas Paalasmaa | More scripts
    aspn.activestate.com
    Other Free / Open Source License - Python License 

    Windows / Linux / Mac OS / Solaris
    N/A
    Python
    June 4th, 2007, 09:30 GMT
    C: \ Text Management

     Read user reviews (0)  Refer to a friend  Subscribe

    Evaluating code inside strings description

    Evaluating code inside strings script allows you to manage strings.

    In this script, Eval's __getitem__ returns the result of eval(key). In Python, String and Unicode objects have one special operator: the % operator. With that operator, strings can be formatted with format codes.

    Formatting is given syntax format % values, where format is a string with format codes that are replaced with values. When value is any kind of mapping, formats must include parenthesis that contain a key. An item is fetched from directory with key or __getitem__ is overloaded with key. This solution can be useful because in order to do evaluations inside strings, they  must be constructed from many pieces.




    TAGS:

    strings code | text management | text tool | strings | code | tool

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM