Re: Method / Functions - What are the differences?

2010-02-28 Thread Michael Rudolf
. You have no Idea how enlightened I feel right now :D Thank you, "bound method" was the term I forgot and your example... ...totally revealed the internals behind this to me. Especially the last line I quoted. I mean, I always knew *that* this works, but I never knew *why*. Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Re Interest check in some delicious syntactic sugar for "except:pass"

2010-03-03 Thread Michael Rudolf
xcept os.Error: pass One nice thing about this approach would be that you can alias a set of exceptions with this: idontcareabouttheseerrors=silenced(TypeError, ValueError, PEBCAKError, SyntaxError, EndOfWorldError, 1D10T_Error) with idontcareabouttheseerrors: do_stuff()

Re: Is this secure?

2010-03-03 Thread Michael Rudolf
rn ''.join(chars) since it gives me a perfect distribution of letters, It does not. Only if not (length(valid_chars) % length) Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: case do problem

2010-03-04 Thread Michael Rudolf
#x27;__main__': for loop, m in Loop(maxiterations=20, maxcount=4): print("%2d %1d %3d" % (loop.iterations, loop.count, m)) print("That's all, folks") better? worse? I honestly do not know. Note that while this is valid py3 and runs as intended, there might be some off-by-one or something left. Also, this is of course not production level code ;) Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: How to login https sever with inputing account name and password?

2010-03-04 Thread Michael Rudolf
handler) urllib2.install_opener(opener) pagehandle = urllib2.urlopen(theurl) (taken from http://www.voidspace.org.uk/python/articles/authentication.shtml ) Further reference: http://www.python.org/doc/2.5.2/lib/module-urllib2.html http://www.python.org/doc/2.5.2/lib/urllib2-examples.html HTH, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: A "scopeguard" for Python

2010-03-04 Thread Michael Rudolf
ns :p No, really: they *are* great ;D Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: A "scopeguard" for Python

2010-03-04 Thread Michael Rudolf
BCAKError, SyntaxError, EndOfWorldError, 1D10T_Error) with idontcareabouttheseerrors: do_stuff() Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

ImportError: No module named glib

2010-03-05 Thread Michael Joachimiak
I am too new to python. If anybody has an idea what to do please help. when I use import glib in my code I get this: >>> import glib Traceback (most recent call last): File "", line 1, in ImportError: No module named glib :~$ python -V Python 2.6.4 /usr/lib/libpyglib-2.0-python2.6.so.0.0.0

Re: related lists mean value (golfed)

2010-03-09 Thread Michael Rudolf
comprehension evaluation orders ;) Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: related lists mean value

2010-03-09 Thread Michael Rudolf
ey, number): if key in self.store: self.store[key].append(number) else: self.store[key] = [number] a=A() # collect data for idx, val in zip(y,x): a.add(idx, val) # build the final list: w = [ sum(a.store[key])/len(a.store[key]) for key in y ] print("w is now the list of averages, corresponding with y:\n \ \n x: %s \n y: %s \n w: %s \n" % (x, y, w)) Produces same output, of course. Note that those solutions are both not very efficient, but who cares ;) thanks! No Problem, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: related lists mean value (golfed)

2010-03-09 Thread Michael Rudolf
,i in [(f(i,v),i) for i,v in zip(y,x)]] print("w is now the list of averages, corresponding with y:\n \ \n x: %s \n y: %s \n w: %s \n" % (x, y, w)) Output: w is now the list of averages, corresponding with y: x: [1, 2, 8, 5, 0, 7] y: ['a', 'a', 'b&

Re: Unicode characters in btye-strings

2010-03-12 Thread Michael Rudolf
utf8-strings? Need citation plz. Thx, Michael -- http://mail.python.org/mailman/listinfo/python-list

converting datetime with tzinfo to unix timestamp

2010-03-12 Thread Michael Torrie
On Python 2.5 here. I've searched and searched but I can't find any way to convert a datetime object that includes a timezone (tzinfo) to a unix timestamp. Folks on the net say to simply use the timetuple() method of the object and feed that to time.mktime(). But that just doesn't seem to work fo

Re: I passed a fizzbuzz test but failed at recursion.

2010-03-14 Thread Michael Rudolf
uzz(0) + "1 \n" + "2 \n" + "fizz \n" + "4 \n" + "buzz\n " + "fizz \n" + + "97 \n" + "98 \n" + "fizz \n" + "buzz \n" = " " + "1 \n" + "2 \n" + "fizz \n" + "4 \n" + "buzz\n " + "fizz \n" + + "97 \n" + "98 \n" + "fizz \n" + "buzz \n" Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: "Breaking" the __main__ script

2010-03-14 Thread Michael Rudolf
axError" or any other Exception. But you won't have to: If you use IDLE, you can just set breakpoints in your code: enable the debugger in debug-debugger and set breakpoints via right click in your source file. Or you could use a real debugger, like pdb http://docs.python.org/libra

Re: "Breaking" the __main__ script

2010-03-14 Thread Michael Rudolf
Am 14.03.2010 16:03, schrieb [email protected]: Any reason you prefer PDB over WinPDB? http://winpdb.org/ Yes. I don't have Windows except one one PC :P -- http://mail.python.org/mailman/listinfo/python-list

Re: "Breaking" the __main__ script

2010-03-14 Thread Michael Rudolf
Am 14.03.2010 21:08, schrieb [email protected]: Any reason you prefer PDB over WinPDB? http://winpdb.org/ Yes. I don't have Windows except one one PC :P WinPDB runs on non-Windows platforms :) Uh, OK. Then the name mislead me ;) But yeah, I prefer a console based debugger. -- http://mail.pyt

Re: Searching for most pythonic/least stupid way to do something simple

2010-03-16 Thread Michael Torrie
david jensen wrote: > of course, changing nn's to: > def getOutcomes(myList=[2,5,8,3,5]): >low_id = int(myList[0]>myList[1]) >amountToShare = 2*myList[low_id] >remainder = myList[not low_id]-myList[low_id] >tail=list(myList[2:]) >outcomes = [[amountToShare*perc, remainder+amount

Re: import antigravity

2010-03-16 Thread Michael Rudolf
Am 16.03.2010 21:44, schrieb Mark Lawrence: Who actually *IS* running the time machine? Are there any bugs?? My is. And as I'm a lazy hacker: sure. there are bugs. lets just call them features and move on. nothing to see here ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Castrated traceback in sys.exc_info()

2010-03-17 Thread Michael Ricordeau
Hi, to log tracebacks, you can probably try traceback module. I use it like this : import traceback # your code for line in traceback.format_exc().splitlines(): log.trace(line) Le Wed, 17 Mar 2010 03:42:44 -0700 (PDT), Pakal a écrit : > Hello > > I've just realized recently that sy

Nested Scopes unintended behaviour ?

2010-03-17 Thread Michael Sparks
uot;) ... print F("Hello") ... >>> def Switcher(A,B): ... def switchgen(): ... while True: ... yield A ... yield B ... G = switchgen() ... def swtchfun(msg): ... return G.next() ... # ... return Toggler(swtchfun,True) ... >>> >>> Switcher(1,2) 1 2 1 2 But I'm curious as to whether the nested scope issue above is considered a bug or a feature, so I can deal with it appropriately. Any comments welcome :-) Regards, Michael. -- http://yeoldeclue.com/blog http://www.kamaelia.org/Home.html http://twitter.com/kamaelian -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested Scopes unintended behaviour ?

2010-03-18 Thread Michael Sparks
On Mar 17, 8:29 pm, Terry Reedy wrote: > On 3/17/2010 11:44 AM, Emile van Sebille wrote: > > > On 3/17/2010 8:16 AM Michael Sparks said... > >> Hi, > > >> Is the following behaviour expected ? > > > In short, yes. Assignment within a function forces the v

Re: Python is cool!!

2010-03-23 Thread Michael Torrie
Jose Manuel wrote: > Would it be easy to integrate Python in Web pages with HTML? I have > read many info on Internet saying it is, and I hope so Django is, among several other similar projects and frameworks, very popular for generating web apps in Python. I have only used Django and it wor

Re: Unicode blues in Python3

