User Profile

Collapse

Profile Sidebar

Collapse
dazzler
dazzler
Last Activity: Aug 27 '08, 10:43 AM
Joined: Nov 12 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dazzler
    started a topic wxpython: centering buttons with sizer

    wxpython: centering buttons with sizer

    Maybe the topic should be how to put background colors to sizers, but anyway...
    could anyone please help me, I need to have "background color for buttons", like in example blue & red, and then using sizers to center buttons... this task would be so easier if only I could set background color for boxsizer =p

    so please try to center these buttons with sizers without removing red&blue background
    [code=python]...
    See more | Go to post

  • dazzler
    started a topic wxpython: "background text" into MDI parent frame

    wxpython: "background text" into MDI parent frame

    How do I add "background text" into MDI parent frame, the text will be now erased if I move the MDI Parent frame, or I can also erase text with moving MDI Child frame, need to somehow refresh the text, how to do it?

    wx.FULL_REPAINT _ON_RESIZE style on MDI parent frame would help a little, but I would also need to call self.Layout() (and I still can erase the text moving child frame over the text...)

    [code=python]...
    See more | Go to post

  • dazzler
    started a topic wxpython - draw lines on image

    wxpython - draw lines on image

    I'm trying to draw line to an existing image, the problem is that the image doesn't update/refresh itself.

    In the example there's one button, but when pressing the button it changes the image but the image doesn't show up, and if I move other windows over my application window it will then refresh my application window and reveals the image.

    so what I'm trying to do is animating (moving) a line over existing image ...
    See more | Go to post

  • Just use Tkinter's filedialog =)
    google tkFileDialog for more dialog types

    [code=python]
    import tkFileDialog

    path_name = tkFileDialog.as ksaveasfilename (title="Save File", filetypes=[("Python Files",".py"),( "All Files",".*")])

    print "in the code, save your file to", path_name[/code]...
    See more | Go to post

    Leave a comment:


  • dazzler
    started a topic wxpython, updating plot (wx.lib.plot)

    wxpython, updating plot (wx.lib.plot)

    Hi! I just moved using wxpython so I'm a quite newbie.

    I was wondering how to update plotcanvas?
    In my code I made button with event to update plotcanvas with new results, but how to properly do it? because now when I press button it makes new "layer" into my GUI and doesn't delete the old plot. Should I first delete the old one and then create new plot, or just update old one, well either way I don't know how to do...
    See more | Go to post

  • dazzler
    replied to windows shortcut & relative pathnames
    forget about above ;)
    problem solved...
    the problem seemed to be with my installer script (NSIS)
    See more | Go to post

    Leave a comment:


  • dazzler
    started a topic windows shortcut & relative pathnames

    windows shortcut & relative pathnames

    I have used relative path names in my application:
    for example:
    logo_image = Image.open("./data/logo.png")

    everything has worked fine until now... I have compiled my code into exe and made installer, but if I make shortcut to windows desktop all those relative pathnames doesn't work anymore.

    what is a proper way to write path names?

    I can't write absolute path names either because...
    See more | Go to post

  • dazzler
    replied to Understanding bmp image files
    using putpixel with Image module could be one solution?

    here's one example which reads image and converts all red values which are over 50 to 255 =)

    [code=python]
    import Image

    pic = Image.open("tes t_bmp.bmp")

    x_size, y_size = pic.size

    for i in range(0,x_size) :
    for j in range(0,y_size) :
    pixel = pic.getpixel((i ,j)) #get color value in...
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to os.startfile and unknown file extension
    instead of
    [code=python]
    os.popen("Rundl l32.exe SHELL32.dll, OpenAs_RunDLL testfile.pdf")
    [/code]

    I tried
    [code=python]
    os.spawnl(os.P_ NOWAIT, os.environ['WINDIR']+"/system32/Rundll32.exe", "Rundll32.e xe SHELL32.DLL, OpenAs_RunDLL testfile.pdf")
    [/code]
    os.environ['WINDIR'] points to c:/windows or whatever the win installation directory is

    ...
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to os.startfile and unknown file extension
    ok, I have almost solved the problem

    [code=python]
    try:
    os.startfile("t estfile.pdf")
    except Expection, errorcode:

    if errorcode[0] = 1155:
    os.popen("Rundl l32.exe SHELL32.dll, OpenAs_RunDLL testfile.pdf")
    else:
    print "other error"
    [/code]

    this works but as you know os.popen stops python code and not resume...
    See more | Go to post

    Leave a comment:


  • dazzler
    started a topic os.startfile and unknown file extension

    os.startfile and unknown file extension

    I need to open PDF file with my python application, and I'm using os.startfile(fi lename.pdf) command, I would need open command act 100% like clicking the file in the windows explorer

    python documentation about os.startfile: "Start a file with its associated application. This acts like double-clicking the file in Windows Explorer, or giving the file name as an argument to the start command from the interactive command shell:...
    See more | Go to post

  • dazzler
    replied to Creating and sending a packet via a socket
    hmmh, try using pickle module , google for it ;)

    pickle the data, which converts it to string and then send it. and the receiver can unpickle it then from the string... I don't have tried pickle but I think that it might work like that...
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to USB events
    you should browse some pygame documentation.

    does the windows handle the device like joystick type device?
    if so, then this might help you http://www.pygame.org/docs/ref/joystick.html...
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to Set Excel cell to a value using Python
    could you please show us how have you opened this excel form...
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to Having trouble coding a beginner game
    [CODE=python].

    number = raw_input("Ente r a Number: ")
    if number < "1":
    print "invalid"
    if number > "100":
    print "invalid
    else:
    print "continue"

    [/CODE]

    instead of if number < "1":
    try this if number < 1:
    if you use "" it means that it is text not numbers...
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to Utmost noob question (i think)
    Hello hello

    [code=python]
    import os

    os.system("dir" )
    [/code]

    here's example sending dir command to command prompt :)
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to python socket programming...
    I think that you can't tell address who are you listening to, only the port what are you listening and that's enough

    when you have received message then you can block it if it's come from wrong ip address...
    See more | Go to post

    Leave a comment:


  • dazzler
    replied to Script to Search
    maybe zipfile module would be good way to start?
    http://docs.python.org/lib/zipfile-objects.html
    See more | Go to post

    Leave a comment:


  • hmmh... would it be possible to make invisible frames with events?
    maybe I'll put 100hidden frames and put events to them, so Tkinter would then handle actual collision detection
    hmmh, maybe that's bad idea... I don't know... :D
    See more | Go to post

    Leave a comment:


  • dazzler
    started a topic Tkinter - Bounding box - mouse cursor collision

    Tkinter - Bounding box - mouse cursor collision

    I have up to 100data points over 400x400pixel area, when the user would move mouse cursor over one point, the application would detect it and show additional information about it.

    I have all x,y coordinates saved in list ready for use

    ofcourse the area needed to activate the operation should be bigger than 1x1pixels, something like 5x5pixels maybe.

    but if there are 100 of these 5x5 pixel areas, how I'm...
    See more | Go to post
No activity results to display
Show More
Working...