Re: Observer implementations

2009-06-17 Thread Mike C. Fletcher
Tobias Weber wrote: > In article , > "Mike C. Fletcher" wrote: > > >> See PyDispatcher for code to do this. >> > > That was the original problem. Got it now: if used inside the class > definition dispatcher.connect will raise "cannot

Re: walking a directory with very many files

2009-06-17 Thread Mike Kazantsev
On Wed, 17 Jun 2009 23:04:37 +1200 Lawrence D'Oliveiro wrote: > In message <20090617142431.2b25f...@malediction>, Mike Kazantsev wrote: > > > On Wed, 17 Jun 2009 17:53:33 +1200 > > Lawrence D'Oliveiro wrote: > > > >> > Why not us

GAEUnit testing

2009-06-17 Thread Mike
Hello I'm using GAEUnit to develop an app for google appengine and am having a little trouble. I'm trying to make a test as follows: I have a file (say model.py) which contains Model.db model classes and some methods for accessing them. The methods are not part of the class. In my test I can cal

Re: walking a directory with very many files

2009-06-17 Thread Mike Kazantsev
> Why is that a problem? So you can os.listdir them? Don't ask me what for, however, since that's the original question. Also not every fs still in use handles this situation effectively, see my original post. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP sig

Re: walking a directory with very many files

2009-06-16 Thread Mike Kazantsev
On Wed, 17 Jun 2009 03:42:02 GMT Lie Ryan wrote: > Mike Kazantsev wrote: > > In fact, on modern filesystems it doesn't matter whether you > > accessing /path/f9e95ea4926a4 with million files in /path > > or /path/f/9/e/95ea with only hundred of them in each path. Former

Re: Logging multiple lines

2009-06-16 Thread Mike Kazantsev
refix at the beginning of every line? I'd log exception name and timestamp (or id) only, pushing the full message with the same id to another log or facility (like mail it to some dedicated bug-report box). -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http:

Re: walking a directory with very many files

2009-06-16 Thread Mike Kazantsev
95ea with only hundred of them in each path. Former case (all-in-one-path) would even outperform the latter with ext3 or reiserfs by a small margin. Sadly, that's not the case with filesystems like FreeBSD ufs2 (at least in sixth branch), so it's better to play safe and create subdirs if

Re: Newbie help for using multiprocessing and subprocess packages for creating child processes

2009-06-16 Thread Mike Kazantsev
o read/write data from/to the pipes more than once (aka communicate), using threads or any more python subprocesses seem like hammering a nail with sledgehammer - just _read_ or _write_ to pipes asynchronously. -- Mike Kazantsev // fraggod.net -- http://mail.python.org/mailman/listinfo/python-list

Re: simple GUI for my application?

2009-06-16 Thread Mike Driscoll
On Jun 16, 1:24 pm, Tim Harig wrote: > On 2009-06-16, Mike Driscoll wrote: > > > On Jun 16, 9:20 am, Filipe Teixeira wrote: > >> Hi, I'm really struggling to find the best GUI to make a simple > >> application. > [SNIP] > >> Basically I will use

Re: simple GUI for my application?

2009-06-16 Thread Mike Driscoll
UIs I needed to reimplement, so I went with wxPython. I've heard good things about pyQT. If you want the ultimate look-and-feel for Windows, you should go with IronPython. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: persistent composites

2009-06-16 Thread Mike Kazantsev
nthusiasm. I've read this thread from the beginning, being tempted to insert remarks about shelve module or ORMs like SQLAlchemy, but that'd be meaningless without the problem description, which I haven't seen anywhere. Is it some trick idea like "let's walk on our heads"?

Re: Observer implementations

2009-06-16 Thread Mike C. Fletcher
, but I haven't had to change anything in a rather long time. It pretty much just works. Enjoy, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Multi-Threading and KeyboardInterrupt

2009-06-15 Thread Mike Kazantsev
d processes with a simple "while True: ..." loop, consider using twisted framework - it'll allow you to do incredible stuff with any number of sockets with just few lines of code in a clean, abstracted way. Latter would also mean that you can always replace os pipes with network sockets just

