time.strptime() and time.strftime() reciprocity

2009-02-16 Thread Greg Krohn
04:52 PM' So, yeah, that seems weird to me. Does anyone get similar results, know why this is happening, and/or how to fix it? Thanks. -- ("%...@gmail com" % "Greg Krohn".lower()).replace(" ", ".") -- http://mail.python.org/mailman/listinfo/python-list

Re: time.localtime() Format Question

2006-08-20 Thread Greg Krohn
OleMacGeezer wrote: > Hello Everyone, > Hola > (2006, 8, 19, 23, 39, 15, 5, 231, 0) > > Well, that obviously was not what I wanted or needed. I don't > need seconds, or whatever that is that follows after > seconds...And that isn't the format I wanted either. I'm sorry I didn't have time to gr

Re: same menu point is activated

2005-08-25 Thread Greg Krohn
OllieZ wrote: > Hi all > > Im trying to learn wxpython by some samples and Ive come across this. > After change EVT_MENU lines from > EVT_MENU(self, ID_OPEN, self.OnOpen) to > self.Bind(wx.EVT_MENU, self.OnOpen) It should be: self.Bind(wx.EVT_MENU, self.OnOpen, id=ID_OPEN)

Re: FAQ: __str__ vs __repr__

2005-06-15 Thread Greg Krohn
Basically __repr__ should return a string representaion of the object, and __str__ should return a user-friendly pretty string. So maybe: class Person: ... def __repr__(self): return '' % (self.name, self.age, self.sign) def __str__(self): return self.name See this for a bett

Re: Wxpython demo crashes

2005-06-07 Thread Greg Krohn
Pekka Karjalainen wrote: > I'm using WinXP (Finnish), Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC > v.1310 32 bit (Intel)] on win32 and wxPython 2.6.0.1. > > When I go to the Process and Events section in the wxDemo and run the > Process demo, bad things can happen. It crashes. I think the cras

Re: wxpython and wxtextctrl

2005-05-18 Thread Greg Krohn
Nicolas Pourcelot wrote: > Hello, > my script worked well until today : when I tried to launch it, I got the > following : > > frame = MyFrame(None,-1,"Geometrie",size=wx.Size(600,400)) > File "/home/nico/Desktop/wxGeometrie/version 0.73/geometrie.py", line > 74, in __init__ > self.com

Re: A Specific PyGame

2005-05-17 Thread Greg Krohn
Michael P. Nugent wrote: > I am looking for a specific "game" that is really a programming > environment for young kids. > > I believe it implements PyGame, and presents two windows: one is a grid > with some obstacles, and a character that must traverse the grid; > another is an interactive ed

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Greg Krohn
[EMAIL PROTECTED] wrote: > Hi all, > I wonder if it is possible to change (temporarily) a built-in function > for logging purposes. > Let me explain: > I want to log all the 'open' operations, recording the file to be > opened, the "mode" (r/w/a...) and (possibly) the module which made the > call.

Re: pygame on win32, image.fromstring()

2005-05-14 Thread Greg Krohn
tlviewer wrote: > hello, hi > fp = open( "e:/batch/python/aceclub.bmp", "wt") wt? Should this be wb? > # gives: ValueError: String length does not equal format and resolution size > img = gm.image.fromstring(str,(71,96),"P") The pygame docs say "P" is for 8bit pallete indices. When I look at t

Re: Launch file in Notepad

2005-05-12 Thread Greg Krohn
George wrote: > Newbie question: > > I'm trying to lauch Notepad from Python to open a textfile: > > import os > b1="c:\test.txt" > os.system('notepad.exe ' + b1) > > However, the t of test is escaped by the \, resulting in Notepad trying > to open "c: est.txt". > > How do I solve this? > > (

Re: wxwindows event function arguments

2005-04-07 Thread Greg Krohn
lotmr wrote: I have a windows launch bar application that sits in the system tray. What I want to do is when i click on a button in the launch menu, it calls the event which then calls 'OnLaunch('path')' this does not seem possible. When I change 'OnLaunch(self, event)' to 'OnLaunch(self, event, pa

Re: pygame.mixer.music not playing

2005-02-06 Thread Greg Krohn
Marian Aldenhövel wrote: Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pyg

Re: newbie wants to compile python list of filenames in selected directories

2005-02-06 Thread Greg Krohn
anthonyberet wrote: Hi, I am new at Python, and very rusty at the one language I was good at, which was BASIC. I want to write a script to compare filenames in chosen directories, on windows machines. Ideally it would compose a list of strings of all the filenames in the directories, and those

Re: PythonWin Not Updating

2004-12-14 Thread Greg Krohn
Robert Brewer wrote: Chris wrote: I'm working on a program in PythonWin. The problem I'm running into is that after I make a code change, PythonWin doesn't always see it. Has anyone else had this problem? "See it" in the interactive session? Use reload(): http://docs.python.org/lib/built-in-fun

Re: uptime for Win XP?

2004-12-11 Thread Greg Krohn
Tom Wesley wrote: Esmail Bonakdarian wrote: Hi, Is there a way to display how long a Win XP system has been up? Somewhat analogous to the *nix uptime command. Thanks, Esmail I believe that "uptime" works from the console, but don't have a machine to check it with... Doesn't work for me, but if yo

Re: Setting Focus in WxTextCtrl

2004-12-08 Thread Greg Krohn
LutherRevisited wrote: I know in .NET text boxes have a focus method which will do this, but I can't find anything similar in the places I've looked so far. wxPython does, in fact have such a method. It's called SetFocus. It's actually a wx.Window method, so all controls have it. hth greg -- http