Re: continuous plotting with Tkinter

2005-02-04 Thread Martin Blume
u poll for new values. > I already tinkered with threads, yet it didn't work. I'll try again. > > Another option is to use a Tk-compatible file or socket > of some kind which triggers a callback when data comes > in. See > >htttp://www.astro.washington.edu/rowen/Tk

Re: "pickle" vs. f.write()

2005-02-05 Thread Martin Miller
elf.__class__.__name__, ', '.join('%s=%r' % (k, v) for k, v in self.__dict__.items())) Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: oddness in super()

2005-06-19 Thread Martin Blume
"John Machin" schrieb > > [analysis of super() "oddness"] > A great analysis, but what's a "pogo stick" and where can I get one? Thanks Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: oddness in super()

2005-06-19 Thread Martin Blume
"Björn Lindström" schrieb > > > A great analysis, but what's a "pogo stick" and where can I get one? > > http://search.ebay.com/pogo-stick > Yes, that explains the "bouncing with the pogo stick"; I would have poked around with a stick. R

Re: eval() in python

2005-06-21 Thread Martin Blume
30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> t='m=3' >>> m Traceback (most recent call last): File "", line 1, in ? NameError: name 'm' is not defined >>> exec(t) >>> m 3 >>> HTH Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: case/switch statement?

2005-06-22 Thread Martin Miller
g access to the local namespace: greeting = "Hello there, " x = 2 exec { 1: """greeting += 'Tom'""", 2: """greeting += 'Dick'""", 3: """greeting += 'Harry'""", }.get(x, """greeting += 'Unknown'""") print greeting Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: don't understand MRO

2005-06-24 Thread Martin Franklin
Uwe Mayer wrote: > Thursday 23 June 2005 19:22 pm Terry Reedy wrote: > > [...] > >>In the absence of other information, I would presume that none of the >>other classes have a move() method. > > > move() is implemented in the class qtcanvas.QCanvasItem > I checked the pyqt sources and it is lin

Problem with struct.unpack

2005-07-01 Thread Kuner Martin
(doorOpen,) = struct.unpack("1x1B6x", strBuffer) Traceback (most recent call last):   File "", line 1, in ? UnicodeEncodeError: 'ascii' codec can't encode character u'\xf0' in position 1: ordinal not in range(128) Why is that not working wi

correct email

2005-07-05 Thread Stephen Martin
Bah, sorry about the incorrect email and name! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to kill easygui dialog?

2005-07-20 Thread Martin Franklin
[EMAIL PROTECTED] wrote: > William, > > Thanks for the reply. No flames, but I am running on both Linux and > Windows, so I need a x-platform solution. I thought I had it with > easygui... > > Must try some other ideas > Can you post an example... the following works for me... >>> impo

Re: difficulty connecting to networked oracle database

2005-07-21 Thread Martin Franklin
and discussions but > have no success thus far. > > Thanks, Graeme. > > not used it on Windows XP (just 2000) but cx_Oracle worked for me http://sourceforge.net/projects/cx-oracle/ Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPythin installation woes

2005-07-22 Thread Martin Franklin
extras So I assume a yum install wxPythonGTK2 will get you wxPython installed. *I havn't done that since I only use Tkinter* Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Problems with permissions etc

2005-07-27 Thread Martin Franklin
d of system at home can be fixed by adding your user account to the /etc/sudoers file like so:- martin ALL=(ALL) ALL so every now and then when I need to do somthing as root I just sudo (and enter *my* password) Linux distros such as ubuntu use this scheme and I think MAC OS X does too.

Re: Python IDE's

2005-08-01 Thread Martin Franklin
Jon Hewer wrote: > Hi > > > > I am yet to find a Python IDE (for both Windows and Mac) that I like. > Any suggestions? > > > > Thanks > See:= http://wiki.python.org/moin/PythonEditors For more help Thanks Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: "Ordered" dicts

2005-08-10 Thread Martin Miller
>. Owen's 'OrderedDict' class is [also] implemented by subclassing dict. To avoid continued reinvention of this wheel, I'd also vote to have this functionality be at least included in a standard module, if not built-in. They say necessity is the mother of invention, therefore a lack of standards or built-ins must be the mother of reinvention. ;-) -Martin -- http://mail.python.org/mailman/listinfo/python-list

