#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    330
    Rep Power
    14

    How can I start using PyWin?!


    Hello,

    I am an intermediate Python programmer and have been using the console so far for running my programs. I have recently installed the PyWin32 and the only thing I know about it is that it gives me a GUI interface for running my scripts. But I don't know how to start using it. The only thing I know is where it's installed! Could you please give me a small example as to have a start on it?

    Thanks alot.
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    I guess you mean how do you use the Win32 package? The Win32 extensions allow you to interact with Microsoft operating system facilities.

    Check out the
    C:\Python23\Lib\site-packages\win32\Demos
    directory for examples.

    grim
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    There's also a very good book on using Python with Windows from O'Reilly called "Python Programming on Win32". Definatly worth a look if you're going to be going down this path.

    Mark.
    programming language development: www.netytan.com Hula

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    34
    Originally Posted by sam_kh918
    Hello,

    I have recently installed the PyWin32 and the only thing I know about it is that it gives me a GUI interface for running my scripts.
    Sorry, but it doesn't - it provides an interface to the Windows API, things like COM clients and servers, getting handles to open windows, event logs, using NT file APIs to read and write files, changing security settings, and so on. It's useful, but not for that.

    If you want a GUI to develop graphical applications instead of command line only ones, then you need to look at one of these;

    tKinter - installed with Python, but a bit dated. http://www.pythonware.com/library/tkinter/introduction/

    wxPython - www.wxpython.org

    GTK - http://www.pygtk.org/

    PythonCard (runs with wxPython but simplifies it) - http://pythoncard.sourceforge.net/

    Browsing their sites will show you introductions and tutorials, but none are as simple as "a GUI interface for running scripts", they need programs written specifically to use them, which can take more than double the effort of a simple command line program - involving creating windows, creating buttons and textboxes, adding code to handle clicks and typing, resizing, etc.
  8. #5
  9. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Actually it does, though it's been a very long time since I've used it: the winPytho IDE. See the ActivePython homepage for a quick list of some of the things the Win32all extensions provide.

    http://www.activestate.com/Products/ActivePython/

    Mark.
    programming language development: www.netytan.com Hula

  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    34
    Originally Posted by netytan
    Actually it does, though it's been a very long time since I've used it: the winPytho IDE. See the ActivePython homepage for a quick list of some of the things the Win32all extensions provide.

    http://www.activestate.com/Products/ActivePython/
    PythonWin is an 'IDE' in the sense that IDLE is - it's a shell and text editor with debugging in a GUI, rather than something that allows you to create GUIs such as VB or Delphi.

    I suppose it could be "a GUI interface for running my scripts", but why would you want to launch command line scripts from a shell in a GUI? And why install PythonWin especially for it when IDLE does that? And it appears in the start menu so it's not exactly so hard to find that you need to ask other people.

    Well anyway, PyWin32 is a good extension to have, and "Python Programming on Win32" is a good book to go with it.
  12. #7
  13. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    ...Well anyway, PyWin32 is a good extension to have, and "Python Programming on Win32" is a good book to go with it...
    If you're using windows that is . Otherwise it's just kinda anoying since it makes it harder to help lol.

    Anyway, like I said, It's been a while since I've used WinPythons IDE. But there's obviously more to it than you would expect i.e. it can help you get going with COM, right from the menu.

    It also has a bunch of editor features that IDLE doesn't have yet, and menu's tend to be layed out differently. So there are a few changes that you need to get used to (especially if you're coming from the command line). Whether or not you need help with that, I guess depends on the person.

    Later,

    Mark.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo