User Profile

Collapse

Profile Sidebar

Collapse
Hackworth
Hackworth
Last Activity: Oct 13 '09, 06:26 PM
Joined: Aug 26 '09
Location: Louisville
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hackworth
    replied to classes and wx python
    I think this should help. It is a small demo of wxPython using OOPish concepts.

    http://colinbarnette.net/code/wxdemo.py

    Code:
    #!/usr/bin/python
    import wx
    
    class MainFrame(wx.Frame):
        def __init__(self, parent, ID, title, pos=wx.DefaultPosition,
                     size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE):
            wx.Frame.__init__(self, parent, ID, title, pos, size, style)
    ...
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to tabbing between textctrl's
    I'm not entirely positive but I think this has much to do with your other question about classes. And it makes it a little difficult to answer your question. Take a look at this code and I think you will understand the differences.

    Note this isn't perfect code (what is really?) but it should suffice as an example.

    I hope it helps!

    Code:
    import wx
    
    class AddLocationDlg(wx.Dialog):
    ...
    See more | Go to post
    Last edited by Hackworth; Sep 20 '09, 03:34 PM. Reason: Couple afterthoughts.

    Leave a comment:


  • Hackworth
    replied to tabbing between textctrl's
    I feel that it might be easier to help you if you can show us some example code.
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to classes and wx python
    """
    Okay, I'm not an expert with OOP myself, but I am a wxPython user and I do use classes. A very small sample code to work with for a bit of explanation. A simple class definition follows:
    Code:
    class MyObject(object):
        def __init__(self, argument):
            self.arg = argument
    The first line defines our class 'MyObject'. The value inside the parentheses is the object that our class...
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to simple XML question
    I'm not familiar with XML myself but I think this should get you started.

    Using xml.dom.minidom (http://docs.python.org/library/xml.dom.minidom.html) you can parse a file which should return a Document object which is documented here. You can then (I believe) use the Document methods to grab elements and values and the like.

    Hope this helps!
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to what is the python script?
    Not sure how to answer this question as it is so vague (and helpless I might add..)

    Let me Google that for you.. http://lmgtfy.org/?q=python+backup+script

    Seriously though I would imagine you would need to write a script that copies the structure and all entries in your source directory to your target directory. This might be accomplished with a look at the os and the os.path modules, specifically os.walk() and/or ...
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to Printing with wxpython
    I think you will find everything you need in the Miscellaneous > PrintFramework section of the wxPython Demo. I know you said you 'can't grasp' the demo, but did you look in this section? It details the process and all classes used in printing and previewing. I wish I could detail more of the process but I don't have a printer and therefore can't experiment!

    Be patient with the code (and yourself) and try not to opt for easy or...
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to Write with first argument as an int.
    Write it to the file as a string, when you read it back, cast it as an int()?

    On the other hand if you really do want to save a data type to a file, I suggest you check the Python manual for the pickle module. Example:

    Code:
    import pickle
    
    def write(data, outfile):
        f = open(outfile, "w+b")
        pickle.dump(data, f)
        f.close()
    
    def read(filename, "r+b"):
    ...
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to display memory usage in process
    Well I googled it, and if you are on a Unix-based system you are in luck!

    Check out the resource module.

    Unfortunately, I could not find... an 'official' way to check memory usage in Windows. http://lmgtfy.org/?q=python+memory+usage+in+windows

    Hope this helps!
    See more | Go to post

    Leave a comment:


  • Hackworth
    replied to [Python+glade] why need two arguments?
    I'm not entirely sure about this as I am a wx user not a gtk user, however, it looks as though gtk_widget_dest roy is an event/signal. Of course the first argument is self, while the second (as micmast said) is usually an instance of the widget that called it.

    This is useful for various things, for example if the user entered some data in a dialog, with this method, as it is destroyed you could look up the value of the data entered...
    See more | Go to post
    Last edited by Hackworth; Aug 28 '09, 02:25 PM. Reason: Added link for docs

    Leave a comment:


  • Hackworth
    replied to What is your OS and Python Version
    Howdy all!

    Python 2.5 on Gentoo and Windows XP. I mostly work on XP with wxPython in IDLE. I test/debug with the Windows shell, having added my working directories and .py to the Path and PATHEXT environment variables. This allows me to easily test my wx apps (and pygame, occasionally) without having the side-effect of IDLE crashing, or having trouble accessing the wx.App. I recommend the process to the Windows users out there as...
    See more | Go to post

    Leave a comment:


  • You should be able to use:
    Code:
    l__get_password = password.GetValue()
    Here's a link to the docs for wx.TextCtrl.Get Value()
    Hope this helps!
    See more | Go to post
    Last edited by Hackworth; Aug 26 '09, 04:37 PM. Reason: Added doc link.

    Leave a comment:

No activity results to display
Show More
Working...