gtkmozembed in fedora core 3

2005-08-23 Thread Martin DeMello
indings (I need to deploy this at work, so I'm trying to make the minimal possible change to a stock fc3 install). Upgrading to fc4 is sadly not an option :-/ martin -- http://mail.python.org/mailman/listinfo/python-list

Re: gtkmozembed in fedora core 3

2005-08-24 Thread Martin DeMello
ons --enable-default-toolkit=gtk2 in your mozconfig file. > Check /usr/lib/mozilla for libgtkembedmoz.so if it's not there you'll > have to rebuild your mozilla/firefox rpm , again I think, these are just > some random tips .. > Good luck! Thanks, I'll give it a whirl! martin -- http://mail.python.org/mailman/listinfo/python-list

Re: launching adobe reader with arguments from os.system call

2005-09-06 Thread Martin Miller
h >] >) A downside is that it requires you to know the full path to the application, 'acroRd32.exe' in your case. On the other hand, I think you could pass just about any argument values (as strings) that you wished in the list passed as the third argument. HTH, -Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: determine if os.system() is done

2005-09-07 Thread Martin Franklin
Xah Lee wrote: > suppose i'm calling two system processes, one to unzip, and one to > “tail” to get the last line. How can i determine when the first > process is done? > > Example: > > subprocess.Popen([r"/sw/bin/gzip","-d","access_log.4.gz"]); > > last_line=subprocess.Popen([r"/usr/bin/tail","

Re: determine if os.system() is done

2005-09-08 Thread Martin Franklin
wish to know if there's non-hack way to > determine when a system process is done. > > Xah > [EMAIL PROTECTED] > ∑ http://xahlee.org/ > I know you've found the answer to your question, however for the exact example you gave a much better solution comes

Re: reading the last line of a file

2005-09-08 Thread Martin Franklin
Xah Lee wrote: > Martin Franklin wrote: > >>import gzip >>log_file = gzip.open("access_log.4.gz") >>last_line = log_file.readlines()[-1] >>log_file.close() > > > does the > log_file.readlines()[-1] > actually read all the lines first? Y

Re: reading the last line of a file

2005-09-08 Thread Martin Franklin
Martin Franklin wrote: > Xah Lee wrote: > >>Martin Franklin wrote: >> >> >>>import gzip >>>log_file = gzip.open("access_log.4.gz") >>>last_line = log_file.readlines()[-1] >>>log_file.close() >> >> >>does the &

Re: reading the last line of a file

2005-09-08 Thread Martin Franklin
Martin Franklin wrote: > Martin Franklin wrote: > >>Xah Lee wrote: >> >> >>>Martin Franklin wrote: >>> >>> >>> >>>>import gzip >>>>log_file = gzip.open("access_log.4.gz") >>>>last_line = log_

Re: Printer List from CUPS

2005-09-08 Thread Martin Franklin
Mike Tammerman wrote: > Hi, > > I want to get the printer list from CUPS. I found some ways using > > lpstat -p and > http://localhost:631/printers > > but, these ways require some parsing and I am not sure, if the parsing > works all the time. A pythonic way would be very helpful. > > Thanks,

Re: Printer List from CUPS

2005-09-08 Thread Martin Franklin
, I know they are a very python friendly bunch :) Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python linear algebra module -- requesting comments on interface

2005-09-09 Thread Martin Miller
e errors better. Very nice work overall, IMHO. Best, -Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: services on linux

2005-09-20 Thread Martin Franklin
Christoph Haas wrote: > On Tue, Sep 20, 2005 at 02:57:26AM -0500, pt python wrote: > >>im moving from the windows world to the linux world and i need to make >>a python script to see if a service is instaled (ex: apache), if it is >>running or stoped and to start/stop a service like apache or mysq

Re: Curses on Windows

2005-02-08 Thread Martin Miller
I just tried the flangy.com link and it appears to be OK now. Martin Peter wrote: > ... > One reply (in fact the only reply - thanks Tim Golden) suggested I > look at http://flangy.com/dev/python/curses/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python connect to server using SSH protocol

