What kind of program is this

Discussion in 'Python' started by John Smith, Oct 4, 2006.

  1. John Smith

    John Smith Guest

    what kind of program is this?
    I would like to know.

    import win32api
    from win32api import *
    import win32con
    from win32con import *; from string \
    import split

    aJAPy = 'C:/Program Files/Python/Lib/ \
    JAPy.py'
    if split(aJAPy,'.')[-1] in ('py','pyw'\
    ):
    aJAPy = "%s %s %s" % ('J' 'A' 'Py'\
    ,'','')

    aStyle = win32con.MB_ICONEXCLAMATION
    aLanguage = win32api.MAKELANGID \
    (LANG_NEUTRAL,SUBLANG_DEFAULT)

    win32api.MessageBox(0,'Just Another ' \
    + 'Pythoneer',aJAPy,aStyle,aLanguage)
     
    John Smith, Oct 4, 2006
    #1
    1. Advertisements

  2. A very badly written one... Did you try running it? Here's the clean
    version...

    -=-=-=-=-=-=-=-

    import win32api
    import win32con

    aJAPy = 'C:/Program Files/Python/Lib/JAPy.py'

    if aJAPy.endswith(".py") or aJAPy.endswith(".pyw"):
    ## aJAPy = "%s %s %s" % ('J' 'A' 'Py','','')
    # That should fail -- three format codes, and five output values
    aJAPy = "J A Py"

    aStyle = win32con.MB_ICONEXCLAMATION
    aLanguage = win32api.MAKELANGID(win32con.LANG_NEUTRAL,
    win32con.SUBLANG_DEFAULT)

    win32api.MessageBox(0,'Just Another Pythoneer',
    aJAPy,
    aStyle,
    aLanguage)
    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
     
    Dennis Lee Bieber, Oct 4, 2006
    #2
    1. Advertisements

  3. John Smith

    Peter Otten Guest

    No. 'JAPy' is a single string, oddly written:
    'JAPy'

    Peter
     
    Peter Otten, Oct 4, 2006
    #3
  4. Ack!... I'm not used to seeing implicit concatenation written on ONE
    line (especially not when they then went on to use a + concatenation for
    two literals later...)
    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
     
    Dennis Lee Bieber, Oct 4, 2006
    #4
  5. Fredrik Lundh, Oct 4, 2006
    #5
  6. John Smith

    skip Guest

    skip, Oct 4, 2006
    #6
  7. Wildemar Wildenburger, Oct 4, 2006
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.