Re: Rational numbers

2007-02-23 Thread Martin Manns
x2 Type "help", "copyright", "credits" or "license" for more information. >>> import gmpy >>> gmpy.version() '1.01' >>> Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: ArcGIS and Python

2007-02-27 Thread martin . laloux
Try Esri http://support.esri.com/index.cfm?fa=forums.gateway or http://geography.sdsu.edu/People/Pages/jankowski/public_html/web683/lectures683.htm -- http://mail.python.org/mailman/listinfo/python-list

py2exe, library.zip and python.exe

2007-02-28 Thread Martin Evans
running as a service which has the ability to launch python scripts as a logged on user) Thanks, Martin. -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe, library.zip and python.exe

2007-02-28 Thread Martin Evans
"Thomas Heller" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Martin Evans schrieb: >> I have converted a Python script using py2exe and have it set to not >> bundle >> or compress. The result is my exe and all the support files including >

Re: dictionary viewer

2007-11-05 Thread Martin Marcher
2007/11/5, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > On Nov 5, 3:10 pm, Erika Skoe <[EMAIL PROTECTED]> wrote: > > > > That's funny, I can't see anything. Of course, it's an empty dict! tzz, *shaking head* martin -- http://noneisyours.marcher.name http:/

Re: Library package import question

2007-11-05 Thread Martin Marcher
2007/11/5, Frank Aune <[EMAIL PROTECTED]>: > To prevent namespace pollution, I want to import and use this library in the > following way: > > import Foo > (...) > t = Foo.module2.Bee() from x import y as z that has always worked for me to prevent pollution... -- http://noneisyours.marcher.na

Re: regular expression syntax the same in Python, Perl and grep?

2007-11-07 Thread Martin Marcher
2007/11/7, Chris Mellon <[EMAIL PROTECTED]>: > On Nov 7, 2007 12:11 PM, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > How similar is Python's re module (regular expressions) compared > > to Perl's and grep's regular expression syntaxes? > > > > Somewhat. > > > I really hope regular expression

Re: Using python as primary language

2007-11-09 Thread Martin Vilcans
> If by 'this' you mean the global interpreter lock, yes, there are good > technical reasons. All attempts so far to remove it have resulted in an > interpeter that is substantially slower on a single processor. Is there any good technical reason that CPython doesn't use the GIL on single CPU sys

Re: Using python as primary language

2007-11-09 Thread Martin Vilcans
On Nov 9, 2007 10:37 AM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "Martin Vilcans" <[EMAIL PROTECTED]> writes: > > >> If by 'this' you mean the global interpreter lock, yes, there are good > >> technical reasons. All attempts so far

Re: Using python as primary language

2007-11-12 Thread Martin Vilcans
On Nov 10, 2007 12:48 AM, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Nov 9, 1:45 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > 2. If micro-locked Python ran, say, half as fast, then you can have a lot > > of IPC (interprocess communition) overhead and still be faster with > > multiple process

reading file objects in chunks

2007-11-12 Thread Martin Marcher
unksize) while len(chunk) == chunksize: compute_data(chunk) f.read(chunksize) I just don't feel comfortable with it for some reason I can't explain... thanks martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list

Re: how to know if folder contents have changed

2007-11-12 Thread Martin Marcher
;d create a "hidden" cache file parsable by configparser and have filename = $favorite_checksum_algo - key value pairs in it if it's not a long running process. Otherwise I'd probably go with fam (or hal i think that's the other thing that does that) hth mart

[OT] The Jew Spam on this list

2007-11-13 Thread Martin Marcher
a heated topic but people please it's "just spam" and every message regarding this topic is spam too (funny enough, so is this message) please just add this stuff to your killfile or whatever you use. thanks martin PS: if you must discuss this opinion with me answer to me off li

Re: how to know if folder contents have changed

2007-11-17 Thread Martin Marcher
I think that without further information from the OP about the requirements all we can do is guessing. So both of our solutions are just theory after all (just my personal opinion) 2007/11/14, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > On Nov 12, 11:27 am, "Martin Marcher" <[E

Re: how to know if folder contents have changed

2007-11-17 Thread Martin Marcher
I just found this for win32 which seems to be the same as FAM provides: http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html So it's not about FAM as a definitive product to be used but more like something nearer to the OS that is there anyway and will tell you abou

string conversion latin2 to ascii

2007-11-27 Thread Martin Landa
2) to get -> Ukazka_moznosti_vyuziti_programu_OpenJUMP_v_SOA Thanks for any hits! Regards, Martin Landa -- http://mail.python.org/mailman/listinfo/python-list

Re: reading raw variables from file

2007-11-30 Thread Martin Blume
ot;).read() print my_var with stuff.py containing my_var="bye" I use this exec open("stuff.py").read() mechanism to set values in my scripts: the script sets a useful default, a command-line argument in the form a valid python program may override it. Why bother with inv