2005-02-08 Thread Martin Franklin
Simon Anders wrote: Hi Laszlo Zsolt Nagy wrote: [EMAIL PROTECTED] wrote: How can python connect to server which use SSH protocol? There should be a better way. Simon There is : pexpect! http://pexpect.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggesion for an undergrad final year project in Python

2005-02-13 Thread Martin Christensen
w what you're going to do, there's really very little need to worry about it, at least in my opinion. Martin - -- Homepage: http://www.cs.auc.dk/~factotum/ GPG public key: http://www.cs.auc.dk/~factotum/gpgkey.txt -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (

Re: Second posting - Howto connect to MsSQL

2005-02-13 Thread Martin Bless
hese days - unfortunately the (Windows) binaries for Python24 are missing. Somebody succeeded in compiling? Please let me know, if the binaries are somewhere out there. mb - Martin -- http://mail.python.org/mailman/listinfo/python-list

ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Martin MOKREJŠ
Hi, is this a bug or "feature" that I have to use float() to make int() autoconvert from it? $ python Python 2.3.4 (#1, Feb 14 2005, 10:00:27) [GCC 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. a = 1 "%5.

Re: multi threading in multi processor (computer)

2005-02-15 Thread Martin Christensen
y for the rest of us. :-) This one actually made me laugh out loud. Martin - -- Homepage: http://www.cs.auc.dk/~factotum/ GPG public key: http://www.cs.auc.dk/~factotum/gpgkey.txt -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using Mai

Re: Getting milliseconds in Python

2005-02-17 Thread Martin Christensen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >>>>> "Brian" == Brian Beck <[EMAIL PROTECTED]> writes: Brian> Despite a millisecond being a thousandth of a second [...] A math teacher! A math teacher! My kingdom for a math teacher! Martin - -- Homepage:

Re: newbie question - iterating through dictionary object

2005-02-17 Thread Martin Christensen
loop % python2.4 -m timeit -c "a = {1:1, 2:2, 3:3, 4:4, 5:5}" "for x in a.keys(): pass" 10 loops, best of 3: 2.1 usec per loop Martin - -- Homepage: http://www.cs.auc.dk/~factotum/ GPG public key: http://www.cs.auc.dk/~factotum/

Re: Getting milliseconds in Python

2005-02-17 Thread Martin Christensen
call in the professors to determine if 2+2=4', but, well... :-) Martin - -- Homepage: http://www.cs.auc.dk/~factotum/ GPG public key: http://www.cs.auc.dk/~factotum/gpgkey.txt -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (G

Re: Test for structure

2005-02-20 Thread Martin Miller
tribute, it can still be used in a for loop. I think the right answer would depend on what exactly the OP intends to do with the argument when it is a list (or is list-like in some way) -- i.e. he didn't say specifically that he wanted use it in a for loop. -Martin Te

Re: Test for structure

2005-02-21 Thread Martin Miller
que suggested by Robin Munn nearly a year ago (and referenced by the link in Simon Brunning's post): http://groups-beta.google.com/group/comp.lang.python/msg/c8befd4bed517bbc namely: try: a + '' except TypeError: pass else: a= [a] would be a good usable soluti

Re: Test for structure

2005-02-21 Thread Martin Miller
called with argument containing 1 thing items[0] = u'def' example() called with argument containing 4 things items[0] = 'aaa' items[1] = 111 items[2] = (4, 5) items[3] = 2.0098 example() called with empty list or None argument example() called with empty list

Re: Test for structure

2005-02-22 Thread Martin Miller
quired -- although aslist() might need a check for the single argument of None case, depending on whether it should return [] or something besides [None] in that situation. Best, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Execute a list

2005-02-22 Thread Martin Miller
Here is how to execute code in a string, similar to what was shown in your example: >>> s = 'print "hello"' >>> exec s hello Hope this helps. -- http://mail.python.org/mailman/listinfo/python-list

Re: Test for structure

2005-02-22 Thread Martin Miller
Ooops. I left out an "*" on a statement in the new aslist() function. I should have written: def aslist(*args): return list(*args) # corrected def f(arg): args = aslist(arg) ... Sorry, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Test for structure

2005-02-22 Thread Martin Miller
Nope, that isn't right either, in the sense that it handles all the cases properly, including "single string" vs "list of strings'. Guess this overly simplistic aslist() does not work after. I should have been more suspicious and cautious before posting. Sorry. Martin -

Re: How to write a ping client

2005-02-22 Thread Martin Bless
e by Jeremy Hylton if I remember correctly. But only to find that on the Linux machine I wasn't allowed as non root to ping from my script. So I went back to the os.system() call. mb - Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: basic tkinter/Windows question

2005-02-22 Thread Martin Franklin
onsole) You can then create a shortcut in the normal way Martin -- http://mail.python.org/mailman/listinfo/python-list