2010-03-24 Thread Michael Torrie
Steven D'Aprano wrote: > I think your question is malformed. You need to work out what behaviour > you actually want, before you can ask for help on how to get it. It may or may not be malformed, but I understand the question. So let eme translate for you. How can he write arbitrary bytes ( 0x0

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-31 Thread Michael Ricordeau
Hi You cannot add 'NOW() - '29 days'::INTERVAL' as a query because cursor.execute() will try to mogrify it. You can do : import datetime idays = psycopg2.extensions.adapt(datetime.timedelta(days=29)) self.dyndb.orderdb.query('update set creation_date=(NOW() - %s) where id_order=%s',

Re: Getting Local MAC Address

2010-04-02 Thread Michael Torrie
On 04/02/2010 03:30 PM, Dan McLeran wrote: > i'm running python 2.6 on win xp sp3 and i get: Your code isn't portable to non-Windows OS's. On my Mac and on my Linux workstations it simply doesn't work. Using '/usr/sbin/ifconfig' as the executable name in Popen does work, however. The OP didn't

Re: Getting Local MAC Address

2010-04-02 Thread Michael Torrie
On 04/02/2010 02:14 PM, Booter wrote: > I am new to python ans was wondering if there was a way to get the mac > address from the local NIC? As Dan has indicated, you have to Popen an external command to get this information. Every OS has different commands and syntaxes for this. You'll have to h

How to implement a callback COM object in Python

2010-11-16 Thread Michael Bode
Hi, I'm trying to write a COM client to a COM server which controls a power meter. The COM server fires events that should be handled by the client. The docs state that I have to supply a class which implements the IFM2DeviceEvents interface. I need some instructions on how to translate the VB sam

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Michael Ricordeau
Hi, you can use json for passing list and dict . Pickle is dangerous . Instead of pickle.loads/pickle.dumps use json.loads and json.dumps (using stdlib json in python >= 2.6 or simplejson in python < 2.6) Regards Le Thu, 18 Nov 2010 09:29:00 +0100, Romaric DEFAUX a écrit : > Le 17/11/201

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Michael Ricordeau
0"}, {"name": "disk2", "size": "647648"}] > >>> disk_list2 = simplejson.loads(disk_list_json) > >>> print disk_list2 > [{u'name': u'disk1', u'size': u'52428800'}, {u'name': u&#

Re: is list comprehension necessary?

2010-11-21 Thread Michael Torrie
On 10/27/2010 05:37 AM, Roy Smith wrote: > I agree. I resisted LCs when they first came out, passing them off as > unnecessary, confusing, etc. Eventually, I came to be comfortable with > them and use them often. I do use LCs fairly often, but only then a for loop would be ugly or inefficient.

Re: Streaming templating languages for use as WSGI body.

2011-01-07 Thread Michael Ströder
: > > http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#Entity-Body As I read section 7.2.2 (Length) the Content-length header is only required in HTTP *requests* if the body contains data. According to the text it's not required in HTTP *responses*. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: Print to an IPP printer (pkipplib?)

2011-01-10 Thread Michael Torrie
On 10/16/2010 10:49 AM, Adam Tauno Williams wrote: > I've found the module pkipplib which seems to work well for things like > interrogating an IPP (CUPS) server. But is there a way to send a print > job to an IPP print queue? [and no, the local system knows nothing about > the print architecture

Re: Developing a program to make a family tree.

2011-01-15 Thread Michael Hunter
erience. That is triple death. You need to hold a couple of those variables stable. I'd suggest finding a existing open source genealogy program and use bug fixing as a way to learn basics about the package and then try to add a feature as a way of learning something about software

Swampy Module installation

2011-01-18 Thread Michael Rauh
I am new to python, and attempting to install the learning module swampy. http://www.greenteapress.com/thinkpython/swampy/install.html Unfortunately, I am attempting to do this on windows vista, which does not appear to be cooperating. Once I click on the install link, it puts the file on the compu

Re: [rotatingloghandler]: How to read the logs produced ?

2011-01-19 Thread Michael Ricordeau
I suggest SyslogHandler in logging package to centralize all logs . http://docs.python.org/library/logging.html#sysloghandler In my opinion, rotating, parsing, filtering logs is a different task (for a sysadmin not a developper). I'm doing this for all my projects at work : - using SyslogHand

Re: Tkinter: The good, the bad, and the ugly!

2011-01-19 Thread Michael Torrie
On 01/19/2011 05:01 PM, geremy condra wrote: > On Wed, Jan 19, 2011 at 3:04 PM, rantingrick wrote: >> And you've also lost all >> connection with the people. I am desperately trying to to snap you out >> of this psychosis before it is too late! Tkinter will be the downfall >> of Python if we canno

Re: Namespaces

2011-01-21 Thread Michael Sparks
erately sidestep which namespace "Sparks" and "Smith" sit inside for the moment.) The neat trick is that namespaces are values themselves. In fact the really neat trick is that every value contains a namespace. How do I define a name inside a namespace? Suppose I want to define

Re: Tkinter: The good, the bad, and the ugly!

2011-01-21 Thread Michael Torrie
On 01/20/2011 11:17 AM, Emile van Sebille wrote: > The problem with QT is the license. PyQT indeed is licensed poorly for anything that's not GPL. But Qt itself is dual-licensed under GPL and the LGPL, as of version 4.6 I think. The LGPL license would seem to be quite acceptable even for commerc

Re: WxPython versus Tkinter.

2011-01-25 Thread Michael Torrie
On Sun, 23 Jan 2011 09:21:57 -0800, rantingrick wrote: > Wait a minute, i am confused? What language is Python written in? Oh > thats right Lisp! I am so dumb. How did i even get this job? :-) What job is this? Inquiring minds wish to know. -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-25 Thread Michael Torrie
On 01/23/2011 02:11 PM, Littlefield, Tyler wrote: > I hardly think that your tone, attitude and arguments are going to help > you in your battle to prove that WXPython is superior to anything at > all, if you can't manage to provide cross-platform bug-free code. Sadly you're wasting your breath

Re: How to create an entry in the "Program menu" of Windows?

2011-02-01 Thread Michael Torrie
On 02/01/2011 02:43 PM, Diesel wrote: > I'd like to add menu entry in the Program Menu as part of the > installation of an application. Is it possible to do that from Python? > > Any examples or link? I have not been able to find anything with > google... Use an installer program like nsis to cr

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-01 Thread Michael Torrie
On 02/01/2011 08:26 AM, Noah Hall wrote: > On Tue, Feb 1, 2011 at 3:14 PM, rantingrick wrote: >> #-- Embedded Trolls and Minions --# > These people, including myself, aren't trolls nor minions. They just > don't agree with you. I strongly disagree with rr and find him to be an egotistical troll w

Re: Easy function, please help.

2011-02-08 Thread Michael Hrivnak
nt): raise TypeError("WTF you didn't pass me an int") Michael On Wed, Feb 9, 2011 at 12:52 AM, Nanderson wrote: > def num_digits(n): >    count = 0 >    while n: >        count = count + 1 >        n = n / 10 >    return count > > This is a function that

Re: Extending classes __init__behavior for newbies

2011-02-14 Thread Michael Sparks
ty. >From the perspective of fragility though this approach is far more fragile: ship.__init__(self,x=0,y=0,step=1,angle=0, name='') For convenience I'm copying below my .sig the code I mention above, for you to make your own mind up which you find more maintain

Re: Extending classes __init__behavior for newbies

2011-02-14 Thread Michael Sparks
On Feb 14, 7:15 pm, rantingrick wrote: > On Feb 14, 11:55 am, Michael Sparks wrote: > > > It can be broken if someone tries to use the class as is - that is > > treating the class as a model - to drive a display of the ship. If > > it was written using super() then th

Re: How to use Python well?

2011-02-17 Thread Michael Torrie
On 02/16/2011 04:00 PM, Steven D'Aprano wrote: > You should read about bottom-up and top-down programming. You'll probably > end up doing some of both, but mostly top-down. Most of my development is done by designing top-down and then coding bottom-up. Coding top down is fine, but I'd expect to

Re: Newbie getting desperate with for

2011-02-18 Thread Michael Torrie
On 02/17/2011 04:10 PM, Werner wrote: > It is meant to put load on a CPU, RAM and disk (swap). The code now > looks like this: > #!/usr/bin/python > while True: > i = 0 > for i in range(2000): > break Just for your information, your code is the equivalent of: while True: t

Re: Newbie getting desperate with for

2011-02-18 Thread Michael Torrie
On 02/17/2011 09:15 PM, Larry Hudson wrote: > A true time waster indeed -- it's an infinite loop that will _never_ end. > > Others have already about the need of the shebang line to run as a python > script, but I'm > surprised no one mentioned how truly useless this code is. > > The i = 0 line

ANN: python-ldap-2.3.13

2011-02-19 Thread Michael Ströder
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema). Note: This is the last release with this feature set. From now on only very urgent fixes are going into release series 2.3.x. Project's web site: http://www.python-ldap.org/ Ciao, Mi

Re: Getting Local MAC Address

2010-04-04 Thread Michael Torrie
On 04/02/2010 04:01 PM, Dan McLeran wrote: > which is why my OP stated the solution was for windows: > > "for windows parse > p.stdout.read():" Gotcha. Definitely missed that! -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommend Commercial graphing library

2010-04-06 Thread Michael Torrie
On 04/06/2010 10:05 AM, AlienBaby wrote: > The requirement for a commercial license comes down to being > restricted to not using any open source code. If it's an open source > license it can't be used in our context. Python itself and all its standard libraries are open source, under the PSF lice

Re: python as pen and paper substitute

2010-04-07 Thread Michael Torrie
On 04/06/2010 12:40 PM, Manuel Graune wrote: > Hello everyone, > > I am looking for ways to use a python file as a substitute for simple > pen and paper calculations. At the moment I mainly use a combination > of triple-quoted strings, exec and print (Yes, I know it's not exactly > elegant). Thi

Re: python as pen and paper substitute

2010-04-09 Thread Michael Torrie
On 04/08/2010 02:54 PM, Manuel Graune wrote: > > Well, the subject does say python and not elisp, but I'm a vim-user > anyways. Did you look at the link to Owen Taylor's reinteract program? I think it's closer to what you want than any other thing mentioned here, with the exception that it's a

Re: [Python-Dev] [RELEASED] 2.7 beta 1

2010-04-10 Thread Michael Ströder
. At least the effect is highly speculative. So please simply release 2.7 when it's ready. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: Add a method to a gtk class?

2010-04-29 Thread Michael Torrie
On 04/29/2010 10:03 AM, Wolfnoliir wrote: > On 29/04/2010 17:03, Joe Riopel wrote: >> On Thu, Apr 29, 2010 at 11:43 AM, Wolfnoliir wrote: >>> I would like to add a method to the gtk.TextBuffer class to save a text >>> buffer to a file, but I get an error: >> >> I don't know gtk, but can you inheri

Re: Python is cool!!

2010-05-09 Thread Michael Foord
f Pyjamas. It is a Python to Javascript translator and *not* (as far as I know) capable of running an interpreter in the browser. Michael > -- > Thanks & Regards, > Godson Gera > IVRS India <http://godson.in> > -- http://www.ironpythoninaction.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonic ssh

2010-05-17 Thread Michael Crute
to wrap up the common ssh patterns using os.popen but it hasn't been maintained in several years so your best bet is probably to stick with using subprocess if you don't go with paramiko. -- Michael E. Crute http://mike.crute.org It is a mistake to think you can solve any major probl

Re: Python vs. Fedora and CentOS

2010-06-01 Thread Michael Torrie
On 05/31/2010 05:13 AM, Jason D wrote: > There is however never been an issue to locate different version of python > in your system as you deem fit without problems. > So I dont understand why your concern. Actually, replacing python on RHEL is a major endeavor. Almost all Red Hat utilities ar

Re: Python vs. Fedora and CentOS

2010-06-01 Thread Michael Torrie
On 06/01/2010 05:01 AM, Adam Tauno Williams wrote: > Yes, we install Python 2.6 on CentOS and run a production app on it - no > problems. > > rpm -Uvh > http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1-4.ius.el5.noarch.rpm > > yum -y install python26 python26-setuptools Than

Re: Python Forum

2010-06-04 Thread Michael Torrie
On 06/03/2010 04:15 AM, Adam Tauno Williams wrote: > The best solution I've seen is what is used by the Mono project; > which provides both a "web forum" and a mail list interface. > > > I just checked the archives

Re: GUIs - A Modest Proposal

2010-06-05 Thread Michael Torrie
On 06/05/2010 08:22 PM, ant wrote: > WxPython and PyGtk are both powerful, but quirky in different ways. > PyQt is tied to one platform. And there are dozens more. In what way is PyQt (or the new PySide bindings) tied to one platform? PyQt is "native" on Win32, Mac, and Linux. Would your univers

Re: GUIs - A Modest Proposal

2010-06-07 Thread Michael Torrie
On 06/06/2010 02:13 AM, Gabriele Lanaro wrote: > I'd really like to s/tkinter/WxWidgets/g, the multiplatformness is (almost) > the same but wx looks infinitely better. IMHO a good intention is to best > the API of wx. Does WX still do weird things like use event message maps instead of a sane sign

Re: GUIs - A Modest Proposal

2010-06-07 Thread Michael Torrie
On 06/06/2010 04:55 PM, ant wrote: > What an interesting set of responses I got! > And - even more interesting - how few of them actually seem to think > there is a problem, let > alone make any attempt to move the situation forward. You simply haven't made a case that there is a problem to be sol

Re: GUIs - A Modest Proposal

2010-06-07 Thread Michael Torrie
On 06/07/2010 09:19 PM, rantingrick wrote: > On Jun 7, 5:05 pm, Michael Torrie wrote: > >> Thus for Python to really be successful in a broader sense, we need >> good, solid, bindings for Cocoa, or Windows forms (whatever they are >> using these days), as well as

Python Jobs

2010-06-09 Thread Michael Chambliss
I use Python for my own entertainment and for quick jobs, but haven't been able to use it professionally up to this point. As a former Perl developer and someone that's currently required to code in Java I'm starting to wish I had this opportunity. Can anyone comment on the Python job market? If

Re: Python Jobs

2010-06-10 Thread Michael Chambliss
On Wed, Jun 9, 2010 at 8:58 PM, Vincent Davis wrote: > > > You might take a look at Front Range pythoneers. The is a mailing list > an I think monthly meetups. I see some job post coma across the list > now and then. > http://www.meetup.com/frpythoneers/ > > I am also in the Denver area and have b

Re: GUIs - A Modest Proposal

2010-06-13 Thread Michael Torrie
On 06/13/2010 05:29 AM, lkcl wrote: > really? drat. i could have done with knowing that at the time. > hmmm, perhaps i will return to the pyqt4 port after all. We're now wandering well off-topic here, but then again this thread was never really on any particular topic. I have to say I'm really

Re: Python OpenSSL library

2010-06-13 Thread Michael Crute
While I have not personally run it on Windows (runs great on OS X and Linux) they do provide pre-compiled Windows binaries. [0] http://chandlerproject.org/bin/view/Projects/MeTooCrypto -- Michael E. Crute http://mike.crute.org It is a mistake to think you can solve any major problem just w

Re: Python OpenSSL library

2010-06-13 Thread Michael Crute
rsion 2.5.4 ? And how to uninstall > when required? I don't use windows so I can't help you with Windows specific questions. The windows downloads are clearly marked for python 2.4, 2.5 and 2.6. Go back and read the entire page. -- Michael E. Crute http://mike.crute.org It is a mis

Standard Library SSL Module (was: Python OpenSSL library)

2010-06-14 Thread Michael Crute
complete OpenSSL wrapper in the Python standard library since crypto in Python is somewhat of a pain today. If I wanted to work on something like that what would be the best approach? Extend the ssl package? Create a new crypto package? -- Michael E. Crute http://mike.crute.org It is a mistake

Re: Community (A Modest Proposal)

2010-06-15 Thread Michael Torrie
On 06/15/2010 01:30 AM, Steven D'Aprano wrote: > I know that lots of people swear by IDEs, and back in Ancient Days I used > to use the THINK Pascal IDE on a Macintosh so I'm not hostile to the > idea. But in those days you could only run one app at a time, so you > needed an IDE or you'd go ins

Re: basic doubt

2010-06-16 Thread Michael Torrie
On 06/16/2010 11:06 PM, madhuri vio wrote: > def h(self,event): > handle = open("myco.fasta","r") > for seq_record in SeqIO.parse(handle, "fasta"): > messenger_rna = coding_myco.fasta.transcribe() > han1 = open("mycorna.fasta","wU") > han1.close() > retur

Re: Python 2.4.4 Tkinter GUI Example for Modeless Dialog with Menu, Edit, List, Buttons, File Save etc.

2010-06-16 Thread Michael Torrie
On 06/16/2010 04:05 PM, My Python wrote: > I would like to see some substantial example of an App written for a > Modeless Dialog (fixed size, non resizable window) (If you have used > WIndows MFC or Visual Basic you all know how elegant it is) What is elegant about a fixed-size, non-re-sizable w

Re: Python 2.4.4 Tkinter GUI Example for Modeless Dialog with Menu, Edit, List, Buttons, File Save etc.

2010-06-16 Thread Michael Torrie
On 06/17/2010 12:50 AM, Michael Torrie wrote: > On 06/16/2010 04:05 PM, My Python wrote: >> I would like to see some substantial example of an App written for a >> Modeless Dialog (fixed size, non resizable window) > > Tk? PyQt? PyGTK? wxPython? Nevermind that question. Yo

Re: scraping from bundes-telefonbuch.de with python

2010-06-19 Thread Michael Torrie
On 06/19/2010 04:23 AM, davidgp wrote: > opener = urllib2.build_opener() > opener.addheaders = [('User-Agent', 'Mozilla/5.0 (compatible; > Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko)')] > urllib2.install_opener(opener) > > data = urllib.urlencode({'F0': 'mySearchKeyword','B': 'T','F8': 'A || >

Re: What module to parse/generate ical files?

2010-06-21 Thread Michael Crute
is v1.2 from 2006. I've had pretty good luck with iCalendar, I'm currently using it to bridge Outlook Web Access to iCal for old versions of Exchange and it works flawlessly. -- Michael E. Crute http://mike.crute.org It is a mistake to think you can solve any major problem just with

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Michael Crute
bbling in Ruby I can say that I'm not too keen on the syntax of the language or some of the semantics, it just feel sloppy (but certainly less sloppy than PHP). Both languages are very functional and you can do the same tasks in either one so I think it comes down, mostly, to syntax and sem

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Michael Torrie
On 06/24/2010 03:47 AM, Xianwen Chen wrote: > . This is what I'm now working for. I tried: > > IMAP4.xatom('','ID ("GUID" "1")','',) > > and > > dest_srv.xatom('ID ("GUID" "1")') > > , but I got error messages. Any hint please? What error messages? -- http://mail.python.org/mailman/listinfo/p

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Michael Torrie
On 06/24/2010 03:47 AM, Xianwen Chen wrote: > , but I got error messages. Any hint please? Why not just use a proxy server: http://sourceforge.net/projects/imapidproxy/ -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-26 Thread Michael Torrie
On 06/25/2010 04:15 PM, Emile van Sebille wrote: > Idle is dead -- long live idlefork! > > http://osdir.com/ml/python.idle/2002-09/msg00105.html Actually idlefork is dead. It was merged back into Idle sometime around Python 2.3. At least that's what its homepage claims. -- http://mail.python.o

Re: Python as a scripting language. Alternative to bash script?

2010-06-28 Thread Michael Torrie
On 06/28/2010 05:48 AM, Dave Pawson wrote: > Main queries are: Ease of calling out to bash to use something like > imageMagick or Java? Ease of grabbing return parameters? E.g. convert > can return both height and width of an image. Can this be returned to > the Python program? Can Python access th

Re: Python as a scripting language. Alternative to bash script?

2010-06-28 Thread Michael Torrie
On 06/28/2010 12:05 PM, Dave Pawson wrote: > On 28 June 2010 18:39, Michael Torrie wrote: > >> Sure. I've created a module called runcmd that does 90% of what I >> want (easy access to stdout, stderr, error code). I've attached >> it to this e-mail. Feel

Re: Python dynamic attribute creation

2010-06-28 Thread Michael Torrie
On 06/25/2010 09:39 PM, WANG Cong wrote: > Thanks, I have to admit that I know nothing about Smalltalk. If you know nothing about Smalltalk then you really aren't in a position to talk about what is and is not OOP. Smalltalk is one of the original OOP languages and purists define OOP as the model

Re: Python dynamic attribute creation

2010-06-28 Thread Michael Torrie
On 06/27/2010 11:58 PM, Stephen Hansen wrote: > To say you can't really know "much about" OOP without knowing "much > about" Smalltalk seems basically, well, wrong. True. But you can't really criticize a language's implementation of OOP without a good understanding of the "pure" OO language. Fo

Re: Python dynamic attribute creation

2010-06-28 Thread Michael Torrie
On 06/28/2010 02:31 PM, Aahz wrote: > In article , > Michael Torrie wrote: >> True. But you can't really criticize a language's implementation of OOP >> without a good understanding of the "pure" OO language. For example, in >> Smalltalk If/The

Re: Python as a scripting language. Alternative to bash script?

2010-06-28 Thread Michael Torrie
On 06/28/2010 02:06 PM, Mithrandir wrote: > I can't see Python as an alt. to bash. (As I recall) Python is much more > object-oriented than bash, but also there are many commands (such as apt- > get, etc.) that would need Python equivs. However, I can see Python being > used as a scripting alt. t

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 06:25 PM, Lawrence D'Oliveiro wrote: > I have yet to find an architecture or C compiler where it DOESN’T work. > > Feel free to try and prove me wrong. Okay, I will. Your code passes a char** when a char* is expected. Every compiler I know of will give you a *warning*. Mistaking c

Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 06:26 PM, Lawrence D'Oliveiro wrote: >> I'm not sure you understood me correctly, because I advocate >> *not* doing input sanitization. Hard or not -- I don't want to know, >> because I don't want to do it. > > But no-one has yet managed to come up with an alternative that involves l

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:05 PM, Michael Torrie wrote: > #include > > int main(int argc, char ** argv) > { > char *buf = malloc(512 * sizeof(char)); > const int a = 2, b = 3; > snprintf(&buf, sizeof buf, "%d + %d = %d\n", a, b, a + b);

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:17 PM, Michael Torrie wrote: > On 06/29/2010 10:05 PM, Michael Torrie wrote: >> #include >> >> int main(int argc, char ** argv) >> { >> char *buf = malloc(512 * sizeof(char)); >> const int a = 2, b = 3; >> snprintf(&a

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-30 Thread Michael Torrie
On 06/30/2010 03:00 AM, Jorgen Grahn wrote: > On Wed, 2010-06-30, Michael Torrie wrote: >> On 06/29/2010 10:17 PM, Michael Torrie wrote: >>> On 06/29/2010 10:05 PM, Michael Torrie wrote: >>>> #include >>>> >>>> int main(int argc, char ** arg

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-30 Thread Michael Torrie
On 06/30/2010 06:36 PM, Lawrence D'Oliveiro wrote: > In message , > Michael Torrie wrote: > >> Okay, I will. Your code passes a char** when a char* is expected. > > No it doesn’t. You're right; it doesn't. Your code passes char (*)[512]. warning: p

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-01 Thread Michael Torrie
On 07/01/2010 01:24 AM, Nobody wrote: > No, the type of "buf" is "char [512]", i.e. "array of 512 chars". If you > use "buf" as an rvalue (rather than an lvalue), it will be implicitly > converted to char*. Yes this is true. I misstated. I meant that most text books I've seen say to just use the

Re: drag & drop in a python GUI application

2010-07-02 Thread Michael Torrie
On 07/01/2010 08:57 AM, Alan wrote: > I know drag & drop is not possible with TK. Is this a Python Tk limitation or a Tk limitation in general? Google suggests that Tk itself supports some form of dnd. > Which widget could I use for my > python application to be able to work with drag & drop?

Re: Getting the name of the file that imported current module

2010-07-04 Thread Michael Torrie
On 07/04/2010 03:17 PM, Mark Lawrence wrote: > On 04/07/2010 22:05, Tobiah wrote: >> foo.py: >> >> import bar >> bar.show_importer() >> >> output: >> >> 'foo' or 'foo.py' or 'path/to/foo' etc. >> >> Possible? >> >> Thanks, >> >> Tobiah > > >>> import re > >>> re.__file__ > 'C:\\Python26\\lib\\re

Re: Python as a scripting language. Alternative to bash script?

2010-07-06 Thread Michael Torrie
On 07/06/2010 04:12 AM, sturlamolden wrote: > On 28 Jun, 19:39, Michael Torrie wrote: > >> In python I could simply take the output of "ps ax" and use python's >> own, superior, cutting routines (using my module): >> >> (err, stdout, stder

Re: Python as a scripting language. Alternative to bash script?

2010-07-07 Thread Michael Torrie
On 07/06/2010 09:34 PM, Chris Rebert wrote: > On Tue, Jul 6, 2010 at 6:40 AM, Michael Torrie wrote: >> While it's possible to set up pipes and spawn programs in parallel to >> operate on the pipes, in practice it's simpler to tell subprocess.Popen >> to use a she

Re: any issues with long running python apps?

2010-07-09 Thread Michael Torrie
On 07/09/2010 01:13 PM, Les Schaffer wrote: > or need we only concern ourselves with the nuts behind the wheel:that > is, we the developers? It never hurts to separate the data collection and visualization/analysis parts into separate programs. That way you can keep the critical, long-running da

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread Michael Torrie
On 07/11/2010 12:50 AM, rantingrick wrote: > Ah yes, when nothing else seems to work fall back to you default > programming... FUD and ad hominem attacks Please stop calling things what they are not. Stephen's post was not an ad hominem attack, nor was it FUD. Someone who is countering your pre

<    39   40   41   42   43   44   45   46   47   48   >