Re: parsing json using simplejson

2009-06-15 Thread Mike Kazantsev
nces # You can always use it as a regular dict print 'port' in data print data['see_also'] # Data model propagnates itself to any sub-mappings data.see_also.new_item = dict(x=1, y=2) print data.see_also.keys() data.see_also.new_item['z'] = 3 print data.see_also.new_item.z -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: waling a directory with very many files

2009-06-15 Thread Mike Kazantsev
t; themselves, as I was thinking. I wish listdir had been changed in 3.0 > along with map, filter, and range, but I made no effort and hence cannot > complain. Why? We have itertools.imap, itertools.ifilter and xrange already. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing json using simplejson

2009-06-15 Thread Mike Kazantsev
On Sun, 14 Jun 2009 22:45:38 -0700 (PDT) deostroll wrote: > I need to be able to parse a json data object using the simplejson > package. First of all I need to know all the task needed for this job. Note that py2.6 has a bundled json module. -- Mike Kazantsev // fraggod.net signatu

Re: Multi-Threading and KeyboardInterrupt

2009-06-15 Thread Mike Kazantsev
On Mon, 15 Jun 2009 05:37:14 -0700 (PDT) OdarR wrote: > On 13 juin, 07:25, Mike Kazantsev wrote: > > There was quite interesting explaination of what happens when you send > > ^C with threads, posted on concurrency-sig list recently: > > > >  http://bli

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Mike Kazantsev
or of "{0}".format(var) and I think it's a good call. There's only so much sugar to add before it'll transform into salt and you'll start seeing lines like these: s**'@z!~;()=~$x>;%x>l;$(,'*e;y*%z),$;@=!;h(l~;*punch jokers;halt;*;print; I

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Mike Kazantsev
x27;d prefer to use dict() to declare a dict, not some mix of letters and incomprehensible symbols, thank you. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Make upof Computer

2009-06-14 Thread Mike Kazantsev
On Sun, 14 Jun 2009 00:46:16 -0700 (PDT) "Mr . Waqar Akbar" wrote: ... Judging by the typo in the last subject, someone indeed types all this crap in manually! Oh my god... -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailma

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-13 Thread Mike Kazantsev
;with", file should end up closed, else os.rename might replace valid path with zero-length file. It should be easy to use cursor with contextlib, consider using contextmanager decorator: from contextlib import contextmanager @contextmanager def get_cursor(): try: cursor = conn.c

Re: Multi-Threading and KeyboardInterrupt

2009-06-13 Thread Mike Kazantsev
re other > links? Thanks for sharing this link, although I prefer such information in written form - it's easier/faster to work with and much more accessible. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: moving Connection/PipeConnection between processes

2009-06-13 Thread Mike Kazantsev
s' table (with it's own numbering), which is usually done via special flag for sendmsg(2) in C, so you should probably look out for py implementation of this call, which I haven't stumbled upon, but, admittely, never looked for. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Lexical scope: converting Perl to Python

2009-06-12 Thread Mike Kazantsev
nyway? It's not like you'd be able to accomplish it - code can easily grep it's process body in memory and harvest all the "private" values, so I'd suggest getting some fresh air when you start to feel like doing that. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] Multi-Threading and KeyboardInterrupt

2009-06-12 Thread Mike Kazantsev
gt; > ... a .join() call, which is the most likely position at which the > keyboard interrupt will be processed, killing the main program thread > and probably generating some errors as dangling active threads are > forceably killed. There was quite interesting explaination o

Re: Specify the sorting direction for the various columns/

