Re: More baby squeaking - iterators in a class

2004-12-31 Thread M.E.Farmer
lf.d, self.i >while i>0: >i-=1 >yield d[i] >>>> p=R3('eggs') >>>> for i in p: >>>>print i I am asking because I want to fully understand what makes an *iterator*. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a search string

2004-12-31 Thread M.E.Farmer
Ah! that is what the __future__ brings I guess. Damn that progress making me outdated ;) Python 2.2.3 ( a lot of extensions I use are stuck there , so I still use it) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a search string

2004-12-31 Thread M.E.Farmer
split on "farmer john". M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: More baby squeaking - iterators in a class

2004-12-31 Thread M.E.Farmer
... print i ... y t r e w q Ok I don't see __getitem__ anywhere in this object. Still scratchin my head? Why does this work? M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame + py2exe = bad exe. why?

2004-12-31 Thread M.E.Farmer
it down. Have you been succesful in making the changes they mentioned? M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: spacing of code in Google Groups

2004-12-31 Thread M.E.Farmer
ent me a reply saying they appreciated my feedback. Maybe they just need more feedback :) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: The Industry choice

2004-12-31 Thread M.E.Farmer
I am drawing a blank right now. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: More baby squeaking - iterators in a class

2004-12-31 Thread M.E.Farmer
'r' py> a.next() 'e' py> a.next() 'w' py> a.next() 'q' py> a.next() Traceback (most recent call last): File "", line 1, in ? StopIteration >>> Doh! ok now I get it __iter__ RETURNS a generator ;) It seems so obvious now I look at

Re: Help with saving and restoring program state

2005-01-25 Thread M.E.Farmer
so another idea is to use a class instead of a global. I'll admit it I have a personal distaste for them, but classes work so well I never miss them. Py>class Store(object): ...pass Now just create an instance and add your attributes. Py>store = Store() ...store.color = 'red' ...store.height = 5.7 ...store.secret = 42 And get them back when needed. Py>self.SetHieght(store.hieght) Hth M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-25 Thread M.E.Farmer
e a problem with your managment and communication skills. > so I prefer preemptively dealing with issue of everyone showing off their OO > design skills) Work on that micro-management just a little bit more, that gets the code flowing ;) hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-25 Thread M.E.Farmer
look good and help them do it. This advice holds true for every field I can think of. Ignorance can be remedied with a book , but apathy sometimes needs a swift kick in the ass. Hope you do well, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Inherting from object. Or not.

2005-01-26 Thread M.E.Farmer
rpreter promt: Py> class NewKlass(object): ... pass Py> class OldKlass: ... pass Py> new = NewKlass() Py> old = OldKlass() Py> print dir(new) Py> print dir(old) Also new style classes are faster. Hth, M.E.Farmer Frans Englich wrote: > (Picking up a side track of the "

Re: Disassembling strings and turning them into function parameters

2005-01-30 Thread M.E.Farmer
'other_function_name_here': ...return 'your other action here' ...else: ...return None Py>ftpconnect = StrFtp("connect 123.123.123.123 21 user password") Also add asserts and error checking all through the code for malformed input. hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with loading textfiles into dictionaries.

2005-01-30 Thread M.E.Farmer
know search for 'python pickle module'. examples abound but here it is anyway: Py> import pickle Py> # Pickle a dictionary Py> f = open('/tmp/mydata', 'wb') Py> f.write(pickle.dumps(yourdict) Py> f.close() Py> # and it is easy to get back as well Py> f = open('tmp/mydata', rb') Py> pdata = f.read() Py> f.close() Py> yourdict = pickle.load(pdata) hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: web camera or else ? 15-30 fps processing of camera videos.

2005-02-01 Thread M.E.Farmer
he images from > the tv receiver card in real time using my > own software. > > Do you use Java? > > John Casey Ever do search on Google? This was number 1 and 2 ;). I searched for "python video capture". I have used this module and it works well, it also has a really nifty ftp uploader demo script. http://videocapture.sourceforge.net/ hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: global variables

2005-02-02 Thread M.E.Farmer
to it. And use it anywhere you need it. Py> globals.image_height = (255,777) Py> globals.image_mode = 'RGB' Py> globals.image_names = ['this.jpg', that.jpg'] etc... hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: global variables

2005-02-02 Thread M.E.Farmer
Steve, Yes I agree ;) Never use builtin names. I know better but missed it somehow. I apologize for any confusion I may have caused. Thank you Steve for the correction. M.E.Farmer Steven Bethard wrote: > M.E.Farmer wrote: > > alex wrote: > >> is it possible to create 'glo

