Re: tkinter destroy()

2005-03-31 Thread max(01)*
[EMAIL PROTECTED] wrote: Your app seems to give the right state values only if you select 'Freni a posto'. But I see you recognize that with your 'FIXME' note. also the app seems to have too many variables and widgets defined as self objects. That isn't necessary unless they will be used outside

Re: Generating RTF with Python

2005-03-31 Thread Max M
at this a while ago, which might be a starter. http://pyrtf.sourceforge.net/ -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with national characters

2005-03-31 Thread Max M
your strings as unicode, do the transfom, and encode it back as latin1. print repr('før'.decode('latin-1').upper().encode('latin-1')) # 'F\xd8R' print repr('FØR'.decode('latin-1').encode('latin-1')) 'F\xd8R' -- hilsen

Re: redundant imports

2005-04-01 Thread max(01)*
Peter Hansen wrote: max(01)* wrote: this leads me to another question. since *.pyc files are automatically created the first time an import statement in executed on a given module, i guess that if i ship a program with modules for use in a directory where the user has no write privileges then i

Re: tkinter destroy()

2005-04-01 Thread max(01)*
also does the right thing - the key pont you were missing was to use a 'textvariable' argument in defining your label widgets in the 2nd window. ... and to use eval() massimo = len(max(self.testo)) + 2 better: massimo = max(map(len, self.testo)) + 2 anyway, here it is. bye! --

Re: redundant importr

2005-04-02 Thread max(01)*
Peter Hansen wrote: max(01)* wrote: Peter Hansen wrote: Not required except for performance reasons. If the .pyc files don't exist, the .py files are recompiled and the resulting bytecode is simply held in memory and not cached and the next startup will recompile all over again. but the

instance name

2005-04-02 Thread max(01)*
hi. is there a way to define a class method which prints the instance name? e.g.: >>> class class_1: ... def myName(self): ... what should i do here ... >>> instance_1 = class_1() >>> instance_1.myName() 'instance_1' >>> bye macs -- http://mail.python.org/mailman/listinfo/python-list

Re: instance name

2005-04-02 Thread max(01)*
Andrew Koenig wrote: "max(01)*" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] is there a way to define a class method which prints the instance name? The term "the instance name" is misleading, because it assumes, without saying so explicitly, that e

Re: instance name

2005-04-02 Thread max(01)*
Irmen de Jong wrote: max(01)* wrote: hi. is there a way to define a class method which prints the instance name? e.g.: class class_1: ... def myName(self): ... what should i do here ... instance_1 = class_1() instance_1.myName() 'instance_1' bye macs What should the fo

Re: redundant importr

2005-04-05 Thread max(01)*
Peter Hansen wrote: max(01)* wrote: Peter Hansen wrote: No it doesn't. I thought I was clear, but I can reword it for you: the files are compiled *in-memory* and the results are never written to disk. > *if* they are compiled, where are they put, if the corresponding *.py files are

Re: instance name

2005-04-05 Thread max(01)*
many many thanks to each and everyone who bothered to answer my op. best regards macs -- http://mail.python.org/mailman/listinfo/python-list

Re: redundant imports

2005-04-05 Thread max(01)*
Mike Meyer wrote: "max(01)*" <[EMAIL PROTECTED]> writes: Peter Hansen wrote: max(01)* wrote: hi everybody. suppose that code-1.py imports code-2.py and code-3.py (because it uses names from both), and that code-2.py imports code-3.py. if python were c, code-1.c should only *i

Re: logging as root using python script

2005-04-07 Thread max . derkachev
Unixish system won't let You execute a setuid script with the setuid privileges. Only real machine code can be executed so. But of course, there are workarounds. When, say, you have a perl script with setuid bit set, and sperl (setuid root perl) is installed, the perl interpreter choses sperl to i

Re: Problems extracting attachment from email

2005-04-08 Thread Max M
I see that the last 255 bytes are missing. How is this possible, I receive every last byte from stdin? I don't think its a Python problem. Those methods are used in a lot of places. Your file is most likely not what it is supposed to be. -- hilsen/regards Max M, Denmark http://www.mxm.dk/

Re: doubt regarding Conversion of date into timestamp