Re: reading raw variables from file

2007-11-30 Thread Martin Blume
ing this instead of > parsing the files and checking said types? > You might want to look at the eval, exec and execfile; but bear in in mind Paddy's warning about security. Regards Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: reading raw variables from file

2007-12-02 Thread Martin Blume
gt;exec open("stuff.py").read() > >print my_var > > with stuff.py containing > > my_var="bye" > > It's not the same... > > from stuff import * > > ...is. > And indeed it is. Thanks. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: which configparse?

2007-12-06 Thread Martin Marcher
it's not yet stable. (Actually not that hard rules, but I hope you get what I meant) martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list

Re: pprinting objects

2007-12-08 Thread Martin Blume
.obj.__class__) return s a_t = t() print "a t obj: %s" % (a_t) a t obj: __main__.t x,1 y,2 obj, HTH Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: making all letters Caps/Small Letters

2007-12-14 Thread Martin Blume
r might help".upper() "OR LOWER".lower() HTH Martin -- http://mail.python.org/mailman/listinfo/python-list

datetime question

2006-04-18 Thread Philippe Martin
Hi, I need to get the date and time under Windows and Linux but need the information visible to the user (cannot find my words) not the sytem information (ex: a PC setup on greenwich but the date/time displayed are relative to some other place. Regards, Philippe -- http://mail.python.org/mailm

Re: datetime question

2006-04-18 Thread Philippe Martin
Thanks, yes, I guess the question is ... what date/time is it looking at ? and is it the same under various OSs ? Philippe Jorge Godoy wrote: > Philippe Martin wrote: > >> Hi, >> >> I need to get the date and time under Windows and Linux but need the >> i

Re: datetime question

2006-04-19 Thread Philippe Martin
:-) Thanks. Philippe Scott David Daniels wrote: > Jorge Godoy wrote: >> Philippe Martin wrote: >> >>> I need to get the date and time under Windows and Linux but need the >>> information visible to the user (cannot find my words) not the sytem >>> in

Re: Python IDE for linux

2006-04-20 Thread Philippe Martin
If your PC can handle eclipse ... memory-wise, I strongly suggest you give pydev a shot. Philippe Neil Isaac wrote: > I have been writing python my little python scripts in gedit and running > them using the command line. At this point I'm thinking that I would like > to start using a real ID

Re: Thanks from the Java Developer

2006-04-20 Thread Philippe Martin
Yes, and then you have to answer Java/C/C++ job/contracts opening knowing real well the mistake they're making ... as well as you are for answering ;-) Ant wrote: > Python ruined my life. > > I am a Java programmer by profession, and ever since learning Python, I > find it a real chore to open

Re: Tkinter hiding/showing widgets

2006-04-21 Thread Philippe Martin
Maybe like this ? http://www.faqts.com/knowledge_base/view.phtml/aid/21215/fid/264 I noticed with wxWidget, which uses the same packing principle (xlib inheritance ?) that hidding a widget can have a strange effect on the layout of the "other guys" still visible ... so I just disable them now in

Re: Can my python script return a value to the c program executing it?

2006-04-22 Thread Philippe Martin
Like this ? http://aspn.activestate.com/ASPN/Mail/Message/python-list/1304518 Philippe vduber6er wrote: > I have a C program that calls my python script by > > exec_pycode(code); > > code = "import CheckFasta\nCheckFasta.CheckFasta (\"sampledata.txt\", > %d)\n", PyNum); > > CheckFasta.p

Re: i18n hell

2006-04-24 Thread Martin Blais
unately, but is centralized using my table declaration that lists the desired conversions for each column). See http://furius.ca/antiorm/ for something simple that works well. cheers, -- Martin Furius Python Training -- http://furius.ca/training/ -- http://mail.python.org/mailman/listinfo/python-list