Re: global variables

2005-02-02 Thread M.E.Farmer
Ok it has been a long day, In my reply to Steven Bethard , Steve should read Steven ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: advice needed for simple python web app

2005-02-03 Thread M.E.Farmer
thor still answers questions. Cherrypy2 is fairly logical and most of it is covered in the examples on there website. I can not speak for the other packages,have not used them yet ;) hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: why are LAMP sites slow?

2005-02-03 Thread M.E.Farmer
ound-color:#11;} hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: why are LAMP sites slow?

2005-02-03 Thread M.E.Farmer
ound-color:#11;} hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: why are LAMP sites slow?

2005-02-03 Thread M.E.Farmer
ound-color:#11;} hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: why are LAMP sites slow?

2005-02-03 Thread M.E.Farmer
ound-color:#11;} hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: why are LAMP sites slow?

2005-02-04 Thread M.E.Farmer
ioned it. Overall I agree with your statement you *should* not nest div inside of span, BUT... Div *can* be nested inside a span. I just tried it in Firefox , I.E. , and Opera to be sure and it does work ;) Probably not w3c compliant though. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread M.E.Farmer
Hello Bo, Don't use dict it is a builtin ;) Also try this stuff out in an interpreter session it is easy and fast to get your own answers. >>> def fun(d): ... __dict__ = d ... return __dict__ hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread M.E.Farmer
them in the dictionary they come in and acess the members as needed. I really don't see your need. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: WYSIWYG wxPython "IDE"....?

2005-02-04 Thread M.E.Farmer
Yes you can use absolute positioning. You do not need sizers ( but they are very nice ) Most all the widgets have a pos keyword in there constructor. Just use them. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread M.E.Farmer
that do exactly one thing each and use them as your interface. Py> def fun_helper(d): ... d['z'] = func(d['x']+d['y']+d['whatever']['as']+d[a][0]) ... return d and use them as needed. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonWin and PyWin32

2005-02-04 Thread M.E.Farmer
th Python. hth , M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: who can tell me BASICS of Python

2005-02-04 Thread M.E.Farmer
I guess it depends :) Let us know what works for you. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI POST problem was: How to read POSTed data

2005-02-05 Thread M.E.Farmer
u have had a bit of a snag , sorry to hear that. I am glad you are at least learning new things, 'cause if you had used CherryPy2 you would have be done by now :P M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame.mixer.music not playing

2005-02-06 Thread M.E.Farmer
game Py> pygame.mixer.init() Py> pygame.mixer.music.load('c:/everyday.mp3') Py> pygame.mixer.play() Py> pygame.mixer.music.fadeout(4000) You have a typo in the code you posted that may be your problem. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

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

2005-02-06 Thread M.E.Farmer
return pathlist . . def list_dir(dir): . ''' Another way to filter a dir ''' . import os . pathlist = os.listdir(dir) . # Now filter out all but py and pyw . filterlist = [x for x in pathlist .if x.endswith('.py') .or x.endswith('.pyw')] .return filterlist hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame.mixer.music not playing

2005-02-06 Thread M.E.Farmer
http://sourceforge.net/projects/uncassist the people who wrote pyFMOD (lots of stuff there) http://www.cs.unc.edu/~parente/tech/tr01.shtml Hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame.mixer.music not playing

2005-02-06 Thread M.E.Farmer
Just curious what is not suitable about FMOD ? It seems to be exactly what you are looking for. Cross platform, free, great sound, python bindings, no compiler needed. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: def __init__ question in a class definition

2005-02-06 Thread M.E.Farmer
7;t ask a 2nd grade question yet claim/pretend to be some sorta system specialists. You tried searching the archives first I am sure. Go here http://www.python.org and *read*, come back when you are really stuck. M.E.Farmer P.S. YES the __ matter, they identify special methods ! __init__ is the class CON

Re: pygame.mixer.music not playing

2005-02-06 Thread M.E.Farmer
py hacking, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI POST problem was: How to read POSTed data

2005-02-06 Thread M.E.Farmer
Sweet! Glad you fixed it, and documented it all! Thanks for the followups. Now the next poor soul to stumble in can get the right fix. Never know when it could be me ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory Allocation?