2005-04-08 Thread Max M
praba kar wrote: Dear All, I am new to Python I want to know how to change a time into timestamp Is there any specific reason for not using datetime instead of time ? -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: Can dictionary values access their keys?

2005-04-08 Thread Max M
Matthew Thorley wrote: I am creating an object database to store information about network devices, e.g. switches and routers. Possible usefull pages? http://www.python.org/doc/essays/graphs.html more at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466 -- hilsen/regards Max M

visibility between modules

2005-04-09 Thread max(01)*
y", line 3, in __init__ self.att_1 = anInstanceOfAClass.att_1 NameError: global name 'anInstanceOfAClass' is not defined [EMAIL PROTECTED]:/tmp$ any suggestion? bye max -- http://mail.python.org/mailman/listinfo/python-list

serialize a tkinter thing

2005-04-09 Thread max(01)*
hi. i tried to serialize a list of StringVar's, but i got a pickle error. this got me to thinking that tkinter objects are not picklable (in general). would somebody confirm and/or give examples? thanks macs -- http://mail.python.org/mailman/listinfo/python-list

very simple tkinter demo program

2005-04-09 Thread max(01)*
f premuto_leggi(self): ConsultazioneRecord() class InserimentoRecord(Toplevel): def __init__(self): Toplevel.__init__(self) self.titolo = "Inserimento" self.wm_title(self.titolo) quadro_grande = Frame(self) quadro_grande.pack(expand = YES, fill = BOTH) self.quad

Re: very simple tkinter demo program

2005-04-10 Thread max(01)*
(self.titolo) quadro_grande = Frame(self) quadro_grande.pack(expand = YES, fill = BOTH) self.quadro_pulsanti = Frame(quadro_grande) self.quadro_pulsanti.pack( side = BOTTOM, fill = X, padx = "2m", pady = "2m" ) quadri_ing

domain specific UI languages

2005-04-13 Thread max(01)*
hi. in a previous thread, mr lundh talks about the possibility to create "domain specific UI languages" using tkinter. can he (or anyone else who pleases) explain what they are? give some examples (simple is better)? bye macs -- http://mail.python.org/mailman/listinfo/python-list

Re: To decode the Subject =?iso-8859-2?Q?=... in email in python

2005-04-20 Thread Max M
ecode such a subject, returning a unicode string? The use would be like human_readable = cool_library.decode_equals(message['Subject']) parts = email.Header.decode_header(header) new_header = email.Header.make_header(parts) human_readable = unicode(new_header) -- hilse

strip away html tags from extracted links

2013-11-29 Thread Max Cuban
I have the following code to extract certain links from a webpage: from bs4 import BeautifulSoup import urllib2, sys import re def tonaton(): site = "http://tonaton.com/en/job-vacancies-in-ghana"; hdr = {'User-Agent' : 'Mozilla/5.0'} req = urllib2.Request(site, headers=hdr) jobpas

Python/Django Extract and append only new links

2013-12-31 Thread Max Cuban
e on my site as older pages. It's my first programming project and don't know how to incorporate this logic into my code. Any help/pointers/references will be greatly appreciated. regards, Max -- https://mail.python.org/mailman/listinfo/python-list

Pls help me...I want to save data to my database but I am unable to

2014-01-25 Thread Max Cuban
This is my first programming pet project. I have the following script that extracts links from specific sites and display them on the web(via django). The script work fine but I'm unable to save any stuff in my database. Hence if I run the code, I get the output I want but then it always extracts

Pls help me...I want to save scraped data automatically to my database(cleaner version)

2014-01-25 Thread Max Cuban
I have asked this question earlier but this should make more sense than the earlier version and I don't want anyone who could potentially helped to be put off by the initial mess even if I updated it with my cleaner version as a reply I want to save the links scraped to be save in my database so t

convert output to list(and nested dictionary)

2015-07-21 Thread max scalf
Hello all, For Each SecurityGroup, how can i convert that into a List that in turn will have a dictionary of the cidr block, protocol type and the port...so from output below, the SecurityGroup called "default" had 2 rules...allowing TCP port from 80 and 5500 to the source IP and then SecurityGrou

Re: convert output to list(and nested dictionary)