Multiple hierarchie and method overloading

2006-04-24 Thread Philippe Martin
Hi, I have something like this: Class A: def A_Func(self, p_param): . Class B: def A_Func(self): . Class C (A,B): A.__init__(self) B.__init__(self) . self.A_Func() #HERE I GET AN EXCEPTION "... takes at least 2 arguments

Re: Multiple hierarchies and method overloading

2006-04-25 Thread Philippe Martin
alling A_Func(self) as it was checked against A_Func(self, p_param). Regards, Philippe Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "Ben Cartwright" <[EMAIL PROTECTED]> wrote: > >>Philippe Martin wrote: >> >>> I

Re: Multiple hierarchie and method overloading

2006-04-25 Thread Philippe Martin
Thanks, I'll try that. Philippe Ben Cartwright wrote: > Philippe Martin wrote: >> I have something like this: >> >> Class A: >> def A_Func(self, p_param): >> . >> Class B: >> def A_Func(self): >>

Re: wxpython warnings

2006-04-26 Thread Philippe Martin
I had a similar but simple problem (the file was missing) and had to check by hand before calling wxPython. Can you check the tag by hand before calling wxPython ? Philippe Iain King wrote: > I have a wxpython program that displays TIF images. Sometimes it will > encounter a tag the tiff l

Re: Inherit from array

2006-04-26 Thread Philippe Martin
I think he did from array import * Philippe bruno at modulix wrote: > TG wrote: >> Hi there. >> >> I'm trying to create a simple class called Vector which inherit from >> array. > > Which array ? > > [EMAIL PROTECTED] ~ $ python > Python 2.4.2 (#1, Feb 9 2006, 02:40:32) > [GCC 3.4.5 (Ge

Re: Events in Python?

2006-04-26 Thread Philippe Martin
Besides the other anwsers, you might want to check the signal module. Regards, Philippe [EMAIL PROTECTED] wrote: > Here is another non-pythonic question from the Java Developer. (I beg > for forgiveness...) > > Does Python have a mechanism for events/event-driven programming? > > I'm not ne

Re: wxpython warnings

2006-04-26 Thread Philippe Martin
Hi, This is an answer I got from the wxPython NG: """ If it is a wxLog message (I think it is) then you can temporarily disable log messages by creating an instance of wx.LogNull.  Or you can do something like set the log target to some other object than the default wx.LogGui, or set the log l

Re: MinGW and Python

2006-04-26 Thread Philippe Martin
This might relevant. http://www.aceshardware.com/read.jsp?id=153 Philippe Robert Kern wrote: > Martin v. Löwis wrote: >> Srijit Kumar Bhadra wrote: >> >>>Is there any specific reason for not using MinGW to build the official >>>distribution of Python fo

Re: print names of dictionaries

2006-04-27 Thread Philippe Martin
Hi, I do not know if there is a way to overload the instantiation of all objects in Python but I thought of something like this to fetch any object with its name: g_dict = {} def create_object (v,s): p = v g_dict[s] = id(p) return p #ex object = create_object ([1,2,3,4], 'A LIST') Ph

Re: print names of dictionaries

2006-04-27 Thread Philippe Martin
OK, totally dumb ! g_dict[s] = p Philippe Martin wrote: > Hi, > > I do not know if there is a way to overload the instantiation of all > objects in Python but I thought of something like this to fetch any object > with its name: > > g_dict = {} > > > def c

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Why is that ? to me it makes sense when I see self.__m_var that I'm dealing with a member variable taht derived classes will not see/access. Philippe Steven Bethard wrote: > Panos Laganakos wrote: >> we usually define private properties and provide public functions >> to access them, in the f

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
he implementation later if you need > > to. But python allows you to do this with properties: > [snip] > > Which should not be interpreted as saying you should start writing a > > bunch of properties now. ;) Instead, only introduce a property when > > you find that something

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Edward Elliott wrote: > Panos Laganakos wrote: >> i.e. we usually define private properties and provide public functions >> to access them, in the form of: >> get { ... } set { ... } >> >> Should we do the same in Python: >> Or there's no point in doing so? >> >> Some other techniques come to mi

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Edward Elliott wrote: > Philippe Martin wrote: > '' > > On the other hand, foo.__doc__ and foo.__name__ work fine. > > (I was going to quote your post but my reader interprets everything after > the two dashes as your sig and ignores it. And I won't

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Duncan Booth wrote: > Philippe Martin wrote: >> Steven Bethard wrote: >>> [Please don't top-post] >> >> OK I won't, is that a general rule? (I've been top posting for quite some >> time now and it is the first time I see that warning) > &g

Re: wxPython, wxcombobox opening

2006-04-29 Thread Philippe Martin
Hi, I do not have the answer but am very interested in the issue. I tried this: l_ev = wx.MouseEvent(wx.wxEVT_LEFT_DOWN) l_ev.SetEventObject(self.GetCombo()) self.GetEventHandler().ProcessEvent(l_ev) Which did send the event to the combo (which is in a pannel in my case) .. but that is apparentl

Re: OOP techniques in Python

2006-05-01 Thread Philippe Martin
Thanks, Did not know that. Philippe Dennis Lee Bieber wrote: > On Thu, 27 Apr 2006 14:32:15 -0500, Philippe Martin > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> >> What then is the point of the double underscore (if any) ?: > >

Re: wxPython, wxcombobox opening

2006-05-02 Thread Philippe Martin
Hi, >From the wxPython list: > Hi, > > Which event must I catch to be called when the user clicks on the combo > "button" to make the drop down list to appear ? No, there isn't a specific event for the opening of the drop-down box. Regards, Philippe

Re: Gettings subdirectories

2006-05-04 Thread Philippe Martin
Hi, The second edition of "Programming Python - O'REILLY - Mark Lutz" shows how to do that using "os.path.walk" Philippe Florian Lindner wrote: > Hello, > how can I get all subdirectories of a given directories? os.listdir() > gives me all entries and I've found no way to tell if an object

Re: Progamming python without a keyboard

2006-05-04 Thread Philippe Martin
That reminds me a session in an R&D lab a long time ago One of the guys kept talking to himself, commenting code, bugs . he drove me nuts Eventually (weeks later) another guy silently stood up, went to the first guy, and without a word attempted to strangle him. He got stopped ... but did no

Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
Hi, This code works, but is it "appropriate" ? l_init = False if True == l_init and 1234 = l_value: print 'l_value is initialized' I know I can do this with a try but ... Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
I'm sorry (typo): l_init = False if True == l_init and 1234 == l_value: print 'l_value is initialized' Note that 1234 == l_value does not get evaluated. Philippe vbgunz wrote: > you don't have to say: > > if True == l_init > > it is suggested you simply say: > > if l_init: > > Reme

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
Larry Bates wrote: > Philippe Martin wrote: >> Hi, >> >> This code works, but is it "appropriate" ? >> >> l_init = False >> >> if True == l_init and 1234 = l_value: >> print 'l_value is initialized' >> >&

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Martin Blume
"Philippe Martin" schrieb > Hi, > > This code works, but is it "appropriate" ? > > l_init = False > > if True == l_init and 1234 = l_value: > print 'l_value is initialized' > > I know I can do this with a try but ... > I am a P

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
bruno at modulix wrote: > Philippe Martin wrote: > (snip) >> >> l_init really is a boolean parameter and l_value a value that _might_ >> exist in a shelve. >> >> So I just want to have a parameter to a method so if the first value >> tested is false (

Re: Active Directory Authentication

2006-05-05 Thread Philippe Martin
Benji York wrote: > D wrote: >> Is it possible to have Python authenticate with Active Directory? >> Specifically what I'd like to do is have a user enter a >> username/password, then have Python check the credentials with AD - if >> what they entered is valid, for example, it returns a 1, otherwi

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
bruno at modulix wrote: > Philippe Martin wrote: >> bruno at modulix wrote: >> >> >>>Philippe Martin wrote: >>>(snip) >>> >>>>l_init really is a boolean parameter and l_value a value that _might_ >>>>exist in a shelve.

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
Fredrik Lundh wrote: > Philippe Martin wrote: > >> l_init really is a boolean parameter and l_value a value that _might_ >> exist in a shelve. >> >> So I just want to have a parameter to a method so if the first value >> tested is false (l_init) then the

Re: cross platform libraries

2006-05-05 Thread Philippe Martin
Through Wine maybe ? Philippe Dennis Lee Bieber wrote: > On 4 May 2006 09:57:15 -0700, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > >> I am using python on a linux terminal. >> >> I want to shutdown a remote windows box. I found a script which does >> something like this

Re: How can I do this with python ?

2006-05-08 Thread Philippe Martin
Xiao Jianfeng wrote: > Tim N. van der Leeuw wrote: >> Your question is insufficiently clear for me to answer. >> >> Do you want to know how to read from standard-input in a Python >> program? >> >> Do you want to know how to start an external program from Python, and >> then connect something to t

Re: List Ctrl

2006-05-08 Thread Philippe Martin
[EMAIL PROTECTED] wrote: > > Hello together !! > > I have programmed a List Control and I introduced information in several > rows. What I want to do is, modify this information when i select a row > and press a button. > There two options: > - when i do this, a window appears and asks me to

Re: Python editor recommendation.

2006-05-11 Thread Philippe Martin
Looking at their flash demo made me want to try it, but after all dependencies installed, I get "Fatal Python error: can't initialise module gtksourceview Aborted (core dumped)" Is it stable ? Philippe mystilleef wrote: > The powerful no-nonsense, no-frills, no-hassle, no-fuzz editor, > S

nix logon in Python

2006-05-12 Thread Philippe Martin
Hi, Are there any (even prototypes/proof of concept) gdm/kdm/xdm.../-style packages written in Python ? Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator

2006-05-12 Thread Martin Blume
7;t decorating / wrapping usually done at runtime, so that the @deco notation is pretty useless (because you'd have to change the original code)? What do I miss here? Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator

2006-05-12 Thread Martin Blume
"Sybren Stuvel" schrieb > Martin Blume enlightened us with: Don't know if I enlightened anybody ... :-) > > Another question: Isn't decorating / wrapping > > usually done at runtime, so that the @deco > > notation is pretty useless (because y

Re: Decorator

2006-05-12 Thread Martin Blume
nal function)? > It's not for module client code (but this of > course doesn't prevent client code to dynamically > add other wrappers...) > How do the clients it? The "oldfashioned" deco(doSillyWalk) way? Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator

2006-05-12 Thread Martin Blume
> is much more readable than: > def my_one_hundred_locs_func(): > ... > # 100 LOCS later > my_one_hundred_locs_func = decorator (my_one_hundred_locs_func) > That makes sense. > > Note that all this should be clear for anyone having > read the doc... > Errm, yes, you're so right. Thanks for reading the documentation to me and clearing this up :-) Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: nix logon in Python

2006-05-12 Thread Philippe Martin
Philippe Martin wrote: > Hi, > > Are there any (even prototypes/proof of concept) gdm/kdm/xdm.../-style > packages written in Python ? > > Regards, > > Philippe I guess to further define my problem: I am looking for clues as to how to launch an X11 session (remo

Re: Decorator

2006-05-12 Thread Martin Blume
"bruno at modulix" schrieb > > [lucid introduction into decorators] > Thanks for the help in understanding decorators. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to extract Python source code using Windows

2006-05-16 Thread Philippe Martin
[EMAIL PROTECTED] wrote: >>You can get Python sources from python.org > > I'm unable to locate a source file brings that will work with WinZip. > Can anybody please point me to the exact URL that will get me to the > source code? but it it is tar ball format or a gzip format, than that > will wor

Re: Unable to extract Python source code using Windows

2006-05-17 Thread Philippe Martin
John Machin wrote: >> http://www.python.org/ftp/python/2.4.3/Python-2.4.3.tar.bz2 > > And the reason for posting that would be what? WinZip doesn't support > bzip2 compression. > > http://www.python.org/ftp/python/2.4.3/Python-2.4.3.tgz (a gzipped tar > file) is what the OP would be better point

Re: creating a new database with mysqldb

2006-05-17 Thread Philippe Martin
John Salerno wrote: > Since the connect method of mysqldb requires a database name, it seems > like you can't use it without having a database already created. So is > there a way to connect to your mysql server (without a specified > database) in order to create a new database (i.e., the CREATE D

Re: Software Needs Philosophers

2006-05-21 Thread Philippe Martin
Xah Lee wrote: > Software Needs Philosophers > > by Steve Yegge, 2006-04-15. > > Software needs philosophers. > > This thought has been nagging at me for a year now, and recently it's > been growing like a tumor. One that plenty of folks on the 'net would > love to see kill me. > > People don'

linking errors with debug build of Python2.4.3

2006-05-24 Thread Martin Wiechert
uSE Linux 10.1 on Intel. Any help would be much appreciated. Thanks, Martin. [EMAIL PROTECTED]:~> ldd /usr/local/debug/lib/python2.4/lib-dynload/readline.so linux-gate.so.1 => (0xe000) libreadline.so.5 => /lib/libreadline.so.5 (0xb7edd000) libncursesw.

Re: Anyone compiling Python 2.3 on an SCO OpenServer 5 box?

2006-05-25 Thread Aurelio Martin
Mike Kent wrote: > If anyone is successfully compiling Pyton 2.3 on an SCO OpenServer 5 > box, I'd appreciate hearing from you on how you managed to do it. So > far, I'm unable to get a python that doesn't coredump. > Hey, I remember trying to compile Python 1.5 on an SCO OpenServer 5 box back

Re: Compiler or stg. to get exe!

2007-12-28 Thread Martin Blume
look at the .deb developer documentation. Again, for simple programs, just copying the .py file is sufficient, provided that Python (and all the modules your .py needs) is installed. HTH Martin -- http://mail.python.org/mailman/listinfo/python-list

[OT] How is AI implemented

2008-01-03 Thread Martin Marcher
topic? thanks and sorry for OT posting martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete lines containing a specific word

2008-01-06 Thread Martin Marcher
ou have to adapt it to be able to match more than a single word > If python in Linux accepts lines beginning with # as comment lines, please > also a script to comment lines containing a specific word, or words, and > back, to remove #. yes lines starting with a "#" are comment

Re: Delete lines containing a specific word

2008-01-06 Thread Martin Marcher
raise Exception("Can't uncomment Line with no comment") You want to read up about: * (new style) classes * parameters with default values * docstrings * Exceptions That code is untested and may contain errors. I

Re: Python's great, in a word

2008-01-07 Thread Martin Marcher
[EMAIL PROTECTED] wrote: > The best thing about Python is ___. it's pythonicness. -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours You are not free to read this message, by doing so, you have violated my licence and are required to urinate publicly. Thank you. --

Re: Python's great, in a word

2008-01-07 Thread Martin Marcher
On Monday 07 January 2008 21:25 Dustan wrote: > On Jan 7, 11:40 am, Martin Marcher <[EMAIL PROTECTED]> wrote: >> it's pythonicness. > > "it is pythonicness"??? not all here are native english speakers, but thanks for the correction. I&

Tkinter variable trace problem

2008-01-07 Thread C Martin
What am I doing wrong in this code? The callback doesn't work from the Entry widget. ##start code import Tkinter tk = Tkinter.Tk() var = Tkinter.StringVar() print var._name def cb(name, index, mode): print "callback called with name=%r, index=%r, mode=%r" % (name, index, mode) varValue =

Re: Look for a string on a file and get its line number

2008-01-08 Thread Martin Marcher
-string') > if has_match > 0: > print 'Found in line %d' % (line_nr) > > Something to this effect. apart from that look at the linecache module. If it's a big file it could help you with subsequent access to the line in question hth martin -- http://no

Re: use fileinput to read a specific line

2008-01-08 Thread Martin Marcher
jo3c wrote: > i need to read line 4 from a header file http://docs.python.org/lib/module-linecache.html ~/2delete $ cat data.txt L1 L2 L3 L4 ~/2delete $ python Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type "help", "copyright", "credits" or "

Re: Open a List of Files

2008-01-08 Thread Martin Marcher
ath.join(Host_Path, outfile) >> > outfile = open(filename, 'w') files = dict() l = ['messages', 'recipients', 'viruses'] for f in l: files[f] = open(s.path.join(Host_Path, outfile), "w") files["messages].write("a string&q

Re: use fileinput to read a specific line

2008-01-08 Thread Martin Marcher
Fredrik Lundh wrote: > Martin Marcher wrote: > >>> i need to read line 4 from a header file >> >> http://docs.python.org/lib/module-linecache.html > > I guess you missed the "using linecache will crash my computer due to > memory loading, because i a

Re: I'm searching for Python style guidelines

2008-01-08 Thread Martin Vilcans
On 1/7/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: > 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Anything written somewhere that's thorough? Any code body that should > > serve as a reference? > > PEP 8 > http://www.python.org/dev/peps/pep-0008/ The problem with PEP 8 is that even code

Re: Tkinter variable trace problem

2008-01-09 Thread C Martin
Thank you for your replies. I understand there are better ways to handle 'normal' UI behavior, but I was curious about the trace feature and wanted to understand how it worked. I may not actually need it in my project, but I wanted to see what my options were. Thanks again.

Re: Collecting Rich Data Structures for students

2008-01-09 Thread Martin Marcher
y don't have >> to be Latin-1 (e.g. the sushi types file might not have a >> lot of romanji). Are you asking for class SushiList(object): types = [sushi1, sushi2, sushi3, ...] I don't quite get that, any reference to the original discussion? /martin -- http://noneis

Re: printing dots in simple program while waiting

2008-01-09 Thread Martin Marcher
John wrote: > import time > s = '.' > print 'working', # Note the "," at the end of the line > while True: > print s > time.sleep(1) see my comment in the code above... if that's what you mean /martin -- http://noneisyours.marcher.

Re: docstrings style question

2008-01-10 Thread Martin Marcher
nd to mention the main use cases for test classes (especially) and also a "human readable" description of what can happen (forgive me the missing line breaks). Something like this: class Test3(ar_test.AR_TEST): """Temperature Sense Test. This class assures that th

Re: help with a problem from school??

2008-01-10 Thread Martin Marcher
ite sure how your question is related to python. You might want to try a mailinglist specific to your problem... martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours You are not free to read this message, by doing so, you have violated my licence and are required t

sqlite3 is it in the python default distro?

2008-01-12 Thread Martin Marcher
) In real life can I consider (on linux) that an installation of python includes the sqlite stuff? thanks martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours You are not free to read this message, by doing so, you have violated my licence and are required to urinate

Re: sqlite3 is it in the python default distro?

2008-01-13 Thread Martin Marcher
On Saturday 12 January 2008 21:34 Martin Marcher wrote: > a) Is sqlite included in the python default distribution > b) In real life can I consider (on linux) that an installation of python > includes the sqlite stuff? forgive my that was pebcack. I wasn't reading the docs fully

Slicing wrapped numpy arrays

2008-01-13 Thread Martin Manns
() for i in map_range]) self.map = self.map.reshape(dimensions) mymap = Map((100, 100, 100)) mymap[10:20,15:20,:] # This line should work afterwards Thanks in advance Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing wrapped numpy arrays

2008-01-13 Thread Martin Manns
On Sun, 13 Jan 2008 16:03:16 -0600 Robert Kern <[EMAIL PROTECTED]> wrote: > Martin Manns wrote: > > Hi, > > > > I have created a class that wraps a numpy array of custom objects. I > > would like to be able to slice respective objects (without copying > >

Re: Filtering two files with uncommon column

2008-01-18 Thread Martin Blume
lp(dict.iteritems), help(dict.has_key)) (Note that for if a_dict.has_key("def"): pass one can also write if "def" in a_dict: pass but you won't find this in the simple on-line help, at least in my version) HTH Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in __init__?

2008-01-18 Thread Martin Blume
t; I think this has to do with http://docs.python.org/tut/node6.html#SECTION00671 especially the "Important Warning" Regards Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Looping through the gmail dot trick

2008-01-20 Thread Martin Marcher
il is entirely up to the receiving mailserver and cannot be tempered with without risking misdelivery (at least). If I'm wrong I'd be gladly corrected, just point me to the references. /martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours You are not free

Re: Looping through the gmail dot trick

2008-01-20 Thread Martin Vilcans
On Jan 20, 2008 8:58 PM, Martin Marcher <[EMAIL PROTECTED]> wrote: > are you saying that when i have 2 gmail addresses > > "[EMAIL PROTECTED]" and > "[EMAIL PROTECTED]" > > they are actually treated the same? That is plain wrong and would break a >

<    4   5   6   7   8   9   10   11   12   13   >