2005-02-06 Thread M.E.Farmer
to take out the garbage or look at it? Python does it for you so you don't have too. But don't let me stop you. You can probably still find some way to do it. It is open source after all. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: def __init__ question in a class definition

2005-02-07 Thread M.E.Farmer
Steve Holden wrote: > M.E.Farmer wrote: > > >>Jeffrey Borkent > >>Systems Specialist > >>Information Technology Services > > > > > > With that kind of credentials, and the fact that you claim you are a > > system specialists > >

Re: Memory Allocation?

2005-02-07 Thread M.E.Farmer
details. If I am wrong someone correct me ;) If you search around you can find many pointers to memory effecient coding style in Python( never add a string together, use a list and append then join, etc.) Stick to profiling it will serve you better. But do not let me stop you from writing a memory

Re: listerator clonage

2005-02-12 Thread M.E.Farmer
line 95, in copy > return _reconstruct(x, rv, 0) > File "C:\Python24\lib\copy.py", line 320, in _reconstruct > y = callable(*args) > File "C:\Python24\lib\copy_reg.py", line 92, in __newobj__ > return cls.__new__(cls, *args) > TypeError: objec

Re: Text files read multiple files into single file, and then recreate the multiple files

2005-02-13 Thread M.E.Farmer
x27;myrecords.txt') Py> first_record = records.next() Py> second_record = records.next() Py> # or you can do this Py> for record in records: Py> print record Getting them in a single file is easy, and will be an excercise left to the reader. The fileinput module is your f

Re: newbie question - exception processing

2005-02-20 Thread M.E.Farmer
_init__(self, msg) def __repr__(self): return self._msg __str__ = __repr__ class PathError(PSCError): def __init__(self, msg): PSCError.__init__(self, 'Path error! : %s'% msg) class InputError(PSCError): def __init__(self, msg): PSCError.__init__(self, 'Input error! : %s'% msg) # and you use it like this raise PathError, 'Please check path' raise InputError, 'Improper input try again' hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: remove strings from source

2005-02-26 Thread M.E.Farmer
ewpos + len(toktext) if toktype in [token.NEWLINE, tokenize.NL]: self.out.write('\n') return if newpos > oldpos: self.out.write(self.raw[oldpos:newpos]) if toktype in [token.INDENT, token.DEDENT]: self.pos = newpos return if (toktype == token.STRING): sname = self.StringName.next() self.StringMap[sname] = toktext toktext = sname self.out.write(toktext) self.out.flush() return hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread scheduling

2005-02-26 Thread M.E.Farmer
This may help. http://linuxgazette.net/107/pai.html Also be sure to google. search strategy: Python threading Python threads Python thread tutorial threading.py example Python threading example Python thread safety hth, M.E.Farmer -- http://mail.python.org/mailman

Re: remove strings from source

2005-02-26 Thread M.E.Farmer
02': "''' Store the source text & set some flags.\n'''", 's03': "'unix'"} You can also strip out comments with a few line. It can easily get single comments or doubles. add this in your __call__ function

Re: Is it possible to pass a parameter by reference?

2005-02-26 Thread M.E.Farmer
le): ...print 'you have %s apples' % apple py>f1(4) 'you have 5 apples' Read the docs this is pretty basic, it will save you time. If in doubt try it out. Use the interpreter, it is your friend. hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread M.E.Farmer
eter and try playing with them and see what they do. If you weant to know what an object or methods docs say, use help(). Py> help(q.count) Help on built-in function count: count(...) L.count(value) -> integer -- return number of occurrences of value If you want to know the number of items in a list ( or most builtins ) use len(). Py> len(q) 8 Spend time reading the docs. It will save you months of work. Also learn the library it has many modules that will simplify your code and save your mind. http://www.python.org/doc/ hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread M.E.Farmer
Your welcome for the help , be sure to pass it on ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie getting confused again

2005-03-05 Thread M.E.Farmer
__mul__', '__ne__', '__new__', '__reduce__', '__repr__', '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'] Then you can try and get some help from Python. Py>help(a.extend) Help on built-in function extend: extend(...) L.extend(iterable) -- extend list by appending elements from the iterable And finally use pydoc it is very helpful. Cl> python pydoc -g hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: File call error message (double backslash)

2005-03-08 Thread M.E.Farmer
that works ;) "c:/windows/dir" Windows uses '\' as a path sep but it also understands '/'. *nix uses '/' as a path sep. hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: function namespaces

2005-03-08 Thread M.E.Farmer
the question : #contents of myfile.py: testvar = [1,2,3,4] # someother.py # the problem is you are executing a script # then searching in the wrong namespace. def myfunction(filename): execfile(filename, globals()) print testvar hth, M.E.Farmer -- http://mail.python.org/mailman/listi

Re: An Odd Little Script

2005-03-09 Thread M.E.Farmer
#x27;) eos = f.seek(107).read(1) r = f.read() f.close() r = r.replace('\r', '') r = r.replace('\n', '') r = r.replace(eos, '\n') f = open('yourrecord', 'w') f.write(r) f.close() hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: How to allow events during long processing routine?

2005-03-09 Thread M.E.Farmer
Survey says. ...wxYield() ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple account program

2005-03-17 Thread M.E.Farmer
l","w"]: self.withdraw(amount) else: self.deposit(amount) hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple account program

2005-03-18 Thread M.E.Farmer
re appropriate for you right now till you are up and running. http://www.python.org/mailman/listinfo/tutor -Just keep reading and writing Python , you will 'get it'. hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Help on creating a HTML by python

2004-11-29 Thread M.E.Farmer
p://bellsouthpwp.net/m/e/mefjr75/python/Thumbz.py You can see my dumb newbie code , of course that was two years ago ;) There are others out there too try thumbnail.py in a Google search sometime ;) > Thanks your welcome ... HTH, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace string except inside quotes?

2004-12-04 Thread M.E.Farmer
### if __name__ == '__main__': Main() # end of code This is an example of how to use tokenize to replace names that match a search string. If you wanted to only replace strings and not names then change the replacetokentype to token.STRING instead of token.NAME etc... HTH, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with modules/packages.

2004-12-04 Thread M.E.Farmer
ClassA import CJB.ClassB classA = CJB.ClassA.ClassA classB = CJB.ClassB.ClassB # end of __init__.py Now all you do is import. import CJB dir(CJB) CJB.ClassA() CJB.ClassB() > Is my understand of modules/packages correct or am I way off? Not to far off :) > Thanks for the help. HTH, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython question

2004-12-16 Thread M.E.Farmer
, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython question

2004-12-17 Thread M.E.Farmer
ou convert your icon to source using img2py.py you can do this: import Icon ICON = Icon.getIcon() frame.SetIcon(ICON) Hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: PyCrust: What am I suppose to do?

2004-12-17 Thread M.E.Farmer
the nice looking 3-pane window pops up with lots of tabs...a > prompt...and then??? Where is the file I am trying to run? Even the File > options are all greyed out... > > Yea it is not an IDE. It is supposed to be a 'flaky' interactive interpreter, with code completion, and

Re: Easy "here documents" ??

2004-12-18 Thread M.E.Farmer
te cleaner cause you can use what you want for the tokens, but takes more lines to do the replacements. still clueless, M.E.Farmer Peter Hansen wrote: > Jim Hill wrote: > > I've done some Googling around on this and it seems like creating a here > > document is a bit tricky wi

Re: python & nurbs

2004-12-19 Thread M.E.Farmer
Be sure to check the Blender forums before you give up, I recall someone working on that very thing maybe a year or so ago, but maybe my memory fuse is blown ;) M.E.Farmer Jelle Feringa // EZCT / Paris wrote: > > Have you looked at Blender (http://www.blender3d.com)?? > > Blender

Windows CD autorun program

2004-12-19 Thread M.E.Farmer
# py>## This is for py2exe. py>## Remeber you can use --icon to change the icon(win2k only?) py># py>## setup.py py2exe py># py># from distutils.core import setup py># import py2exe py># setup(name="CD_Autorun", py># scripts=["CD_Autorun.pyw"]) py># py>## 2004 M.E.Farmer Jr. -- http://mail.python.org/mailman/listinfo/python-list

Re: input record seperator (equivalent of "$|" of perl)

2004-12-19 Thread M.E.Farmer
s = recordbreaker('/tmp/myrecords.txt') py>for item in records: ...print item M.E.Farmer [EMAIL PROTECTED] wrote: > Hi, > I know that i can do readline() from a file object. > However, how can I read till a specific seperator? > for exmple, > if my files are > >

Re: input record seperator (equivalent of "$|" of perl)

2004-12-19 Thread M.E.Farmer
f all at once. I dont have itertools yet. That module looks like it rocks. thanks for the pointers, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: input record seperator (equivalent of "$|" of perl)

2004-12-19 Thread M.E.Farmer
Yea I should have mentioned I am running python 2.2.2. Can it be ported to python 2.2.2? Till they get python 2.4 all up and runningI'll wait a bit. Thanks for the info, M.E.Farmer Scott David Daniels wrote: > M.E.Farmer wrote: > > I dont have itertools yet. That module looks

Re: Oddity in 2.4 with eval('None')

2004-12-20 Thread M.E.Farmer
gt; print eval('None') wassabi >>> dir() ['None', '__builtins__', '__doc__', '__name__', 'shell'] >>> I think you are seeing two things and I admit I was confused a bit too. None is becoming a constant and this is the first ste

Re: word to digit module

2004-12-21 Thread M.E.Farmer
return numbers.get(numname.lower(), 'error') print getNumber('OnE' , numbers) print getNumber('siX' , numbers) print getNumber('fOur' , numbers) print getNumber('nine' , numbers) print getNumber('SEven' , numbers) # M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: word to digit module

2004-12-22 Thread M.E.Farmer
t; numbers = numbers[idx+1:] + [1000*x for x in hundreds] > > if 100 in numbers: > idx = numbers.index(100) > hundreds = numbers[:idx] > numbers = numbers[idx+1:] + [100*x for x in hundreds] > > return sum(numbers) > > Stephen Thorne M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: list IndexError

2004-12-22 Thread M.E.Farmer
Hello Ishwor , The simpliest way I can explain slicing is that the slices point to the spot *between* the items.. Take this list for example slicer = [0,1,2,3,4,5] >>> slicer [1] 1 >>> slicer [1:2] [1] >>> slicer [:-1] [0,1,2,3,4] >>> slicer[2,

Re: Creating Image Maps

2004-12-23 Thread M.E.Farmer
Hello Aaron, You need to check the demo that comes with wxPython if you don't have it get it. Look under wxHtmlWindow and click the demo tab then just scroll down and there is a link to it that says IMAGEMAP. Or in other words RTFD ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/p

Re: More elegant way to cwd?

2004-12-24 Thread M.E.Farmer
Hello, Seems you found os.chdir(), but you missed os.getcwd() ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: More elegant way to cwd?

2004-12-24 Thread M.E.Farmer
Ignore my last post to much eggnog I guess. I must have parsed it to quickly. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Configuration Files

2004-12-25 Thread M.E.Farmer
ight post a code sample if I am up to itso much turkey, and cookies. > I want it to be powerful, > yet simple and minimalistic, not requiring a huge amount of overhead. Don't we all! M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Configuration Files

2004-12-25 Thread M.E.Farmer
ser.read(cfgpath) ... return parser.get(section,key) Hope that helps...now *where* are those sugar cookies M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: WxButton

2004-12-26 Thread M.E.Farmer
overed somewhere in the wx demo ;) Hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: program in interactive mode

2004-12-26 Thread M.E.Farmer
t > OS dependant to close and open the right descriptors, but I'm not sure > anymore. Any help or pointer in the right direction would be greatly > appreciated. > > Happy christmas everyone, > > RGB Hello RGB, what you are loking for is sys.stdin.isatty() py> if sys.stdin

Re: Configuration Files

2004-12-26 Thread M.E.Farmer
>thanks for the replies, guys! Your welcome, glad I could help. >(Spending time on these newsgroups is giving me more questions that >answers heh ) Thats good as long as it motivates you to learn ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: need some help with threading module...

2004-12-26 Thread M.E.Farmer
x :(...). I have had problems with whitespace being stripped before, but I just cannot understand WHY would you post KNOWING it was missing indents. Fix-it repost and maybe someone might help you. Hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: need some help with threading module...

2004-12-26 Thread M.E.Farmer
x = 0 ... while x < 10: ... print x ... x += 1 ... print " Ending" Use it like this: py> Test().start() There are other ways to do this, but you need to do a web search on threading.py , there are many examples

Re: WxButton

2004-12-26 Thread M.E.Farmer
he button that has focus using the return key than it already works like that just tab to the button and press return. If you want to make a button focused by default you can use SetDefault() Sounds like you are trying to hard to do something simple, try less. Hth, M.E.Farmer -- http://mail.pyt

Re: need some help with threading module...

2004-12-27 Thread M.E.Farmer
chahnaz.ourzikene wrote: > "M.E.Farmer" <[EMAIL PROTECTED]> a écrit dans le message de news: > [EMAIL PROTECTED] > > > Just a warning! > > Threads and newbies don't mix well, > > many pitfalls and hard to find bugs await you. > > I would avoi

Re: More elegant way to cwd?

2004-12-27 Thread M.E.Farmer
he same. realpath is just an alias for abspath. Using pydoc on os gives this: py>realpath = abspath(path) py> Return the absolute version of a path M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: WxListBox

2004-12-27 Thread M.E.Farmer
of it. hint: SEARCH GOOGLE / READ DOCS / WRITE CODE Ahh the joy of learning frameworks.(and GUI editors) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Confusion About Classes

2004-12-27 Thread M.E.Farmer
reinventing all this junk and avoiding some eval hack to get the stuff back to the right type.) If you think I am kidding note others in this newsgroup have been there done that, not me of course, I never need documentation ;) Hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Repainting

2004-12-28 Thread M.E.Farmer
eentrance of code. ''' Just sprinkle your listctrl update loop with wx.Yield(). I am not sure if this will help you but has fixed update problems for me before. By the way when you have problems with wxPython you may get more responses from the wxPython list. Comp.lang.python is