2015-07-21 Thread max scalf
gt; mentioned (when proto is -1 and port is None-None, or the icmp case). This > is just a very crude example, but hopefully you get the drift. > > Most text parsing problems can easily be solved with these simple tools. > Fire up your shell and test it - this is really the best way to l

Re: convert output to list(and nested dictionary)

2015-07-22 Thread max scalf
g-e632d982-995635159130', 'proto': '1', 'port': 'None'} > > > ​You can alter this and add whatever extra checks you need as Chris A > mentioned (when proto is -1 and port is None-None, or the icmp case). This > is just a very crude examp

Re: convert output to list(and nested dictionary)

2015-07-22 Thread max scalf
#x27;proto': 'tcp'} {'cidr': '10.0.2.10/32', 'port': '1024', 'proto': 'tcp'} {'cidr': '24.12.30.198/32', 'port': '80', 'proto': 'tcp'} {'cidr': '10.

Re: convert output to list(and nested dictionary)

2015-07-22 Thread max scalf
24', 'proto': 'tcp'}, {'cidr': '24.12.30.198/32', 'port': '80', 'proto': 'tcp'}, {'cidr': '10.0.2.10/32', 'port': '138', 'proto': 'udp'}, {'cidr': &#

unexpected output while using list(and nested dictionary)

2015-07-22 Thread max scalf
Hello List, I have posted a question on stack overflow for better readability ... but is intended for python list Please see question below... http://stackoverflow.com/questions/31574860/unexpected-output-while-using-listand-nested-dictionary ​ ​Any pointers is much appreciated. -- https://

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread max scalf
... On Thu, Jul 23, 2015 at 12:36 AM, Steven D'Aprano < [email protected]> wrote: > On Thursday 23 July 2015 08:09, max scalf wrote: > > > Hello List, > > > > I have posted a question on stack overflow for better readability ... but > > i

[ANN] Atomos 0.1.0 - Atomic primitives for Python