2009-06-11 Thread Mike Kazantsev
'date': datetime.datetime(2007, 9, 30, 16, 43, 54)}, {'name': 'AA2', 'username': 'AA2','date': datetime.datetime(2007, 9, 30, 16, 43, 54)}] entries.sort(lambda x: (x['name'], -time.mktime(x['date'].timetuple( Here time is inversed, yielding reverse sort order by that column. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest - what is the best way to reuse test data?

2009-06-03 Thread Mike
On Thu, Jun 4, 2009 at 11:22 AM, Terry Reedy wrote: > Mike wrote: > > >> >> On Thu, Jun 4, 2009 at 4:40 AM, Terry Reedy > tjre...@udel.edu>> wrote: >> >>Mike wrote: >> >>Hello, >> >>I'm writing an appl

Re: unittest - what is the best way to reuse test data?

2009-06-03 Thread Mike
On Thu, Jun 4, 2009 at 4:40 AM, Terry Reedy wrote: > Mike wrote: > >> Hello, >> >> I'm writing an application that needs to fetch a json file from a >> webserver. I'm writing the tests and have a question: >> >> if I have the following

unittest - what is the best way to reuse test data?

2009-06-03 Thread Mike
I'm new to using the testing framework so I'm not sure on best practises and such. Is introducing persistance by using sql lite the best way? I should be able to just reuse data within the object. Or is my design wrong? Any tips or suggestions would be appreciated! - Mike -- ht

Re: do replacement evenly

2009-06-02 Thread Mike Kazantsev
#x27; ' count_span_max = count_space - (count_span * len(span_min)) line = buffer(words[0]) for word in words[1:]: if count_span_max: count_span_max -= 1 line += span_min + ' ' else: line += span_min line += word print '%d chars: %r'%(len(line),

Re: PyOpenGL Installation

2009-05-31 Thread Mike C. Fletcher
e machine, same for GLUT, GLE and the like, but they aren't required unless you want to use them. Heck, if you want you can even easy_install the package last I checked. http://pyopengl.sourceforge.net/documentation/installation.html My dictionary's defini

Re: extract to dictionaries

2009-05-29 Thread Mike Kazantsev
, 'key1': 'value1'} } To save namespace and make it a bit more unreadable you can write it as a one-liner: with open('test.src') as src: data = dict( (lines.next(), dict(it.imap(str.split, lines))) for sep,lines in it.groupby(it.ifilter(bool, it.imap(lambda x: x.s

Re: AOPython Question

2009-05-28 Thread Mike Driscoll
On May 28, 3:10 pm, Mike Driscoll wrote: > On May 28, 1:43 pm, Roastie wrote: > > > > > I installed the AOPython module: > > >    % easy_install aopython > > > That left an aopython-1.0.3-py2.6.egg at > > C:\mystuff\python\python_2.6.2\Lib\site

Re: AOPython Question

2009-05-28 Thread Mike Driscoll
version. If you mis-spell the version slightly, then you will probably have issues. I am guessing that is why you received those error messages. See the easy install official docs: http://peak.telecommunity.com/DevCenter/EasyInstall - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: which database is suitable for small applications

2009-05-26 Thread Mike Driscoll
onnect to Microsoft SQL 2000 right now, but I used to use the mssql and adodb modules. The latter two worked for what I needed, although I was always running to escaping issues with them. SqlAlchemy is nice because it does all that for you and you can switch database back-ends with little to no change in your code. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Set a variable as in setter

2009-05-24 Thread Mike Kazantsev
On Sun, 24 May 2009 19:03:26 +0600 Mike Kazantsev wrote: > On Sun, 24 May 2009 05:06:13 -0700 (PDT) > Kless wrote: > > > Is there any way to simplify the next code? Because I'm setting a > > variable by default of the same way than it's set in the setter. > &g

Re: how to get rid of pyc files ?

2009-05-24 Thread Mike Kazantsev
switches are available for python ? > (googling didn't give me any relevant hits ) You might be amazed how much insight "man python" and "python -h" can yield ;) -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Set a variable as in setter

2009-05-24 Thread Mike Kazantsev
>def bar(self, bar): > self._bar = self._change(bar) # !!! as in init > > def _change(self, text): > return text + 'any change' > --- -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: While Statement

2009-05-22 Thread Mike Kazantsev
seem to make more sense to me than an explicit conversion. There's also "op.itruediv" for "number /= float(total) * 100" case. http://docs.python.org/dev/library/operator.html -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get Form values in Python code and Send Email

2009-05-20 Thread Mike Kazantsev
Content-Disposition', 'attachment; filename="%s"'% os.path.basename(file)) msg.attach(part) smtp = smtplib.SMTP(relay) smtp.sendmail(from, to, msg.as_string() ) smtp.close() -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Import and absolute file names, sys.path including ''... or not

2009-05-20 Thread Mike Kazantsev
t) if absolute path gets appended to it: os.path.join('/some/path', '/home/jeanmichel') == '/home/jeanmichel' > So my question is: "why the shell is adding '' when the interpreter is > adding the full path ?" Looks like a solid way to construct relative imports to me. -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: SpellChecker

2009-05-20 Thread Mike Kazantsev
work much faster with buffers than str / unicode. text = 'some text to correct (anything, really)' result = buffer('') word, c = buffer(''), '' for c in text: if c.isalpha(): word += c else: if word: result += correct(word)

Re: Yet another question about class property.

2009-05-20 Thread Mike Kazantsev
Jim Qiu wrote: > Hi everyone, > > Following is the code i am reading, i don't see anywhere the declaration of > Message.root object, > Where is it from? ... Prehaps it gets assigned by the parent itself? Like this: def spawn_child(self): child = Message() child.r

Re: optparse options

2009-05-20 Thread Mike Kazantsev
e illogical and counter-intuitive to create "required options", since by definition they should be optional. Try using arguments instead, with some type-switching flags, if necessary - it should make CLI more consistent and save some typing by omitting otherwise always-required option argument ("--part"). -- Mike Kazantsev // fraggod.net signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced Python books?

2009-05-19 Thread Mike Driscoll
a bunch of projects at the end. It also has a chapter on testing, network programming, extending python, packaging and more. They're not in depth, but they give you a taste. Lutz's "Programming Python" has some pretty in depth projects using Tkinter. You might find the Python Cookbook helpful or you could just look at ActiveState's cookbook which is what the book was based on: http://code.activestate.com/recipes/langs/python/ - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert a list of strings to a tuple of floats?

2009-05-18 Thread Mike Kazantsev
ted already... import itertools as it ftuple = tuple(it.imap( float, line.split('; ') )) -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: pushback iterator

2009-05-17 Thread Mike Kazantsev
tes. > > > > What real-world scenario am I missing here? > > > > ok, I admit that that the file was not good example. better example > would be just any iterator you use in your code. Somehow I've always managed to avoid such re-iteration scenarios, but of course, it could be just my luck ;) -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: pushback iterator

2009-05-17 Thread Mike Kazantsev
next "pop" won't have to roam thru all the values again but instantly get the right one from the cache, or just get on with that iterable until it depletes. What real-world scenario am I missing here? -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser and newlines

2009-05-15 Thread Mike Driscoll
t for yaml built-in or possibly in the future? > The primary alternative to ConfigParser is Michael Foord's ConfigObj: http://www.voidspace.org.uk/python/configobj.html I don't know if it has yaml support or not though. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing Strings in Enclosed in Curly Braces

2009-05-15 Thread Mike Driscoll
ing was like this, then it would split: x = "{} ABC EFG" In the mean time, you can just use some string slicing like this: y = x[1:-1] That will remove the braces and allow you to manipulate the text therein. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Your Favorite Python Book

2009-05-15 Thread Mike Driscoll
n Python 3.0's release (the book is circa 2.5). > > Cheers, > Chris > --http://blog.rebertia.com I use Hetland's "Beginning Python" and Chun's "Core Python Programming" the most, although I haven't used them in a while. I also use Martelli's "Python Cookbook" from time-to-time. Hopefully he will put out a 3.0 version too. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: python

2009-05-15 Thread Mike Driscoll
; result should be a list of the form: [['fuzzy', 53], ...]. I recommend reading the Python Tutorial: http://python.org/doc/ If you're using Python 2.x, then check out http://www.diveintopython.org/ If you're using 3.0, your primary options are the online docs and "Programming

Re: How to abort module evaluation?

2009-05-12 Thread Mike Driscoll
sn't abandoning the processing of the rest of the script exiting the script? You could use "return" or wrap the offending code in a try/ except block and do something on an exception... Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: how to consume .NET webservice

2009-05-12 Thread Mike Driscoll
4/04/soap.html > > You are right, sorry. > > > MS created it. That it *became* a standard of the W3C later - well, they > > did that with OOXML as well... > > OpenOfficeXML document format AKA ODF? ;) No...Office Open XML, which is used in Microsoft Office 2007 and which Microsoft rammed through the ISO: http://en.wikipedia.org/wiki/Office_Open_XML - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: how to consume .NET webservice

2009-05-11 Thread Mike Driscoll
first...I got plenty of hits with "python .net web service". This one sounds good: http://www.beardygeek.com/2009/01/how-to-call-a-net-webservice-using-python/ It sounds like you consume it much like you do with other web services...find the API and use Python to access it or c

Re: Using Pygame with Python

2009-05-11 Thread Mike Driscoll
with that unless there are known issues listed. If you plan to make an executable of the game, then I recommend Python 2.5 since there are some known issues with 2.6 (don't know if that's true for 3.0 or not, but it's probable). - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing text to a Word Document

2009-05-11 Thread Mike Driscoll
t >     worddoc.Content.Text = (PBrowVal) >     PBrow = PBselCur.next() > > #worddoc.Close() # Close the Word Document (a save-Dialog pops up) > > print "Fin" What you probably want is something like this: rng = worddoc.Range(0,0) while PBrow: rng.InsertAfter(PBrowVal

Re: OOP & Abstract Classes

2009-05-11 Thread Mike Driscoll
o make his Python program break while taking a pot shot at people who use that sort of thing. Whatever. According to wikipedia, dynamic languages don't implement Abstract as they can accomplish the same thing via duck typing: http://en.wikipedia.org/wiki/Abstract_class . The way it describes t

Re: pyinstaller and logging

2009-05-06 Thread Mike
On 6 Mai, 18:14, Vinay Sajip wrote: > On May 6, 2:41 pm, Mike wrote: > > > > > Pyinstaller seems to have a problem withlogging... > > >  I installed pyinstaller 1.3 - using it together with Python 2.6. I > > used pyinstaller for a small project, the created

pyinstaller and logging

2009-05-06 Thread Mike
Pyinstaller seems to have a problem with logging ... I installed pyinstaller 1.3 - using it together with Python 2.6. I used pyinstaller for a small project, the created .exe worked fine. After some additional changes to my project I got strange run time errors when running the .exe (but no probl

Re: desperately looking for a howto on running my wxPython app on Vista

2009-05-05 Thread Mike Driscoll
On May 5, 11:43 am, Paul Sijben wrote: > Mike Driscoll wrote: > > On Apr 29, 4:17 am, Paul Sijben wrote: > >> Is there any way to check which is the offending pyd/dll?  (normally > >> Vista does not give out much data on what went wrong) > > >> Paul >

Re: IDE for python 2.6 (auto complete)

2009-05-04 Thread Mike Driscoll
s. Is there any IDE with support for autocomplete > in python 2.6 with all the newer functions included? Wingware probably does. You should just submit a bug report to Stani though. He can probably fix SPE for you. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython having trouble with frame objects

2009-05-01 Thread Mike Driscoll
nger() >         chang.start() >         i=0 > This works, but is there anything simpler? > Regards > Soumen For additional ideas on using threads in wxPython, see the wiki: http://wiki.wxpython.org/LongRunningTasks - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython having trouble with frame objects

2009-05-01 Thread Mike Driscoll
the gui module. > > >> It does not mean that the guithread object has an attribute named > >> frame_1.  In order to do that, you should have written: > > >> guithread.frame_1 =omething > > >>> The idea here is to access a gui element running in a thread from a > >>> separate thread. Please help > > >> I would post wxPython related questions on the wxPython mailing > >> list, which is excellent. > >>http://www.wxpython.org/maillist.php > > >> HTH, > >> Che > >> -- > >>http://mail.python.org/mailman/listinfo/python-list > > Don't top-post. It puts things entirely out of order. Now the order of > the parts of this message are 3, 1, 2, 4 > > Two things at least are wrong here, either of which is fatal. >    1) you have two threads doing GUI stuff.  Can't be done, at least not in > wxPython.  Certain things can be done in a second thread, but definitely not > constructing Frames and such. You are correct...but I think that's pretty common across GUI toolkits. The GUI has it's own main loop that will get blocked if another thread tries to do something or you'll end up with strange behavior. As far as I know, each toolkit has its own methods for working around this. In wxPython's case, you can use wx.CallAfter, wx.CallLater and several others to manipulate the GUI from a thread. There's some other ways of going about this on the wxPython wiki: http://wiki.wxpython.org/LongRunningTasks - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: don't understand namespaces...

2009-04-30 Thread Mike Driscoll
nd in the 1st. Something like this: self.newFrame = NewFrame() Then you can get at the attributes of the 2nd frame: self.newFrame.SomeWidget.GetSomeValue() If you're opening both at the same time, you'll have to come up with something else, like Queues or pubsub. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: desperately looking for a howto on running my wxPython app on Vista

2009-04-29 Thread Mike Driscoll
s (win32, > wxpython) > > Is there any way to check which is the offending pyd/dll?  (normally > Vista does not give out much data on what went wrong) > > Paul You might be able to find it using the Dependency Walker utility: http://www.dependencywalker.com/ - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Third Party Modules

2009-04-28 Thread Mike Driscoll
there's usually a Windows installer. If I want something, it's usually more like a 50-50 chance of there being an installer. Anyway, hopefully the snakebite project will help with this a little. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you think of ShowMeDo

2009-04-28 Thread Mike Driscoll
or books or something. I think the learning process of creating some application was probably the most valuable tool I ever had. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython notebook oddness

2009-04-27 Thread Mike Driscoll
s so different that I don't see why they should behave   > similarly... > Please strip it down to the bare minimum showing the discrepancy (and tell   > us *what* you see and what you expect) > > -- > Gabriel Genellina Just ignore him. He re-posted to the wxPython lis

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Mike Kent
On Apr 27, 1:49 am, John Machin wrote: > > I am > > having a look at eval and exec > > WRONG WAY > GO BACK +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with code! Gamepad?

2009-04-24 Thread Mike Driscoll
On Apr 24, 10:11 am, DC16 wrote: > On Apr 23, 4:03 pm, Mike Driscoll wrote: > > > > > On Apr 23, 6:46 am, DC16 wrote: > > > > I am using pygame and OpenGL. > > > How do I make a gamepad able to move the camera to a side of a cube on > > > s

Re: Help with code! Gamepad?

2009-04-23 Thread Mike Driscoll
) > > How do I change it so that a gampad can move the camera in the same > way. > (Ignore the colour changing code) > > Thanks, > Dexter (DC16) > > BTW the code was originally by someone else. Try cross-posting to the pygame guys: http://www.pygame.org/wiki/info I read that pyglet will have some sort of gamepad support soon too, so you might want to check that project out as well. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: WINXP vs. LINUX in threading.Thread

2009-04-23 Thread Mike Driscoll
ingTasks As you will find, there are various methods within wxPython that are threadsafe (such as wx.CallAfter) and you can use those to communicate with and update your GUI. From what I've read, this is normal across GUI toolkits. They all have special ways to work with threads. In the future, I highly recommend that you join and post to the wxPython list as that's where you'll get the best targeted advice (see their website). This list is great for general questions though. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread Mike Driscoll
local GUI rich-client (in which case, use the GuiProgramming wiki > link Mike sent), or you're doing web development targeting > browsers in which case you should investigate the myriad web > programming frameworks for Python (Django, Turbogears, CheryPy, > web.py, webstack, etc).

Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread Mike Driscoll
ant to do and whether or not you need special widgets. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

2009-04-21 Thread Mike Driscoll
ur ListCtrl. List view, report, icon or what? The demo doesn't have any white space at the end, so I can't test this easily. Are you using a sizer to hold the widget? - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: SqlAlchemy and mssqlserver

2009-04-21 Thread Mike Driscoll
> > CREATE TABLE prova ( >  chiave INTEGER NOT NULL IDENTITY(1,1), >  PRIMARY KEY (chiave) > ) > > Stefano Try re-posting to the SqlAlchemy mailing list. They'll be able to tell you. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: using python logo at startup

2009-04-21 Thread Mike Driscoll
pick a GUI toolkit and have it display a picture for a few seconds and then disappear. wxPython has a built-in splash screen widget made for just this purpose. Tkinter may too, or you could just roll your own in it. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: color propagation in tkinter

2009-04-20 Thread Mike Driscoll
nks, > Alan Isaac One way would be to keep a list of the widgets that you want to be able to change the color of, and then loop over the list and change their respective colors as needed. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython 2.8 for Python 2.6 on Linux

2009-04-19 Thread Mike Driscoll
install from source. However, I wouldn't bother with it and Python 2.6 until wxPython's next release as there are some goofy things going on with the manifest files. Maybe this doesn't affect Linux users though...however, if you experience weird issues, that may be the cause...or

Re: How to create an unclosed dialog in wxPython?

2009-04-19 Thread Mike Driscoll
alog, but in > > fact, if you enter Alt+F4 in this dialog, it will close. How could I > > do? > > Binds the wx.EVT_CLOSE event and ignor it in the handle function. This is the preferred method...there is a slight caveat that when you actually want to close the dialog, you'll need to use the dialog's Destroy() method... - Mike -- http://mail.python.org/mailman/listinfo/python-list

Can I use setup.py to ship and install only .pyc files?

2009-04-16 Thread Mike Kent
I'd like to ship only the .pyc files for a module. I was hoping the standard distutils setup.py could handle this, but so far, I've not figured out how. After a bit of work, I discovered that if I create a MANIFEST.in file, and put 'include mymodule/*.pyc' and 'exclude mymodule/*.py' in it, then

Re: IronPython newbie: not clear on imports and assemblies

2009-04-15 Thread Mike Driscoll
quot;EssentialPDF") # now EssentialPDF should be in your python namespace # so you can do something like this: from EssentialPDF import SomeModule # or EssentialPDF.SomeModule At least, that's how it seems to work for most .NET libraries. Hope that helps. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython question

2009-04-14 Thread Mike Driscoll
blems whatsoever installing wxPython or its demo on Vista. What are you doing exactly? Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
gt;  >>> import tkFileDialog > >>  >>> fh = tkFileDialog.asksaveasfile() > >> Traceback (most recent call last): > >>    File "boot_com_servers.py", line 44, in > >>    File "tbzr.pyo", line 125, in > >>    File "tbzr.

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
oot_com_servers.py", line 44, in >    File "tbzr.pyo", line 125, in >    File "tbzr.pyo", line 60, in get_all_com_classes >    File "contextmenu.pyo", line 9, in > ImportError: No module named shell > Redirecting output to win32trace remote coll

Re: Unsupported operand types in if/else list comprehension

2009-04-11 Thread Mike H
k, I'd appreciate it. Thanks, On Sat, Apr 11, 2009 at 4:18 PM, George Sakkis wrote: > On Apr 11, 3:03 pm, Mike H wrote: > >> Can I not use the cursor.execute command to pass variables that aren't >> immediately next to each other? If so, is there a better way to go >&

Re: Unsupported operand types in if/else list comprehension

2009-04-11 Thread Mike H
ht syntax to use near ''name', 'fileno', 'size') VALUES ('Test', 'AAA-000', 7)' at line 1") Can I not use the cursor.execute command to pass variables that aren't immediately next to each other? If so, is there a better way to go a

Re: Unsupported operand types in if/else list comprehension

2009-04-11 Thread Mike H
Well, I'm an idiot. Obviously, the line "VALUES (%s, %s, %s);" needs to be modified to adapt for the number of arguments in the list. But otherwise On Sat, Apr 11, 2009 at 11:28 AM, Mike H wrote: > Ok, thanks again to everyone for their suggestions, even if it appears >

Re: Unsupported operand types in if/else list comprehension

2009-04-11 Thread Mike H
Lcmd="INSERT INTO " + myTable + " (%s) " % ", ".join(myFields) SQLcmd=SQLcmd + "VALUES (%s,%s,%s);" cursor.execute(SQLcmd, (myValues)) #sets and returns SQL variable. SQLcmd="select " + myReturnKey + ":=last_insert_id();" c

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread Mike H
, 1, 'two'] and have a function correct the list for me, rather than calling the function with a strangely quoted list e.g. ['"'test'"', 1, '"'two'"']. Again, thanks. On Fri, Apr 10, 2009 at 5:18 PM, John Yeung wrote: > On

Unsupported operand types in if/else list comprehension

2009-04-10 Thread Mike H
Hello all, I have a question about the if/else aspect of list comprehension: I would like to go through a list and place quotes around an item if it is a string, and keep the item the same if it's anything else: e.g.['a',9,'8b'] --> ['"a"', 9, '"8b"'] I understand that if/else list comprehension

Re: loop? maybe?

2009-04-10 Thread Mike Driscoll
en you'll have to change it slightly of course, probably by using a nested loop. Hopefully this isn't a homework question, but even if it is, it's an interesting exercise. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Q: "Best" book for teaching

2009-04-07 Thread Mike Driscoll
8-1 Zelle's Python Programming book is pretty good (and was written by a college professor) and I've heard good things about ORielly's Learning Python by Lutz. - Mike -- http://mail.python.org/mailman/listinfo/python-list

HTML Generation

2009-04-03 Thread Mike
Hello all, I'm writing a web app and wanted to do some html generation (I really do not like to maintain or write html). I'm thinking of writing a dsl based on the following: def html(): return def a(): return def body(): return (html, ...(head, (style, "id", {"font-color":"black"}

Re: Any library to bind python with Yahoo mail service

2009-04-02 Thread Mike Driscoll
tion  via Yahoo mail Service . > Thanks Google's first hit was this: http://developer.yahoo.com/python/ It's not a library, but it's the way that Yahoo itself recommends. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com python AttributeError!

2009-03-31 Thread Mike Driscoll
;Excel.Application") > myExcel.Visible = 1    # or, True > > causes (as Rebecca notes above): > > AttributeError: Property 'Excel.Application.Visible' can > not be set. > > Thanks, > > Michael This works fine for me on Windows XP and Python 2.5. It looks like Rebecca is using Python 2.2, which might be the issue. I would also upgrade to the latest PyWin32 as well. I'm using 212. - Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax disagreement between IDLE and pydev?

2009-03-30 Thread Mike Driscoll
... >   "<<=" ...     ">>=" ...     "**=" ...     "lambda" ...     "not" ... >     "+" ...     "-" ...     "~" ...     "(" ... >   "[" ...     "{" ...     "False" ...     "True" ...     "None" ... > ...     ... >   ...     ...     ...     ... >      "\'" ...     "\"" ... >   "\'\'\'" ...     "\"\"\"" ...     "\'" ...     "\"" ...     "\'\'\'" > ...     "\"\"\"" ... > > Can I assume pydev is wrong or am I missing something? If it works that way in IDLE and from the command line python, then it's almost proof positive that pydev goofed up. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyowa Meeting this week

2009-03-30 Thread Mike Driscoll
On Mar 30, 10:33 am, Mike Driscoll wrote: > Hi, > > This is just a reminder that we have a Pyowa meeting this week. It > will be held at Durham Center in Ames, IA on the ISU campus from 7-9 > p.m. Directions are on the website (www.pyowa.org). Topics include the > following:

Pyowa Meeting this week

2009-03-30 Thread Mike Driscoll
area, come on out! Bring your friends, even if they think Perl is the coolest thing since sliced bread. We'll set them straight! Mike Driscoll www.pyowa.org -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >