Re: BASIC vs Python

2004-12-21 Thread Alan Gauld
r/Timex ZX81 and I think the developers came from that stable. (*)I suspect the name was a dedication to a populat SciFi series of the time, Blake's 7, which had a computer called Orac... Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://

Re: Threading Problem

2004-12-22 Thread Alan Kennedy
completed" # Which should output the expected > start threadfunction: entered start completed threadfunction x=10 threadfunction x=20 threadfunction x=30 regards, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda going out of fashion

2004-12-23 Thread Alan Gauld
there for the minority of us who like the concept? Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda going out of fashion

2004-12-23 Thread Alan Gauld
dding sonme extra work and losing some readability. Pythonic lambdas are just syntactic sugar in practice, they just make the code look more like true functional code. Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/list

Re: BASIC vs Python

2004-12-24 Thread Alan Kennedy
[Alan Gauld] > I dunno. Here in the UK there was a small home computer called (I > think) the Oric(*) which had a membrane keyboard, 4K or RAM and > ran Forth.It had a small cult following before dying out. It > looked a bit like the early Sinclair/Timex ZX81 and I think the > devel

Re: BASIC vs Python

2004-12-24 Thread Alan Gauld
On Fri, 24 Dec 2004 12:30:15 +, Alan Kennedy <[EMAIL PROTECTED]> wrote: > [Alan Gauld] > > I dunno. Here in the UK there was a small home computer called (I > > think) the Oric(*) > I'm afraid your memory fails you ... > > The Oric-1 had a keyboard

Re: The Industry choice

2004-12-31 Thread Alan Gauld
pplier says use Java, while Dilbert and the others say Python what will he pick? There are some valid technical reasons to do with performance and security too, but frankly, they come a long way down the list... Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/al

Re: EOL created by .write or .encode