Can somebody help compiling 'mssqldb.pyd' for Python24 [win]?

2005-02-23 Thread Martin Bless
bin\cl.exe"' failed with exit status 2 Currently I'm not C-Guru enough to find out what's wrong. I'm hoping somebody else succeeds in compiling and can provide compiled module. I think the object-craft.com.au staff would gladly accept the binary as well, as they don't h

automating assignment of class variables

2005-03-02 Thread Martin MOKREJŠ
lined above has actually one serious error. I want to to self.a_ etc, not a_ as it gets overwritten by successive instances of the same class. But am lazy to fix it now as I believe it's anyway waste of time. ;) Thansk for help! Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Gordon McMillan installer and Python 2.4

2005-03-03 Thread Martin Bless
. Yes, I can confirm this observation. The same on my machine: any .exe crashes immediately. I too have the feeling the McMillan installer has benefits (I justed started playing with installers). But py2exe seems to work better at the moment. mb - Martin -- http://mail.python.org/mailman/listin

looking for way to include many times some .py code from another python code

2005-03-08 Thread Martin MOKREJŠ
ll be different, so I can't use global variables. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Scott David Daniels wrote: Martin MOKREJŠ wrote: Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: I know about module imports and reloads, but am not sure if this is the right way to go. Mainly, I want to assign to multiple o

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Kent Johnson wrote: Martin MOKREJŠ wrote: Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9 cat somefile2.py self.xxx = a self.zzz = b self.c = c self.d = d cat anotherfile.py def a(): in

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
ariables at once somewhere in their code? I still don't get why: "include somefile.py" would be that non-pythonic so that it's not available, but I have already two choices how to proceed anyway. Thanks. ;) Now have to figure out how to assign them easily into the XML tree. martin -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Hi to everyone who has repsonded. I'll try to clarify my problem in more detail. I believe I have the answers how to assign to self. in superclasses. In case you would know of yet another way, let me know. ;) Steve Holden wrote: Martin MOKREJŠ wrote: Diez B. Roggisch wrote: See my post on

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Peter Hansen wrote: Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables implies wanting to access them distinctly, not as

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Steve Holden wrote: Martin MOKREJŠ wrote: Peter Hansen wrote: Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables

Re: looking for way to include many times some .py code fromanotherpython code

2005-03-08 Thread Martin MOKREJŠ
Scott David Daniels wrote: Martin MOKREJŠ wrote: If I put them into a module, it get's executed only once unless I > do reload. And I'd have to use: "from some import *", because mainly I'm interrested in assigning to self: self.x = "blah" self.y =

Re: looking for way to include many times some .py code from anotherpython code

2005-03-09 Thread Martin MOKREJŠ
Steve Holden wrote: Martin MOKREJŠ wrote: Steve Holden wrote: [...] I will be *very* surprised if you can't get a much better (i.e. easier and more efficient) solution by stepping back from the programming Hmm, I'm not convinced, but I'll put few more words here then. ;) detai

'class' argument optional for new.instancemethod?

2005-03-11 Thread Martin Miller
t gets used when it *is* provided -- if nothing else, having it seems somewhat redundant given the presence of the 'instance' argument. TIA, Martin -- http://mail.python.org/mailman/listinfo/python-list

Add Properties to Instances?

2005-03-12 Thread Martin Miller
lts in the following ouput instead of '42': foobar.x: I also tried this: > foobar.__dict__['x'] = property(fget=lambda: 42) but get the same behavior. Can anyone tell me what's wrong with this approach (and perhaps the correct way to do it, if there is one)? TIA, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Add Properties to Instances?