Re: pygame + py2exe = bad exe. why?

2004-12-28 Thread M.E.Farmer
e): py>shutil.copy(name, dst) py>else: py>print 'Warning, %s not found' % name py> py> py> py> py>pygamedir = os.path.split(pygame.base.__file__)[0] py>installfile(os.path.join(pygamedir, pygame.font.get_default_font())) py>installfile(os.path.join(pygamedir, 'pygame_icon.bmp')) py>for data in extra_data: py>installfile(data) This is probably a complete mess by the time it reaches you. I started every line with py> so just unwrap the lines that didn't make it. Hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter vs wxPython

2004-12-28 Thread M.E.Farmer
wbies needing help are using wxGlade or Boa and it helps them get neck deep into trouble before they even realize what they are doing wrong. Because they have not worked directly with the framework they don't understand the framework . But YMMV M.E.Farmer -- http://mail.python.org/mailma

Re: Repainting

2004-12-29 Thread M.E.Farmer
LutherRevisited wrote: > Thanks, yielding has solved all remaining problems I had with this gui. Thank you for the followup, glad to have helped. Study, learn , pass it on. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Confusion About Classes

2004-12-29 Thread M.E.Farmer
= 'mike' a.weight= 220 dir(a) del a.name Sorry if it is incoherent, I am way past bed time . M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: need some help with threading module...