2014-10-10 Thread Max Countryman
* Compare-and-set * Atomicity without having to think in terms of locks * Atoms! (http://clojure.org/atoms <http://clojure.org/atoms>) Thanks, Max-- https://mail.python.org/mailman/listinfo/python-list

Code Review: a framework for writing IRC applications or bots

2011-10-12 Thread Max Countryman
reaction is that this is essentially useless that wasn't necessarily my goal. Nonetheless I really would appreciate any kind of code review the community might be willing to provide. The project is available here: https://github.com/maxcountryman/irctk Thanks for your time! Max -- http://ma

Functional vs. Object oriented API

2013-04-10 Thread Max Bucknell
oosing between the two styles, or is it largely a matter of personal preference? Thanks for reading, Max. -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing next/prev element while for looping

2005-12-18 Thread Max Erickson
ack (most recent call last): File "", line 1, in -toplevel- j NameError: name 'j' is not defined >>> 1 + 2j (1+2j) >>> j=4 >>> 1 + 2j (1+2j) >>> I am actually curious, as it doesn't appear to be, but you are usually 'right' when you say such things... Max -- http://mail.python.org/mailman/listinfo/python-list

Re: MidiToText : EventDispatcher instance has no attribute 'sysex_events'

2006-01-01 Thread Max M
Try changing "def sysex_event(self, data):" in > ...\midi\EventDispatcher.py to "def sysex_events(self, data):" Or just do a search and replace on the whole package:: search: sysex_events( replace: sysex_event( Apparently I have been inconsistent in my naming. New version at: http://www.mxm.dk/products/public/pythonmidi/download -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python, WxPython etc, etc

2006-01-03 Thread Max Erickson
eferring to wxFrame, you would refer to wx.Frame. See: http://www.wxpython.org/MigrationGuide.html#the-wx-namespace for more information about this. Max -- http://mail.python.org/mailman/listinfo/python-list

Re: Are there anybody using python as the script engine for ASP?

2006-01-05 Thread Max M
nPython would be worth trying out, though a bit premature. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft IronPython?

2006-01-06 Thread Max M
lanuage and make an incompatible version that they could control. As far as I can see C## has that role for them. So I don't see how Python should be in any danger. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting milliseconds to human time

2006-01-06 Thread Max Erickson
%d hours %d minutes %d seconds' % prntime(10) 11 days 13 hours 46 minutes 40 seconds >>> print '%d days %d hours %d minutes %d seconds' % prntime(418235000) 4 days 20 hours 10 minutes 35 seconds >>> max -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question: CSV to XML

2006-01-06 Thread Max Erickson
lt; len(row) - 1: >output.write('\n%s' % (i, > row[i])) > if i == len(row) - 1: >output.write('\n colname="col%s">%s\n' % (i, row[i])) instead of testing for the first and last rows, just write the row stuff in

Re: Unicode Question

2006-01-09 Thread Max Erickson
The encoding argument to unicode() is used to specify the encoding of the string that you want to translate into unicode. The interpreter stores unicode as unicode, it isn't encoded... >>> unicode('\xbe','cp1252') u'\xbe' >>> unicode(&

Re: Recursive tree list from dictionary

2006-01-14 Thread Max Erickson
;] try: imd[par].append(v) except: imd[par]=[v] >>> imd {'Project': ['Geometries', 'Verticals'], 'Geometry': ['Points', 'Layers', 'Water'], 'root': ['Project

Re: Decimal ROUND_HALF_EVEN Default

2006-01-16 Thread Max Erickson
#x27;t think of why one might > use round half even. I googled a bit and didn't really find a good > answer. Any insight is appreciated. > > Louis > > see http://www2.hursley.ibm.com/decimal/damodel.html#refdefcont decimal.py was written following the specification at

Re: OT: excellent book on information theory

2006-01-17 Thread Max Erickson
iterature". > > regards > Steve A rather less cynical interpretation is that they are attempting to make a children's book accessible to as many children as possible, i.e., the youngest readers as is practical. I don't mean to disparage the book by calling it a children's book, I have read and enjoyed several of them, but the target audience for the books is clearly kids. max -- http://mail.python.org/mailman/listinfo/python-list

Re: How to generate graphics dynamically on the web using Python CGI script?

2006-01-20 Thread Max Erickson
Sparklines is a script that does exactly what you are asking using python and PIL: http://bitworking.org/projects/sparklines/ max -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode question

2006-07-28 Thread Max Erickson
: http://diveintopython.org/xml_processing/unicode.html#kgp.unicode.4.1 hope this helps, max -- http://mail.python.org/mailman/listinfo/python-list

Re: class return another instance

2006-08-08 Thread Max Erickson
1) >>> g,h,i (<__main__.ID instance at 0x00A45FD0>, <__main__.ID instance at 0x00A4B918>, <__main__.ID instance at 0x00A45FD0>) >>> max -- http://mail.python.org/mailman/listinfo/python-list

Re: Two Classes In Two Files

2006-08-09 Thread Max M
__name__ == "__main__": > x = Two() > x.methodA() > x.methodB() > > When I run the Two.py file, I get the expected output but I'd like to > eliminate the from line in two.py. > -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mobile: +45 29 93 42 96 -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval (was Re: Question about the use of python as a scripting language)

2006-08-10 Thread Max Erickson
nvolve arbitrary numbers of function > calls. > > Skip Is it possible to define a class and create an instance without using an open parens? I don't know how, but that isn't saying a great deal... max -- http://mail.python.org/mailman/listinfo/python-list

It is __del__ calling twice for some instances?

2006-08-16 Thread Max Yuzhakov
Hello! It is correct behaviour for python to call __del__ on some identity of a class object more than once? In brief I shall describe a situation. Sorry for my english. For debugin purposes I'm put in my module global counters for counting __init__ and __del__ calls. This is a sample code for

Re: It is __del__ calling twice for some instances?

2006-08-16 Thread Max Yuzhakov
Max Yuzhakov writes: MY> print "difference = %d" % init_cnt-del_cnt Little correction. print "difference = %d" % (init_cnt-del_cnt) -- GMT More Then ... -- http://mail.python.org/mailman/listinfo/python-list

Re: It is __del__ calling twice for some instances?

2006-08-16 Thread Max Yuzhakov
Duncan Booth пишет: DB> Not with the code which you gave as an example, but in the general case DB> yes, the only guarantee that Python gives about the __del__ method on an DB> instance is that it will be called zero, one or more than one times during DB> the run of the program. In pra

Re: It is __del__ calling twice for some instances?

2006-08-17 Thread Max Yuzhakov
Duncan Booth wrote: DB> You should post a working code sample which generates your output if you DB> want a more useful answer. Hello! Today I have found a compact variant of a code which shows my question: --- #!/usr/local

Re: It is __del__ calling twice for some instances?

2006-08-18 Thread Max Yuzhakov
Duncan Booth wrote: DB> I figured out what is going on in the code to deallocate an old-style class DB> instance: DB> DB> The reference count is temporarily incremented. DB> DB> If the class has a __del__ method then a descriptor is created for the DB> method and called. When the

Re: It is __del__ calling twice for some instances?

2006-08-18 Thread Max Yuzhakov
Duncan Booth wrote: DB> BTW, the behaviour is completely different if you use a new style class, DB> but still somewhat bizarre: for new style classes only the first 25 objects DB> get freed when you clear a, the remainder are only released by the garbage DB> collector. If to add the

Re: How to download a web page just like a web browser do ?

2006-08-23 Thread Max Penet
You can also try HarvestMan: http://harvestman.freezope.org/ Bo Yang wrote: > Hi , > It is about one month passed since I post to this list > last time . Yes , I use python , I used it in every day normal > work , whenever I need to do some scripts or other little-scale > works , python is

Re: Memory Management in python 2.5

2006-10-09 Thread Max M
could reuse it again later. From 2.5 onwards it should release most of the unused memory. However it doesn't use less memory. The peak memory usage should be the same as before. So for one-off programs that starts up and runs once, there should not be much gain. -- hilsen/re

Re: OT: Sarcasm and irony

2006-10-10 Thread Max M
"yes, that's what it means" Are you an american? Irony does mean that one says the opposite of what one really means. If you do it for humor its irony, if you do it for mocking it is sarcasm. So now I see... americans really *do* understand irony. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Sarcasm and irony

2006-10-10 Thread Max M
as such and not as sarcasm. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: MP3 files and Python...

2006-10-10 Thread Max Erickson
Karlo Lozovina <[EMAIL PROTECTED]> wrote: > I'm looking for a Python lib which can read and _write_ ID3v1 and > ID3v2 tags, and as well read as much as possible data from MP3 > file (size, bitrate, samplerate, etc...). > > MP3 reproduction is of no importance... > Try mutagen: http://www.sacre

Re: Attribute error

2006-10-14 Thread Max Erickson
> Thanks > Teja.P > LabcarController might be a function. See: http://groups.google.com/group/comp.lang.python/msg/d7341f1aedcae6d3 for more detail. hope this helps, max -- http://mail.python.org/mailman/listinfo/python-list

Re: Ok. This IS homework ...

2006-10-14 Thread Max Erickson
the > second number, but it didn't seem to solve my problem. Help! > Reread whatever material you have about while loops, or just consult the python documentation, and then think about why your program(as posted anyway) is never printing done. Hope this isn't too much help, max -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Max Erickson
"Chris" <[EMAIL PROTECTED]> wrote: from math import * sin(0) > 0.0 sin(pi) > 1.2246063538223773e-016 sin(2*pi) > -2.4492127076447545e-016 cos(0) > 1.0 cos(pi) > -1.0 cos(2*pi) > 1.0 > > The cosine function works fine, but I'm getting weird answers for > sine. Is

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Max Erickson
Max Erickson <[EMAIL PROTECTED]> wrote: > > Try sin(pi*0.5) to see similar behavior to cos(pi) or cos(pi*2). > Uhh, switch that, cos(pi*0.5)... -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython help wxSashWindow

2006-10-19 Thread Max Erickson
access to the archives, visit http://gmane.org. max -- http://mail.python.org/mailman/listinfo/python-list

Re: advice for web-based image annotation

2006-10-19 Thread Max Erickson
er, if that makes a difference. > > Any suggestions would be greatly appreciated! > > > thanks, > > Brian Blais > You might want to look at gallery: http://gallery.menalto.com/ It is big and heavy and php, but it has most of what you want

Re: list comprehension (searching for onliners)

2006-10-20 Thread Max Erickson
nking more cofee while > searching for this damn onliner im looking for. > > Thanks dudes. > Gerardo Is three lines ok? >>> output=dict() >>> for record in result: output.setdefault(record['service_id'], list()).append(record ['value']) >>> output {1: [10, 15], 2: [5, 15]} >>> Creating the more verbose output that you specified should be pretty straighforward from there. max -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-25 Thread Max Erickson
gt;> >> >>> > >>> > And today's question for the novices is: which Python type >>> > did Skip >>> miss >>> > from the above list? >>> >>> more that one: >>> >>> 0L >>> decimal.Decimal(0) # is decimal.Decimal('0'), also >>> u'' >>> array.array('c') # or any other typecode, I suspect, without >>> initializer >> >> >> Just for fun: >> buffer('') >> frozenset() >> iter(()) >> xrange(0) >> > There's still a very obvious omission ... > > regards > Steve bool. unicode and long if you are fussy. max -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a .dbf file to a CSV file

2006-11-02 Thread Max Erickson
Johanna Pfalz <[EMAIL PROTECTED]> wrote: > Is there a module/method in python to convert a file from .DBF > format to .CSV format? > > Johanna Pfalz > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715 There is an example provided. max -- http://mail.python

Re: how do I pass values between classes?

2006-11-06 Thread Max Erickson
"kath" <[EMAIL PROTECTED]> wrote: > hi, Larry Bates thanks for the reply... > >> You might consider doing it the same way wx passes things around. >> When you instantiate the subclass pass the parent class' instance >> as first argument to __init__ method. > > Yes thats absolutely right.. >

Re: PIL - Pixel Level Image Manipulation?

2006-11-08 Thread Max Erickson
anything > better in the meantime. > > -Greg Maybe something of use at: http://online.effbot.org/2005_10_01_archive.htm#20051003 max -- http://mail.python.org/mailman/listinfo/python-list

Re: path.py and directory naming: trailing slash automatic?

2006-11-10 Thread Max Erickson
t for the one I sent regarding this. > just use '/' if that is what you want: >>> from path import path >>> d=path('/some/dir') >>> d / "file" path(u'/some/dir\\file') >>> If + also did that, it would be more difficult to change the extension when renaming a file or whatever. max -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Max Erickson
>>> color='orange' >>> if color=='red' or 'blue' or 'green': print "Works?" Works? >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: send an email with picture/rich text format in the body

2006-05-29 Thread Max M
y read html messages. In my experience the kind of user that receives emails with html and pictures often prefer it that way. So why bother with the lecture? I cannot remember when I have last received a relevant email that I could not read in text mode. -- hilsen/regards Max M, Denmark http://w

Re: send an email with picture/rich text format in the body

2006-05-29 Thread Max M
Scott David Daniels wrote: > Max M wrote: > >> 90% of users are non-technical users who use standard email readers, >> that can easily read html messages. >> >> In my experience the kind of user that receives emails with html and >> pictures often prefer i

Re: John Bokma harassment

2006-05-30 Thread Max M
ke you should be spending time on MySpace OMG!. I assume that the single l in alright is the courteous misspelling that should allways be in a posting, when correcting other peoples speling? -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mo

Re: create a text file

2006-05-30 Thread Max Erickson
"per9000" <[EMAIL PROTECTED]> wrote: > # w is for writing > myfile = open('theoutfile',w) That won't work, the second argument to open needs to be a string: myfile = open('theoutfile', 'w') max -- http://mail.python.org/mailman/listinfo/python-list

Re: create a text file

2006-05-30 Thread Max Erickson
Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Max Erickson wrote: > >>> # w is for writing >>> myfile = open('theoutfile',w) >> >> That won't work, the second argument to open needs to be a string: > > w = 'w' > >

Re: Best Python Editor

2006-05-31 Thread Max M
Manoj Kumar P wrote: > Hi, > > Can anyone tell me a good python editor/IDE? > It would be great if you can provide the download link also. pydev on top of eclipse is a nice tool. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread Max M
spelled > in the singular (session). > > Is there some type of name resolution of local variables where Python > makes assumptions? No. You are probably running your script in an ide that keeps an old variable hanging around. Try it from a command promt. -- hilsen/regards Max M,

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread Max Erickson
plural (sessionS) while later > being spelled in the singular (session). > > Is there some type of name resolution of local variables where > Python makes assumptions? > Is self.logger.items() empty? This does not raise a NameError even when 'explode' is not defined: for x in []: explode max -- http://mail.python.org/mailman/listinfo/python-list

Re: argmax

2006-06-01 Thread Max Erickson
"David Isaac" <[EMAIL PROTECTED]> wrote: > 1. Why is there no argmax built-in? > (This would return the index of the largest element in a > sequence.) > > 2. Is this a good argmax (as long as I know the iterable is > finite)? def argmax(iterable): return

Re: Package

2006-06-02 Thread Max Erickson
I'm no expert, but your post made me curious. It appears that __all__ has the effect of ensuring that from test import * picks up test1, but doesn't go any further than that. from test.test1.test2 import * should cause test3 to be imported. max -- http://mail.python.org/mailma

Re: mapping None values to ''

2006-06-18 Thread Max Erickson
t;>> b="None" >>> c=None >>> ["" for i in [a,b,c] if i in ("None",None)] ['', ''] >>> max -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is fun (useless social thread) ;-)

2006-06-19 Thread Max M
ifferent in use than current version. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mobile: +45 29 93 42 96 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is fun (useless social thread) ;-)

2006-06-20 Thread Max M
bruno at modulix wrote: > Max M wrote: >> bruno at modulix wrote: >> >>>> Or did you just like what you saw and decided to learn it for fun? >>> >>> Well, I haven't be really impressed the first time - note that it was at >>> the very e

Re: very strange bug coercing to Unicode: need string or buffer, int found

2006-06-21 Thread Max Erickson
clefb = str(clefb) > print clefb > clefc = calculclef(chiffrescabtri) > cabtri = "zz" + chiffrescabtri + clefc Your calculclef function returns an integer. You explitly convert clefb into a string, but you never convert clefc into a string, hence the TypeError. max -- http://mail.python.org/mailman/listinfo/python-list

Re: code is data

2006-06-23 Thread Max Erickson
//codespeak.net/pypy/dist/pypy/doc/getting-started.html max -- http://mail.python.org/mailman/listinfo/python-list

Re: A game idea.

2006-06-27 Thread Max M
ill have to do it yourself. I am not trying to be negative, but I will bet you that every competent programmer on the list has 1+ project that she would love to do, if she just had the time. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 M

Re: The lib email parse problem...

2006-08-29 Thread Max M
叮叮当当 wrote: > this is not enough. > > when a part is mulitpart/alternative, i must find out which sub part i > need, not all the subparts. so i must know when the alternative is > ended. Have you tried the email module at all? -- hilsen/regards Max M, Denmark http://www.m

Re: sending emails using python

2006-09-07 Thread Max M
can lead you into so many traps. Especially if you are using international characters in you messages. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mobile: +45 29 93 42 96 -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with email.Generator.Generator

2006-09-12 Thread Max M
possible to use a unicode string as a message. The charset passed in set_payload(pl ,charset) is the charset the the string *is* encoded in. Not the charset it *should* be encoded in. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mobile: +45 29 93 42 96 -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with email.Generator.Generator

2006-09-12 Thread Max M
Chris Withers wrote: > Max M wrote: >> From the docs: >> >> """ >> The payload is either a string in the case of simple message objects >> or a list of Message objects for MIME container documents (e.g. >> multipart/* and message/rfc822) &g

Re: Is it possible to change a picture resolution with Python?

2006-09-20 Thread Max Erickson
tical and horisontal > resolutions. > Any idea how to do that? > Thank you > If you just want to change the dpi flag that some software uses to interpret the size of the image when rendering it, something like: im.save('c:/tmp/out.jpg', dpi=(100,100)) might work. You c

Re: A critique of cgi.escape

2006-09-25 Thread Max M
pper and use that instead. my_escape = lambda st: cgi.escape(st, 1) So. Lawrence is happy, and the escape works as expected. Several man years has been saved. Max M -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-25 Thread Max M
stuff. If you cannot think of other examples for yourself where your change would introduce breakage, you are certainly not an experienced enough programmer to suggest changes in the standard lib! Max M -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-25 Thread Max M
content = f.read() f.close() return '"%s"' % someword in content: You might think that it is stupid code that should be changed to take escaped quotes into account. But that is really not your bussines to decide if the other behaviour is documented and correct.

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