2005-03-12 Thread Martin Miller
he details. Meanwhile, I'm going to study the replies so far and think about the whole issue (and design) a little more. Thanks to all who have replied, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter: always scroll to show last line of text

2005-03-13 Thread Martin Franklin
Benjamin Rutt wrote: I have a tkinter 'Text' and 'Scrollbar' connected and working normally. When a new line of text is inserted (because I'm monitoring an output stream), I'd like the text and scrollbar to be scrolled to the bottom, so the latest line of text is always shown. How to do this? Th

Re: Searching for a ComboBox for Tkinter?

2005-03-13 Thread Martin Franklin
le of ComboBox's out there already Pmw includes one as does Tix (IIRC) Cheers, Martin. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bind Escape to Exit

2005-03-13 Thread Martin Franklin
mailing list:- http://mail.python.org/mailman/listinfo/tkinter-discuss also available from gmane:- gmane.comp.python.tkinter Martin. -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for a ComboBox for Tkinter?

2005-03-13 Thread Martin Franklin
Martin Franklin wrote: Harlin Seritt wrote: I've created a ghetto-ized ComboBox that should work nicely for Tkinter (unfortunately no dropdown capabilities yet). I've found why it's such a pain in the @ss to create one. You have to re-create common methods and make sure they're

Re: Huge performance gain compared to perl while loading a text file in a list ...!?

2005-03-13 Thread Martin Franklin
Paul Rubin wrote: "Marc H." <[EMAIL PROTECTED]> writes: I'm fairly new to python, and don't know much of its inner working so I wonder if someone could explain to me why it is so much faster in python to open a file and load it in a list/array ? My guess is readlines() in Python is separating on n

Re: Add Properties to Instances?

2005-03-14 Thread Martin Miller
ue, in other words, it was considered too slow to check for instance property/discriptors -- although *why* is not clear to me. Best Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Listbox fill=BOTH expand=YES (Tkinter)

2005-03-14 Thread Martin Franklin
you checked it's parents packing options? Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Add Properties to Instances?

2005-03-14 Thread Martin Miller
Bengt Richter wrote, in part: > On 14 Mar 2005 01:19:23 -0800, "Martin Miller" <[EMAIL PROTECTED]> > wrote, in part: > >What still puzzles me, though, is why all the above to make properties > >work on instances is necessary in the first place. It's certainly

Re: Bitmaps On Buttons ?

2005-03-15 Thread Martin Franklin
are pack'ed or grid'ed relative to each other for more help you could try: http://www.pythonware.com/library/tkinter/introduction/ or the Wiki that has links to other sources of help (including the Tkinter mailing list http://tkinter.unpythonic.net/wiki/FrontPage Cheers Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread Martin Franklin
Tim Daneliuk wrote: In-Reply-To: <[EMAIL PROTECTED]> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Nick Craig-Wood wrote: Torsten Bronger <[EMAIL PROTECTED]> wrote: The current snaps

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Tk core, but usually only when a new _final_ version is released... Martin. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Harlin Seritt wrote: Martin, Take a look here: http://mail.python.org/pipermail/tkinter-discuss/2004-March/10.html It is a well-known post from what I understand. You may have already seen it before. Actually, (as I'm looking at a 8.4 demo set from ActiveTcl distribution), it seems the

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Harlin Seritt wrote: Martin, If I may ask, who actually works on the Tkinter module? Is there a certain group that does this? I'm just curious as I've never been able to find this information. I know there are, of course, someone who develops Tk but just not sure who does this on the P

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Harlin Seritt wrote: (snip) That said I have got a Tile Button example working (and I can change it's style) so perhaps not that much work Do you happen to have a sampling of this that I can get my hands on?? I've cc'd the tkinter mailing list to see if there is any more interest over there...

Re: Add Properties to Instances?

2005-03-19 Thread Martin Miller
Bengt Richter wrote: > On 14 Mar 2005 13:07:29 -0800, "Martin Miller" <[EMAIL PROTECTED]> wrote: > > >Bengt Richter wrote, in part: > >> On 14 Mar 2005 01:19:23 -0800, "Martin Miller" > ><[EMAIL PROTECTED]> > >> wrote, in par

MySQLdb binaries for Python 2.4 on Windows?

2004-12-02 Thread Martin Bless
I'd be happy and thankful if somebody could provide the MySQLdb binaries for Windows and Python 2.4. Have a nice day - mb - Martin Bless -- http://mail.python.org/mailman/listinfo/python-list

How can I change the timestamps of directories? (os.utime(), WinXP)

2004-12-09 Thread Martin Bless
ne via the os-module? Q: Is it possible at all? Somebody knows? Thanks, mb - Martin Bless """ Trying to the timestamps of a directory """ import sys, os, stat, datetime, time today = datetime.datetime.now() pastday = today - datetime.timedelta(days=11) atime = int

Re: samba/windows shares

2004-12-10 Thread Martin Franklin
ngs in the samba source code tree http://www.samba.org/ Regards Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 338: Executing modules inside packages with '-m'

2004-12-14 Thread Martin Bless
good to me. One thing I stumbled across with the current implementation: Why doesn't "python -m abc" work with ./abc/ ./abc/__init__.py assuming ./abc/ is directly on the path? In analogy to normal module import? mb - Martin -- http://mail.python.org/mailman/listinfo/python-list

Step by step: Compiling extensions with MS Visual C++ Toolkit 2003 - msvccompiler-patch.txt (0/1)

2004-12-15 Thread Martin Bless
ule you want to build - the dir that contains the "setup.py" file. 12.4 Start building the module including the extension using distutils with the command: python setup.py build 13. There aren't fatal errors? Congratulations, you made it! Why not install then: python setup.py install should do the trick. (Yes, I had two or three warnings. But they don't seem to be important). 14. Earn what you deserve Start Python and import: Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb >>><-- imported! no error here! Yes, it does import :-) And it does work :-) And _mysql.pyd is similar in size to those versions I had before (about 185 kB) :-) Life goes on. A different time another thread I'm going to ask about the warnings I got with building MySQLdb ... mb - Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: A beginner's problem...

