First script. Need some help

L

ledpepper

#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
 
M

MRAB

ledpepper said:
#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.
 
M

Mark Lawrence

#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
 
D

Dave Angel

ledpepper said:
#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
 
L

ledpepper

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top