2005-04-10 Thread Alan Mackenzie
khead was probably RMS (Richard Stallman, he of the Free Software Foundation), and he's been fucked so many times that once more wouldn't achieve anything at all. ;-) -- Alan Mackenzie (Munich, Germany) Email: [EMAIL PROTECTED]; to decode, wherever there is a repeated letter (like "aa

zlib and zipfile module in Python2.4

2005-04-11 Thread Alan Toppen
I was unable to use the ZipFile class in the zipfile module in Python2.4. I got an error that zlib could not be found. Comparing my Python 2.2 installation I noticed Python 2.4 was missing a certain file: /usr/lib/python2.2/lib-dynload/zlibmodule.so. Unable to find a more elegant solution, I co

Re: Python or PHP?

2005-04-25 Thread Alan Little
Steve Holden <[EMAIL PROTECTED]> wrote: >Your statement then becomes > >select * from foo where bar=1; drop table foo > >which is clearly not such a good idea. I'm sure Steve is very well aware of this and was just providing a simple and obvious example, nevertheless it might be worth pointing ou

Re: Python or PHP?

2005-04-28 Thread Alan Little
Steve Holden <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > John Bokma wrote: > > Alan Little wrote: > > > > > >>Steve Holden <[EMAIL PROTECTED]> wrote: > >> > >> > >>>Your statement then become

Re: interactive help on the base object

2013-12-08 Thread Alan Bawden
ade use of this ability, so don't ask me if it was good for anything, but it was definitely there... -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: interactive help on the base object

2013-12-09 Thread Alan Bawden
you to do better. After all modern Python classes didn't start using their current ordering until Python 2.3. -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: What is a function parameter =[] for?

2015-11-25 Thread Alan Bawden
(Note that nothing in the documentation I can find actually _guarantees_ that a Python implementation will only have one unique empty tuple, but I wouldn't be suprised if the following is nonetheless true in all current implementations: >>> tuple([]) is tuple([]) True ) -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: What is a function parameter =[] for?

2015-11-25 Thread Alan Bawden
Chris Angelico writes: > On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden wrote: >> (Note that nothing in the documentation I can find actually _guarantees_ >> that a Python implementation will only have one unique empty tuple, but >> I wouldn't be suprised if the follow

local variable 'juveniles' referenced before assignment

2016-01-13 Thread Alan Robinson
def menu(): option = int(input("Please select an option: \n 1: Set Generation 0 Values \n 2: View Generation 0 Values \n 3: Run Model \n 4: Print values")) if option == 1: juveniles,adults,seniles = setGen() elif option == 2: displayGen() elif option == 3:

Re: local variable 'juveniles' referenced before assignment

2016-01-13 Thread Alan Robinson
On Wednesday, 13 January 2016 12:32:51 UTC, Chris Angelico wrote: > On Wed, Jan 13, 2016 at 11:23 PM, Alan Robinson > wrote: > > def menu(): > > option = int(input("Please select an option: \n 1: Set Generation 0 > > Values \n 2: View Generation 0 Values \n 3:

Re: local variable 'juveniles' referenced before assignment

2016-01-13 Thread Alan Robinson
On Wednesday, 13 January 2016 13:06:11 UTC, Peter Otten wrote: > Alan Robinson wrote: > > > On Wednesday, 13 January 2016 12:32:51 UTC, Chris Angelico wrote: > >> On Wed, Jan 13, 2016 at 11:23 PM, Alan Robinson > >> wrote: > >> > def menu(): >

Re: local variable 'juveniles' referenced before assignment

2016-01-13 Thread Alan Robinson
On Wednesday, 13 January 2016 13:23:04 UTC, Alan Robinson wrote: > On Wednesday, 13 January 2016 13:06:11 UTC, Peter Otten wrote: > > Alan Robinson wrote: > > > > > On Wednesday, 13 January 2016 12:32:51 UTC, Chris Angelico wrote: > > >> On Wed, Jan

Re: Make a unique filesystem path, without creating the file

2016-02-16 Thread Alan Bawden
me I should use mkstemp() instead. (As if that would be of any use in the situation above!) It looks like anxiety that some people might use mktemp() in a stupid way has caused an over-reaction. Let the documentation warn about the problem and point to prepackaged solutions in the common cases of

Re: Make a unique filesystem path, without creating the file

2016-02-22 Thread Alan Bawden
Cameron Simpson writes: > On 16Feb2016 19:24, Alan Bawden wrote: >>So in the FIFO case, I might write something like the following: >> >>def make_temp_fifo(mode=0o600): >>while True: >>path = tempfile.mktemp() >>try:

Re: Make a unique filesystem path, without creating the file

2016-02-28 Thread Alan Bawden
Cameron Simpson writes: > On 22Feb2016 12:34, Alan Bawden wrote: I have deleted the part of discussion where it seems that we must simply agree to disagree. You think mktemp() is _way_ more dangerous that I do. >>> In fact your use case isn't safe, because _another_ task us

Re: Other difference with Perl: Python scripts in a pipe

2016-03-10 Thread Alan Bawden
signal.SIG_DFL) signal.signal(signal.SIGPIPE, signal.SIG_DFL) -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Beginner Python Help

2016-03-18 Thread Alan Gabriel
Hey there, I just started out python and I was doing a activity where im trying to find the max and min of a list of numbers i inputted. This is my code.. num=input("Enter list of numbers") list1=(num.split()) maxim= (max(list1)) minim= (min(list1)) print(minim, maxim) So the problem is th

Another python question

2016-03-18 Thread Alan Gabriel
Sorry for the multiple questions but my while loop is not working as intended. Here is the code : n = 1 list1 = [] count = 0 #amount of times program repeats steps = 0 # amount of steps to reach 1 step_list = [] while n!=0: n= int(input()) list1.append(n) length = len(list1) while count

.write() behavior

2014-10-28 Thread Alan Bawden
Maybe there is some design document for Python 3 IO that I should read that would explain the rationale for all this? -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: .write() behavior

2014-10-31 Thread Alan Bawden
ot have to worry that .write() might perform an incomplete write where it previously did not. -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: How to "wow" someone new to Python

2015-01-21 Thread Alan Bawden
t for some other Java datatypes (e.g., Buffer) it is a real problem. Score one for untyped languages. -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: How to "wow" someone new to Python

2015-01-21 Thread Alan Bawden
Alan Bawden writes: > ... Score one for untyped languages. Drat. I should have writted "dynamically typed languages". The language has changed. When I was a novice Lisp hacker, we were comfortable saying that Lisp was "untyped". But nowadays we always say that Lis

Installling ADODB on an offline computer

2015-01-29 Thread Alan Meyer
, place the files on the target computer, and run makepy.py or a setup.py to install them. Can someone suggest a way to do it? Thank you very much. Alan -- https://mail.python.org/mailman/listinfo/python-list

Re: Installling ADODB on an offline computer

2015-01-30 Thread Alan Meyer
On 01/30/2015 09:45 AM, bkl...@rksystems.com wrote: On Thursday, January 29, 2015 at 8:35:50 PM UTC-5, Alan Meyer wrote: I work on an application that uses the ActivePython compilation of Python from ActiveState. It uses three Microsoft COM libraries that are needed for talking to SQL Server

Python Captive Portal???

2015-02-25 Thread Alan Williams
I was wondering if anyone has experimented with python, memcache and maybe squid to write a simple captive portal managed by a linux box? Concept: Control Center - Linux box running Ubuntu 14.04 w/2 nic's and dhcp-server running on it. NIC's are setup eth0(192.168.0.2), eth1(10.10.10.2). eth0

Re: Python programming

2014-02-11 Thread Alan Meyer
too many programmers who don't really like programming and just learned it because they thought they could get good jobs. Most of them wind up with relatively bad jobs and are not respected by their colleagues. Don't join that crowd. Best of luck. Alan -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-16 Thread Alan Bawden
Marko Rauhamaa writes: > Case in point, if everything is a reference, how come: > >>>> "hello".__str__() >'hello' >>>> 1.__str__() >SyntaxError: invalid syntax >>> (1).__str__() '1' >>>

Re: running python 2 vs 3

2014-03-20 Thread Alan Meyer
ython versions. If it works fine in both - and many will, then use: #!/usr/bin/env python Only use the "python2" or "python3" versions if you really have a reason to do so. Yes? No? Alan -- https://mail.python.org/mailman/listinfo/python-list

Re: which book to read next??

2014-04-21 Thread Alan Gauld
ays a very personal thing. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Trolls, Nikos, Ferrous Cranus

2013-10-02 Thread Alan Spence
ifferent way, > perhaps it will be more clear." Why did you start to engage again? Pity the link which I originally pointed out is no longer valid. Alan -- https://mail.python.org/mailman/listinfo/python-list

Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI

2015-03-09 Thread Alan Hicks
Reporting & Conformance" and ongoing monitoring by importing feedback reports about messages that pass and/or fail DMARC evaluation into a more easily digested format. Alan Hicks https://plus.google.com/+AlanHicksLondon/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI

2015-03-15 Thread Alan Hicks
On 13/03/2015 11:58, Chris Angelico wrote: On Mon, Mar 9, 2015 at 9:16 PM, Alan Hicks wrote: With defending reputations as important as receiving email I'm pleased to announce another beta of django-dmarc 0.1.3 is released to PyPI. https://pypi.python.org/pypi/django-dmarc The Django

[Fwd: Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI]

2015-03-15 Thread Alan Hicks
Original Message Subject: Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI From:"Alan Hicks" Date:Sun, March 15, 2015 2:10 pm To: "

Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI

2015-03-15 Thread Alan Hicks
On 15/03/2015 15:52, Chris Angelico wrote: On Mon, Mar 16, 2015 at 1:10 AM, Alan Hicks wrote: If issues are not surfacing it is more likely that both SPF and DKIM are not strong spam indicators rather than there are no issues. SPF is rarely implemented decisively ~all instead of -all so is

msgfmt.py and pygettext.py are LGPL or LGPL-compatible?

2015-05-25 Thread Alan Evangelista
quite inactive. Regards, Alan Evangelista -- https://mail.python.org/mailman/listinfo/python-list

Re: msgfmt.py and pygettext.py are LGPL or LGPL-compatible?

2015-05-25 Thread Alan Evangelista
On 05/25/2015 08:13 PM, Chris Angelico wrote: On Tue, May 26, 2015 at 4:42 AM, Alan Evangelista wrote: https://docs.python.org/2/library/gettext.html suggests that I use msgfmt.py and pygettext.py, available at Python Subversion ( http://svn.python.org/view/python/trunk/Tools/i18n/). What

Re: Question About Image Processing in Python

2015-05-28 Thread Alan Gauld
tching an all-in-one distro like Anaconda or Canopy. That way somebody else does the dependency dance for you. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alanga

Re: Proposal: === and !=== operators

2014-07-11 Thread Alan Bawden
lly defined. Consider: >>> a = float('nan') >>> x = [1, a, 9] >>> y = [1, a, 9.0] >>> x == y True So is there some equality predicate where corresponding elements of x and y are equal? >>> map(operator.eq, x, y) [True, False, True

Re: try/exception - error block

2014-08-03 Thread Alan Gauld
but I don't see it being set anywhere? That's about the best I can offer based on the information available. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] Convert Qstring to string in windows

2014-10-16 Thread Alan Gauld
hat's probably worth a look too. Definitely in the minority interest camp on the tutor list. hth -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list

Re: Turkic I and re

2011-09-15 Thread Alan Plum
On 2011-09-15 15:02, MRAB wrote: The regex module at http://pypi.python.org/pypi/regex currently uses a compromise, where it matches 'I' with 'i' and also 'I' with 'ı' and 'İ' with 'i'. I was wondering if it would be preferable to have a TURKIC flag instead ("(?T)" or "(?T:...)" in the pattern).

Re: using python in web applications

2011-09-15 Thread Alan Plum
On 2011-09-11 02:50, Littlefield, Tyler wrote: I replied to that one off list I guess, but I figured Django was way more overhead than I wanted, doesn't really fit with solving the speed issue. Depending on your needs, you may find something like bottle or Flask a better choice then. Django

Re: Is it possible to create C-style "main" function in Python? (for teaching purposes)

2011-10-04 Thread Alan Meyer
ers. Having to work in the real world of maintaining other people's code gives a student a better appreciation of the value of clean, modular, readable, documented code. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need A script to open a excel file and extract the data using autofilter

2011-10-04 Thread Alan Meyer
like that is I normally only need to do very simple things and I usually stop at the VBS stage. And I wasn't aware of xlrd - I'll give it a look. DaveM I've used xlrd. It's pretty nice. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to create C-style "main" function in Python? (for teaching purposes)

2011-10-04 Thread Alan Meyer
On 10/4/2011 9:07 PM, Alan Meyer wrote: ... and to write up a comparison of the pros and cons of the global and no-global approaches. ... Of course you'll need to be fair in evaluating the students comparisons. Some bright students are likely to come up with good reasons for using gl

Re: how to call java methods in python

2011-10-04 Thread Alan Meyer
an easier project. Good luck. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to isolate a constant?

2011-10-25 Thread Alan Meyer
copy each time: test() [0, 1, 'X'] test() [0, 1, 'X', 'X'] ... Python will copy something only when you tell it to copy. A simple way of copying a list is to slice it: someList = self._someList[:] And another simple way: ... someList = li

Re: suppressing import errors

2011-11-15 Thread Alan Meyer
7;if y == true') else: print('if y == false') if y is None: print('y is None == true') else: print('y is none == false') The result is: if x == false x is None == true if y == false y is none == false Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Alan Meyer
he user's machine or talk to some computer other than the one you came from, it won't work. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the difference between "new Class()" and "Class()"?

2011-11-20 Thread Alan Gauld
after the instance has been created. It is not really a constructor but an initializer. (Even though most of us treat it as a constructor!) But you should never see code like meat = new Spam(). it should be meat = Spam() Which calls __new__() followed by __init__(). HTH -- Alan G Author of

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-21 Thread Alan Meyer
esn't need to repartition or toss his old OS. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Using the Python Interpreter as a Reference

2011-11-22 Thread Alan Meyer
#x27;ll have an impressive item to add to your resume. I suspect that you'll also have a lot of fun. Good luck with it. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
ways use the selected program to open this kind of file." 8. Click "OK". The prompts I described above are the ones I saw on my Windows Server 2008 machine. Yours may vary slightly, but I think the procedures should be the same. Please let us know if that solves your problem. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's C:\Python26\Lib\site-packages\pythonwin\Pythonwin.exe Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/22/2011 3:05 PM, Dennis Lee Bieber wrote: On Tue, 22 Nov 2011 14:29:18 -0500, Alan Meyer declaimed the following in gmane.comp.python.general: On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-23 Thread Alan Meyer
On 11/23/2011 12:38 PM, W. eWatson wrote: So unless Alan Meyer has further interest in this, it looks like it's at an end. It may be time to move on to c++. C++ is a ton of fun. You haven't lived until you've made a syntax error in a template instantiation and seen a hu

Re: suitability of python

2011-11-24 Thread Alan Meyer
code. It cut the total execution time of the whole program in half. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Does py2app improves speed?

2011-11-28 Thread Alan Meyer
lines of inline code. I think the rest of your list is excellent too. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot run a single MySQLdb execute....

2013-03-28 Thread Alan Meyer
e, if that's the problem, your object named "cur" could not have been created successfully. Maybe what I'm seeing is a new problem? Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot run a single MySQLdb execute....

2013-03-29 Thread Alan Meyer
the return value from your connect() call. If everything looks good, check to see if you have rights to the database and table you are trying to select from. Good luck. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot run a single MySQLdb execute....

2013-03-29 Thread Alan Meyer
On 03/29/2013 01:32 PM, Alan Meyer wrote: However, MySQLdb is a well established module and what you're asking it to do is very simple and very standard. Oh, sorry, I see that you already said that mysqldb won't work with python 3. My comments in the last message are irrelevan

Re: XML and namespaces

2005-12-11 Thread Alan Kennedy
eateElementNS(None, "no_ns") elem2.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns", "") > document.xpath("*")[0].appendChild(elem2) > document.toFile(open("test_ns.xml", "wb")) its-not-about-namespaces-its-about-automagic-ly'yrs, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating referenceable objects from XML

2005-12-11 Thread Alan Kennedy
stly-using-kid-for-templating-ly'yrs, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML and namespaces

2005-12-12 Thread Alan Kennedy
our helpful commentary on this matter! And thanks to you for actually informing yourself on the issue, and for taking the time to research and understand it. I wish that your refreshing attitude was more widespread! now-i-really-must-get-back-to-work-ly'yrs, -- alan kennedy

Re: Pythonic XML library with XPath support for Jython?

2005-12-12 Thread Alan Kennedy
ny out now? Not yet, although I could be wrong. -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: NoneType to unicode

2005-12-12 Thread Alan Franzoni
i can't do because it crashes the application) NoneType is just the type of None. It should mean that your ID3 library returns 'None' when trying to read non-ascii ID3s. I think you should check your ID3 library, not your main program. -- Alan Franzoni <[EMAIL PROTECTED]> -

Re: Help designing reading/writing a xml-fileformat

2005-12-13 Thread Alan Kennedy
one have a good idea on how to approach this problem ? > (I do not want to use the pickle module) Why not the pickle module? XML-format pickles are a good solution to your problem, IMHO. -- alan kennedy ------ email alan: http://x

Re: Amara (XML) problem on Solaris

2005-12-13 Thread Alan Franzoni
nt() or doc = binderytools.create_document() or simply create_document() depending on the way you imported the module, but your previous code, if really working on Windows, makes me think you did something like: import amara.binderytools as amara or something like that? Please post some mo

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Alan Franzoni
e Win32 extensions. The interpreter is a compile of their own, but I don't think it to be that different from the 'official' binary. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Rremove .xyz from my address in order to contact me. - GPG K

Re: Newbie needs help extracting data from XML

2005-12-29 Thread Alan Kennedy
'%s'" % return_node.childNodes[0].nodeValue #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= You have to install PyXML to get xpath support: http://pyxml.sf.net There are other ways to do it, e.g. using ElementTree, but I'll leave it to others to suggest the best w

Re: python for with double test

2005-12-30 Thread Alan Franzoni
ant to make it shorter, you can define a function instead of the 'for' code block and use the list comprehension directly: def myfunction(x): ... [myfunction(x) for x in range(0,10) if f[x]==1] and you'll end up with a list of the return values of myfunction. -- Alan F

Re: how-to POST form data to ASP pages?

2006-01-01 Thread Alan Kennedy
be opening up a security hole in your application. The following string looks very like a VB function invocation: 'hs.ExecX10ByName "Kitchen Espresso Machine", "On", 100' Are you executing the contents of form input fields as program code? That's highly inadvisable fr

Re: how-to POST form data to ASP pages?

2006-01-01 Thread Alan Kennedy
that you're using? If I remember rightly, Python for Pocket Windows doesn't support sockets, meaning that urllib wouldn't work on that platform. Another thing to establish is whether the URL is working correctly, from a client you know works independently from your

Re: Spelling mistakes!

2006-01-07 Thread Alan Kennedy
aahz-didn't-shout-at-you-ly'yrs, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross Compile Mips / Linux

2006-01-10 Thread Alan Franzoni
, but those machines are so memory-limited (mine had 8MB I think) I couldn't have it work. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. To contact me, remove .xyz from my email address. - GPG Key Fingerprint: 5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E -- http://mail.python.org/mailman/listinfo/python-list

Re: jython base64.urlsafe_b64xxx

2006-01-13 Thread Alan Kennedy
domain one for example http://dev.i2p.net/cgi-bin/cvsweb.cgi/i2p/core/java/src/net/i2p/data/Base64.java?f=H With javadoc at http://dev.i2p.net/javadoc/net/i2p/data/Base64.html Seems to do what you want. HTH, -- alan kennedy -- email alan:

Re: XML vs. cPickle

2006-01-13 Thread Alan Kennedy
and out of the database. > Ideas are appreciated, I'd write a few simple prototypes and take some empirical measurements. HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive tree list from dictionary

2006-01-14 Thread Alan Franzoni
; to map the list position to the root element: def convertList(dictlist): helpdict={} for elem in dictlist: helpdict.setdefault(elem['parent'],[]) helpdict[elem['parent']].append(elem['title']) return [k,v for k,v in helpdict.items() if k

Re: MySQLdb - Query/fetch don't return result when it *theorically* should

2006-01-18 Thread Alan Franzoni
you tried just creating a new cursor object at every query? If you want to do a quick-test, try any ORM, like sqlalchemy or sqlobject, and check the results. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. To contact me, remove .xyz from my ema

Re: MySQLdb - Query/fetch don't return result when it *theorically* should

2006-01-19 Thread Alan Franzoni
ld be getting a Q1 results from a certain state in the DB, while Q2 from a different state, thus misleading you to take an inopportune action. committing the connection syncs the state you're looking at with the actual DB state. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia e

Re: Dive Into Python -- Still Being Updated?

2006-07-24 Thread Alan Franzoni
ve some *special* methods, (any python object has) but they have no method of their own. I think this is pretty clear, it's employed to emphasize the contrast with the list object. BTW, you can see last update is 20 May 2004; it's right on the homepage. -- Alan Franzoni <[EMAIL PRO

Re: smtplib timeout

2006-07-25 Thread Alan Kennedy
' timeout_value = 1.0 # seconds socket.setdefaulttimeout(timeout_value) print "connecting to server: %s" % dud_server try: connection = smtplib.SMTP(dud_server) except socket.timeout: print "server timed out" == HTH, -- alan kennedy

Re: smtplib timeout

2006-07-25 Thread Alan Kennedy
[Stuart D. Gathman] >>> I need to set a timelimit for the operation of >>> smtplib.sendmail. It has to be thread based, because pymilter uses >>> libmilter which is thread based. [Alan Kennedy] >> Have you tried setting a default socket timeout, which ap

Re: python and JMS

2006-07-30 Thread Alan Kennedy
[tksri2000] > I am looking to use python to talk to JMS. Can some please point me to > such resources if this is possible. PyHJB is the python-to-JMS gateway. ... via HJB, the HTTP JMS bridge. http://hjb.python-hosting.com/ HJB (HTTP JMS Bridge) http://hjb.berlios.de/ HTH, -- alan k

[OT] John Salerno (was: and i thought windows made a mess of files...)

2006-08-11 Thread Alan Connor
x27;t help trolls. And I don't think you could run Linux if your life depended on it. You'd actually have to take a break from running your mouth on hundreds of groups under dozens of aliases to do some homework. Phuk off (again). Done. Note: I won't be downloading any articles on

Re: [OT] John Salerno

2006-08-12 Thread Alan Connor
to yourarticles to my newsreader. Regardless of which alias you are hiding behind at the moment, with your tail between your legs where your balls should be. No way I am going to help a stinking troll learn Linux. If you are even trying to, that is... Note: I won't be downloadi

Re: [OT] John Salerno

2006-08-12 Thread Alan Connor
quot; <[EMAIL PROTECTED]> #From: "Snoopy :-))" <[EMAIL PROTECTED]> #From: "William B. Cattell" <[EMAIL PROTECTED]> #From: <[EMAIL PROTECTED]> #From: "Ciaran Keating" <[EMAIL PROTECTED]> #From: "Clayton Sutton" <[EMAIL PROTECTED]&g

Re: Converting MSWord Docs to PDF

2006-10-10 Thread Alan Franzoni
If you're doing this in Linux, you should consider something like Crossover Office in order to run ms word and convert its output. The openoffice.org based solution will surely work, but you'll heavily rely on the conversion quality of that suite. -- Alan Franzoni <[EMAIL PROTECTED]>

Re: Compile python on Solaris 64bit

2006-10-12 Thread Alan Franzoni
ally using? I think there could be some configuration mismatch between running binaries and environment variables that could confuse the compiler. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Rremove .xyz from my address in order to contact me. - GPG Ke

Re: Change on file

2006-10-24 Thread Alan Franzoni
and changes frequent, it could put the system under severe workload. If you just need to know if a file has changed, you can check via date/time, or if you don't trust somebody who's got access to it (because he could have manually altered the datetime) you could go for a simpler algo

Re: handling many default values

2006-11-11 Thread Alan Isaac
> At Friday 10/11/2006 14:11, Alan G Isaac wrote: > >class Params: > > def __init__(self,**kwargs): > > #set lots of default values > > ... > > #set the deviations from defaults > > self.__dict__.update(kwargs) >

Re: handling many default values

2006-11-11 Thread Alan Isaac
efaults are set). I believe this is the case, since the many parameters can vary arbitrarily and do not fall into neat groupings. Also, as an aside, no one objected to using self.__dict__.update(kwargs) in the __init__ function of the parameter holding class. Thanks, Alan -- http://mail.py

Re: Python less error-prone than Java

2006-06-03 Thread Alan Morgan
s. There are some gotchas, but it's not drastically more complex than the original int-only java code. Alan -- Defendit numerus -- http://mail.python.org/mailman/listinfo/python-list

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