2004-12-18 Thread James Martin
Try deleting the Compiled Python File that was created during import -- extension pyc. Then import again. It seems to me (I'm a novice too) that, when you import a module, Python automatically compiles it. Then when you import it later, the compiled version is imported if it exists. "Amir Dek

how to pass globals across modules (wxPython)

2004-12-19 Thread Martin Drautzburg
My wxPython program starts execution in mainFrame.py like this [...] class MainApp(wxApp): def OnInit(self): self.mainFrame = MainFrame(None) self.mainFrame.Show() self.SetTopWindow(self.mainFram

accessing module global vars by name

2004-12-19 Thread Martin Drautzburg
Withing a module I can assign a value to a global var by assigning to it in the outermost scope. Fine. But how can I do this if the attribute name itself is kept in a variable. Once the module is loaded I can access the module's namespace no problem, but inside the module the dictionary is not yet

Code without effect (wx demo TreeCtrl.py ImageList)

2004-12-20 Thread Martin Drautzburg
In the wx demoy TreeCtrl.py I find the following code, that should have no effect but seems to be needed nevertheless. class TestTreeCtrlPanel(wx.Panel): def __init__(self, parent, log): [...} self.tree = MyTreeCtrl(self, tID, wx.DefaultPosition, ... isz = (16,16)

How to find unused methods

2004-12-22 Thread Martin Drautzburg
Is there an elegant way for finding unsent methods as in Smalltalk ? I am aware of the fact that due to pythons dynamic typing, no tool in the world can find ALL unsent methods (same in Smalltalk). But finding the most obvious ones would already be of some help. -- http://mail.python.org/mailman

Garbage collector strategy

2004-12-22 Thread Martin Drautzburg
Just for curiosity: does python use a mark-and-sweep garbage collector or simple reference counting? In the latter case it would not garbage collect circular references, right ? For mark-and-sweep, I assume there must be a toplevel Object from which all other objects can be accessed or they will b

Re: Complementary language?

2004-12-27 Thread Martin Drautzburg
HackingYodel <[EMAIL PROTECTED]> writes: > Does any single language do a better job in > Python's weaker areas? Would anyone care to suggest one to supplement > Python. My first real OO language was Smalltalk. But the existing Smalltalk implementations all have some severe shortcomings. Either

wxTreeCtrl checking for valid IDs

2004-12-27 Thread Martin Drautzburg
I have run across a weired problem: I am using a wxTreeCtrl with a model for each tree node. The tree expands "lazily" and each time a node is expanded, its children (Views) are completely rebuilt, creating new IDs. The children register their respecive models using two self written classes "Model"

Re: Text-to-speech

2005-03-21 Thread Martin Franklin
http://ludios.org/programs/tkfestival that uses expect to control festival, I assume it has a very easy to use CLI and would be simple to make use of pexpect to control festival from python in the same way. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows, Python and low level networking

2005-03-23 Thread Martin Franklin
[EMAIL PROTECTED] wrote: Is it possible to have low level netwoking with python under Windows? Like raw sockets? Is it possible to send a single packet using python under windows? Thank you Yes http://www.python.org/doc/2.4/lib/module-socket.html -- http://mail.python.org/mailman/listinfo/python-li

Re: Windows, Python and low level networking

2005-03-23 Thread Martin Franklin
Peter Hansen wrote: [EMAIL PROTECTED] wrote: Is it possible to have low level netwoking with python under Windows? Like raw sockets? Is it possible to send a single packet using python under windows? Google is your friend: Try searching with "python sockets", for example... (You *have* heard of Go

Re: Python docs [was: function with a state]

2005-03-24 Thread Martin Ambuhl
Xah Lee wrote: The Python doc is relatively lousy, from content organization to the tech writing quality. I think i'll just post snippets of my comments as i find them. (and feel like exposing) The cross-posting idiot is back. Next he'll be posting his readings from Richard Burton's _Arabian Nigh

Problems compiling PIL under Cygwin

2005-04-04 Thread Martin Magnusson
c_with_child: *** child state child loading dlls error: Resource temporarily unavailable Does anybody know what could be done to solve this? / martin -- http://mail.python.org/mailman/listinfo/python-list

Re: check interpreter version before running script

2005-04-05 Thread Martin Franklin
t a fallback solution # use os_walk instead of os.walk Thanks, rbt You may be interested in this... http://www.jorendorff.com/articles/python/path/ as an alternative to the os.path functions... Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: logging as root using python script

2005-04-07 Thread Martin Franklin
igure sudo(8) to not prompt for any password, BTW. Cheers! another alternative would be setuid for more on this (and why it could be a bad idea) google... Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Northampton, UK

2005-04-12 Thread Martin Franklin
Fuzzyman wrote: Just on the off chance I thought I'd ask if there were any Pythoneers out there local to Northampton UK ? Best Regards, Fuzzy http://www.voidspace.org.uk/python I'm just over the border (Bedfordshire) but like a lot of people commute :-( -- http://mail.python.org/mailman/listinf

email: Content-Disposition and linebreaks with long filenames

2005-04-13 Thread Martin Körner
ample file with a very long filename 0123456789.zip' fp = open(file, 'rb') part_att = MIMEBase('application','zip') part_att.set_payload(fp.read()) fp.close() part_att.add_header('Content-Disposition', 'attachment', filename

Re: Tk Listbox - Selected Item ?

2005-04-14 Thread Martin Franklin
(lb.curselection()[0]) provided the listbox is in single selection mode or only one item is selected Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Tk Listbox - Selected Item ?

2005-04-15 Thread Martin Franklin
Peter Moscatt wrote: Martin Franklin wrote: Peter Moscatt wrote: I am having trouble understanding the methods for the Listbox from Tk. If I was to select at item in the list using a mouse click (have already created the bind event) - what method returns the text of the selected item ? Pete Pete

Re: The value of the entry widget doesn't get updated

2005-04-19 Thread Martin Franklin
ord print self.username.get() print self.password.get() app = LoginMenu(msg) app.master.title("Login Menu") app.master.maxsize(280,200) app.mainloop() HTH Martin -- http://mail.python.org/mailman/listinfo/python-list

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