First script. Need some help

Discussion in 'Python' started by ledpepper, May 27, 2010.

  1. ledpepper

    ledpepper Guest

    #Enter in firstname.lastname (bob.smith)
    #Count the amount of letters(x) and vowels(y)
    #Then work out if bob is > but not equal to 6 letters
    #If firstname is less than 6 print firstnamesurnamexy
    #If firstname is equal to or greater than 6 print firstnamexy
    #Copy result to clipboard

    http://codepad.org/Emzpix3H

    I think you can see what i'm trying to do here. I will definitely
    elaborate if anyone needs me to.

    Thanks
    ledpepper, May 27, 2010
    #1
    1. Advertising

  2. ledpepper

    MRAB Guest

    ledpepper wrote:
    > #Enter in firstname.lastname (bob.smith)
    > #Count the amount of letters(x) and vowels(y)
    > #Then work out if bob is > but not equal to 6 letters
    > #If firstname is less than 6 print firstnamesurnamexy
    > #If firstname is equal to or greater than 6 print firstnamexy
    > #Copy result to clipboard
    >
    > http://codepad.org/Emzpix3H
    >
    > I think you can see what i'm trying to do here. I will definitely
    > elaborate if anyone needs me to.
    >

    You need to download and install the Windows-specific extensions:

    http://sourceforge.net/projects/pywin32/

    I'm assuming you're using Python 2.6 on Windows.
    MRAB, May 27, 2010
    #2
    1. Advertising

  3. On 27/05/2010 19:41, ledpepper wrote:
    > #Enter in firstname.lastname (bob.smith)
    > #Count the amount of letters(x) and vowels(y)
    > #Then work out if bob is> but not equal to 6 letters
    > #If firstname is less than 6 print firstnamesurnamexy
    > #If firstname is equal to or greater than 6 print firstnamexy
    > #Copy result to clipboard
    >
    > http://codepad.org/Emzpix3H
    >
    > I think you can see what i'm trying to do here. I will definitely
    > elaborate if anyone needs me to.
    >
    > Thanks


    Have you installed the Win32 extensions?

    From http://www.devx.com/opensource/Article/37233/0/page/3

    "Author's Note: the win32clipboard module is not part of the standard
    Python distribution on Windows. You can get it (along with lots of other
    comprehensive Python bindings to Win32 APIs) as part of the Win32
    extensions project on SourceForge. Alternatively, the module is also
    bundled with the ActivePython distribution for Windows."

    HTH.

    Mark Lawrence
    Mark Lawrence, May 27, 2010
    #3
  4. ledpepper

    Dave Angel Guest

    ledpepper wrote:
    > #Enter in firstname.lastname (bob.smith)
    > #Count the amount of letters(x) and vowels(y)
    > #Then work out if bob is > but not equal to 6 letters
    > #If firstname is less than 6 print firstnamesurnamexy
    > #If firstname is equal to or greater than 6 print firstnamexy
    > #Copy result to clipboard
    >
    > http://codepad.org/Emzpix3H
    >
    > I think you can see what i'm trying to do here. I will definitely
    > elaborate if anyone needs me to.
    >
    > Thanks
    >
    >

    Why bother using codepad for this? The problem occurs parsing the 3rd
    line, so you only needed that and the traceback.

    Have you installed the Win32 extensions? If you think you have, can you
    find the file ?

    C:\ProgFiles\Python26\Lib\site-packages\win32\win32clipboard.pyd

    Naturally, your install directory may be different. But it should be in
    the site-packages directory, which is where add-ons are installed.

    DaveA
    Dave Angel, May 27, 2010
    #4
  5. ledpepper

    ledpepper Guest

    Thanks Everyone. I followed your instructions and my script is
    successfully copying the result to the clipboard. Now for the fun. To
    work out the rest of the script :)

    I use the IDLE IDE and not codepad.org. I just thought that was the
    standard for pasting scripts here in this group.

    Thanks all.
    ledpepper, May 28, 2010
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    666
    Guest
    Feb 25, 2004
  2. ThLog
    Replies:
    6
    Views:
    350
    Travis Newbury
    Mar 2, 2006
  3. Domino
    Replies:
    5
    Views:
    371
    dorayme
    Nov 5, 2006
  4. McCann, Brian
    Replies:
    1
    Views:
    250
    Bjoern Schliessmann
    Oct 20, 2007
  5. Jesse Crockett
    Replies:
    5
    Views:
    75
    عمر ملقب بالثانی
    Jul 11, 2008
Loading...

Share This Page