2004-12-30 Thread M.E.Farmer
he counter is now 31 Subject : the counter is now 32 Subject : the counter is now 33 Subject : the counter is now 34 Subject : the counter is now 35 Subject : the counter is now 36 Subject : the counter is now 37 Subject : the counter is now 38 Subject : the counter is now 39 It seems to be what yo

Re: need some help with threading module...

2004-12-30 Thread M.E.Farmer
that. Why do you suppose he is having problems with this on Linux? I am not on a Linux box to test it. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: novice regular expression question

2004-12-30 Thread M.E.Farmer
py>lexer.get_token() '2' py>lexer.get_token() ']' py>lexer.get_token() 'fdfdfdfd' You can do a lot with it that is just a teaser. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: need some help with threading module...

2004-12-30 Thread M.E.Farmer
with a grain of salt, and read more docs. Check into queue it is in the standard lib. By the way, I reread your post and still think that threads are not the way for you to go you really need to search for 'python MVC'. It may just enlighten you. M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: novice regular expression question

2004-12-30 Thread M.E.Farmer
. It imports os and sys only, they are standard library modules. If you have python you have them already. If you mean cStringIO it is in the standard library(at least on my system). You dont have to use it just feed shlex an open file. py>lexer = shlex.shlex(open('myrecord.txt

Re: Parsing a search string

2004-12-31 Thread M.E.Farmer
chars += '-' # add the hyphen py>a.get_token() 'moo' py>a.get_token() 'cow' py>a.get_token() '"farmer john"' py>a.get_token() '-zug' py>a.get_token() '' Hth, M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: More baby squeaking - iterators in a class

2004-12-31 Thread M.E.Farmer
Reread Russel Blau post he is spot on with his comments: Russel Blau wrote: >I don't get that from the passage quoted, at all, although it is somewhat >opaque. It says that your __iter__() method must *return an object* with a >next() method; your __iter__() method below doesn't return such an obje

  1   2   >