Re: CGI scripts

2006-04-17 Thread Daniel Nogradi
> > Can I use Python for CGI scripts. It is telling me to use Perl and I > > don't know any > > > > To be honest I don't really no what CGI scripts are (soz) > > > > I have purchased a domain name of my ISP PIPEX and 100MB space > > > > And I don't know what I can do with it now I just realized th

python and vc numbers

2009-11-28 Thread Daniel Dalton
Hi, I have a very simple problem, but I can't work out the answer. How do I return the current tty number in python? eg. what function/module should I use to figure out what tty my program was invoked from? Thanks -- Cheers, Dan http://members.iinet.net.au/~ddalton/ signature.asc Descriptio

Re: python and vc numbers

2009-11-30 Thread Daniel Dalton
On Mon, Nov 30, 2009 at 02:21:54PM +1300, Gregory Ewing wrote: > >I use to figure out what tty my program was invoked from? > > Here's one way: > > % python > Python 2.5 (r25:51908, Apr 8 2007, 22:22:18) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin > Type "help", "copyright",

Re: python and vc numbers

2009-11-30 Thread Daniel Dalton
On Mon, Nov 30, 2009 at 07:20:59PM +1100, Daniel Dalton wrote: > That did the trick, thanks, after I append > [-2] Further testing under screen says otherwise -- it seems to give me the tty number, not the virtual console number. Is there any way to figure out what virtual console I'

Re: python and vc numbers

2009-11-30 Thread Daniel Dalton
On Mon, Nov 30, 2009 at 02:26:14AM -0800, Chris Rebert wrote: > Also, in my quickie newbie experimentation with `screen`, each screen > "window" seems to get a unique tty#. Admittedly I am running OS X Correct (Which creates the problem) > Perhaps if you could explain your problem in greater deta

Re: Moving from Python 2 to Python 3: A 4 page "cheat sheet"

2009-12-01 Thread Daniel Fetchinson
oms rather > than those from Python 2 where the idioms differ. > > It uses Python 3.1 syntax since that looks like being the standard for > a few years in view of the language moratorium. This really looks very useful, thanks a lot! I've been wishing something like this existed fo

Re: python and vc numbers

2009-12-02 Thread Daniel Dalton
> Can you make do with the tempfile module? Or you'd need to identify > from an external process which console is locked? Perhaps, I wrote a small hack: - Manually set environment variable TTYNUMBER in .bash_profile - Then use this in the script, to establish what tty I'm working with. Thanks -

Re: Call C program

2009-12-03 Thread Daniel Fetchinson
.linux-x86_64-2.6]$ python Python 2.6.1 (r261:67515, Mar 29 2009, 14:31:47) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mymod >>> mymod.add(1,2) 3 >>> dir(mymod) ['__doc__', '__file__', '__name__', '__package__', 'add'] Have fun! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for small, fast, Python based web server

2009-12-09 Thread Daniel Fetchinson
t; aware of: > - cherrypy > - web.py > - twisted > > Any recommendations appreciated (Python 2.6 preferred but open to > Python 3.1 options). I'm using cherrypy for this purpose, actually together with turbogears 1. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: KeyboardInterrupt

2009-12-10 Thread Daniel Stutzbach
tting there in t.join() with no exception handler around it. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: pyZui - anyone know about this?

2009-12-11 Thread Daniel Fetchinson
gt; that > ZUI was done, it's simply amazing. > > Any clues out there? Youtube has a link 'Send message' on the profile of users, maybe sending a message to the person who uploaded the video will give you a useful response. Cheers, Daniel -- Psss, psss, put it down! - h

Re: Open source projects

2009-12-12 Thread Daniel Fetchinson
her of them. See http://www.turbogears.org Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Best way to conduct a google search

2009-12-12 Thread Daniel Dalton
Hi, I need to do the following in my program: 1. Conduct a google search, supplying the variable "text" to the search. Is there a google api or something similar I should use? 2. I then need to be able to get the url, of the page, or the html content, so I can dump it to text. Thanks, Dan signa

Re: treaps in python

2009-12-14 Thread Daniel Stutzbach
ibute#distribute-setup-py -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: pyZui - anyone know about this?

2009-12-16 Thread Daniel Fetchinson
the sha module is deprecated; use the hashlib module instead import sha It's no big deal but if you want to be future proof maybe you can switch to hashlib for py2.6 and stay with sha for py2.5 and before (a try/except block would suffice). Cheers, Daniel -- Psss, psss,

Re: iterators and views of lists

2009-12-16 Thread Daniel Stutzbach
On Wed, Dec 16, 2009 at 7:33 AM, Peter Otten <[email protected]> wrote: > islice() could be changed to special-case lists and tuples, but that feels > a > bit unclean. > How about special-casing objects that implement collections.Sequence? -- Daniel Stutzbach, Ph.D. Pr

Re: iterators and views of lists

2009-12-16 Thread Daniel Stutzbach
s(seq[i]) Alternately, if I'm using the blist extension type that I wrote, then seq[1:] is O(log n). http://pypi.python.org/pypi/blist/ -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: pyZui - anyone know about this?

2009-12-17 Thread Daniel Fetchinson
>> /home/fetchinson/pyzui/pyzui/tilestore.py:22: DeprecationWarning: the >> sha module is deprecated; use the hashlib module instead >> import sha > Yeah, I'd noticed that. It's fixed in the repository now. Great, thanks, pulled it and all looks good. Cheers, D

Re: Class variables static by default?

2009-12-21 Thread Daniel Fetchinson
cted results. > For new-style classes, descriptors can be used to create instance > variables with different implementation details." I don't think Steven cares much, he loves this type of nitpicking and uber pedantic formulations, but only if he can apply it to other peo

Re: Class variables static by default?

2009-12-22 Thread Daniel Fetchinson
y useful and helpful, one just has to >> cut all the nitpicking, ... > > Technically you don't have to cut *all* the nitpicking, cutting 87.3% of > it is sufficient. Touche! :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Question-Answer based web App

2009-12-28 Thread Daniel Fetchinson
nerate the report using > if-else ? Yes, from what you described that sounds like a good approach. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python OOP Problem

2009-12-28 Thread Daniel Fetchinson
( ) If the class MyObject is not local, for example because you need 'o' in a function body, you can try globals( ) instead of locals( ). HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread Daniel Fetchinson
; > > So i'm guessing that the attribute has been changed from func_code to > f_code but the inspect module wasn't updated to reflect that. Please read the documentation for inspect.getargvalues: """ inspect.getargvalues(frame) Get information about arguments passed into a particular frame. A tuple of four things is returned: (args, varargs, varkw, locals). args is a list of the argument names (it may contain nested lists). varargs and varkw are the names of the * and ** arguments or None. locals is the locals dictionary of the given frame. Changed in version 2.6: Returns a named tuple ArgInfo(args, varargs, keywords, locals). """ HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: twenty years ago Guido created Python

2010-01-04 Thread Daniel Fetchinson
> Sorry I failed to salvage the thread. Go, quick, these threads are all around us! They are popping up everywhere! Go, go, quick! There is another troll thread right there! They are encircling us! They keep coming! At least one troll thread started on usenet just since I started typing! Quick, qu

Re: twenty years ago Guido created Python

2010-01-04 Thread Daniel Fetchinson
Award of 2010 for sure :) Although who knows, there is a full year ahead and things can change Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: twenty years ago Guido created Python

2010-01-05 Thread Daniel Fetchinson
! >> >> The more languages you learn before getting to Smalltalk, the more >> awesome Smalltalk will be for you. >> > After implementing SmallTalk I more or less gave up OO programming for > ten years, But why? What was so frightening about the OO model of SmallTalk?

Pass multidimensional array (matrix) to c function using ctypes

2010-01-06 Thread Daniel Platz
to a numpy array. Has someone an idea to help me? Thank you very much Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Pass multidimensional array (matrix) to c function using ctypes

2010-01-07 Thread Daniel Platz
Thanks a lot. This solves my problem and I understand now much better what is going on. Best regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Manipulating pointers in C using ctypes

2010-01-08 Thread Daniel Platz
tead of an ct.c_void_p object. Moreover, I also tried to directly manipulate the address of the pointer given as an argument to pointers.show. But when it returns to python the pointer points still at the same address as before the function call. Can someone help me with this problem? I would be v

lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
simple that would be acceptable too. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
o > meet > these requirements. It's not a standard crypto algorithm by any means, but > Paul > knows his stuff and has devised it with these deployment restrictions in > mind. > >http://www.nightsong.com/phr/crypto/p3.py Thanks a lot, currently I'm having trouble usin

Re: lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
anything older. array.array raises a ValueError: string length not a multiple of item size Does anyone recall a change to array.array? The full traceback is Traceback (most recent call last): File "p3.py", line 163, in _test() File "p3.py", line 143, in

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
urn array ('L', j) >> ValueError: string length not a multiple of item size > > Are you on a 64-bit platform? Unfortunately, array's integer typecodes are > platform-specific, but p3.py requires a 32-bit integer and was written on a > 32-bit platform. It's reasonably straightforward to fix. Put this bit of > (untested) code at the top of the file and replace occurrences of 'L' with > uint32: > > # Find the typecode of a 32-bit unsigned integer. > for typecode in 'IL': > if len(array(typecode, [0]).tostring()) == 4: > uint32 = typecode > break > else: > raise RuntimeError("Neither 'I' nor 'L' are unsigned 32-bit integers.") Thanks! That was exactly the problem, I'm on a 64 bit machine and your fix seems to work indeed. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
On 1/9/10, Steven D'Aprano wrote: > On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote: > >> I have a plain text file which I would like to protect in a very simple >> minded, yet for my purposes sufficient, way. I'd like to encrypt/convert >> it int

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
ution. > > > > What would be the simplest way to achieve this using preferably stock > > python without 3rd party modules? If a not too complex 3rd part > > module made it really simple that would be acceptable too. > > > > > Daniel, > > Here'

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
test("This encryption scheme is definitely unbreakable.", "secret") > text:'This encryption scheme is definitely unbreakable.' > encrypted:'&2\xa5\xd4\x17i+E\x01k\xfa\x94\xf80\xa8\x8f\xea.w\x128\xf1\xd9\x0f9\xf2t\xc9\r`\x90%\xd6\xf3~\x1f\

Re: lightweight encryption of text file

2010-01-10 Thread Daniel Fetchinson
string won't be used. Instead, create an SHA hash > (see the sha and hashlib modules) of the password and use that. Thanks, this looks very simple too, but where is the decryption code? Wikipedia seems to suggest that encryption and decryption are both the same but running crypt on the outp

Re: lightweight encryption of text file

2010-01-10 Thread Daniel Fetchinson
two > streams, initiated with the same key, and kept in lockstep. > > The advantage of a stream cipher is that you can encrypt a text without > needing all the text at once, and then decrypt it the same way: > >>>> output = [] >>>> output.append(encrypt.crypt("abcdefghi")) >>>> output.append(encrypt.crypt("jklmno")) >>>> output.append(encrypt.crypt("p")) >>>> output.append(encrypt.crypt("qrstuvwxyz")) >>>> output = ''.join(output) >>>> >>>> plain = [] >>>> plain.append(decrypt.crypt(output[0:20])) >>>> plain.append(decrypt.crypt(output[20:24])) >>>> plain.append(decrypt.crypt(output[24:])) >>>> ''.join(plain) > 'abcdefghijklmnopqrstuvwxyz' Thanks Steven, this was very helpful! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Manipulating pointers in C using ctypes

2010-01-10 Thread Daniel Platz
Thanks for valuable answers. Both solutions work and I understand my mistake. Best regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

easy_install fails on python-magic

2010-01-11 Thread Daniel Fetchinson
7;clone' As far as I can see the problem is that no version of python-magic has been supplied for python 2.6 which is the version I'm using, only 2.4 and 2.5. Nevertheless easy_install should I think fail with a more user friendly message, and definitely not with a long trac

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Daniel Fetchinson
effort, pointing out not just the > bug > but exactly what needs fixing, not whining about me not wasting half an hour > on > going through proper channels after already wasting much time on that bug! Thanks to this 100% true statement from Brett Cannon there is an easy way to get rid of your disappointment: """ If you are doing open source for anything other than altruistic reasons you are bound to be disappointed. """ HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
t; with "in practice it’s very hard to create complex programs" because for small programs it's very possible to write code that will work with both python 2 and 3. The question is of course what program is simple/small and what program is large/complex, but without qualifications

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
(1) single code base working on both python versions (2) creating a second code from a code so that the second code works with python 3 and the first one with python 2. Statement (2) is about porting, statement (1) is about something else. Having said all that I actually seriously doubt (probably in a

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
have one program working correctly under both > Python 2 *and* 3 with a single code base. It might not be the > officially recommended way... but that does not make it impossible. Cool, thanks, I didn't know about crunchy having this property, good to know. Cheers, Daniel

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
re a) > doctests and b) the requirement to test exactly string input/output and > exactly unicode input/output on both platforms. Most code simply doesn't > have that requirement, but lxml does. Cool, that's another example I was unaware of, thanks! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorted dictionary

2010-01-21 Thread Daniel Stutzbach
sort. > Indeed. In fact, blist 1.1 (to be released within a month or so) will include sorteddict, sortedset, sortedlist, weaksortedset, and weaksortedlist types. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org

Re: Sorted dictionary

2010-01-21 Thread Daniel Stutzbach
On Thu, Jan 21, 2010 at 12:45 PM, Jan Kaliszewski wrote: > Please note that I used funcions from bisect, that use binary search. > > Doesn't it take O(log n) time? > It takes O(log n) time to find the point to insert, but O(n) time to perform the actual insertion. -- Danie

Re: list.pop(0) vs. collections.dequeue

2010-01-22 Thread Daniel Stutzbach
on with the built-in list here: http://stutzbachenterprises.com/performance-blist -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Daniel Stutzbach
exist as a third-party module. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC -- http://mail.python.org/mailman/listinfo/python-list

Re: list.pop(0) vs. collections.dequeue

2010-01-25 Thread Daniel Stutzbach
On Mon, Jan 25, 2010 at 12:24 PM, Steve Howell wrote: > Hi Daniel, I agree with what Raymond Hettinger says toward the top of > the PEP. Blist, while extremely useful, does seem to have to trade > off performance of common operations, notably "get item", in order to > get

Re: python 3's adoption

2010-01-27 Thread Daniel Fetchinson
nux2 Type "help", "copyright", "credits" or "license" for more information. >>> print( 'hello' ) hello >>> print 'hello' hello >>> Yes, this is with python 2.6.2 which is in the 2.x line of releases. So? Cheers,

myths about python 3

2010-01-27 Thread Daniel Fetchinson
"credits" or "license" for more information. >>> 6/5 1 >>> from __future__ import division >>> 6/5 1.2 Please feel free to post your favorite false or misleading claim about python 3! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: myths about python 3

2010-01-27 Thread Daniel Fetchinson
way around this is _not_ the case. What do you mean? > To say that two things are > compatible if one can be used for the other, but the other not for the > first, is false or misleading. I'm not sure what you mean here. Maybe I didn't make myself clear enough, but what I mean is this: as long as print and integer division is concerned, it is trivial to write code that runs on both 2.6 and 3.x. Hence if someone wants to highlight incompatibility (which surely exists) between 2.6 and 3.x he/she has to look elsewhere. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: myths about python 3

2010-01-27 Thread Daniel Fetchinson
ed migration guide too (quoted by Steve Holden in another thread not so long ago), second of all the most vocal arguments that one hears mostly from ill-informed people are related to print and similar non-issues. These then get quoted over and over again, which led me to write this post :) Cheers, Daniel Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3's adoption

2010-01-27 Thread Daniel Fetchinson
:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)]' > >>> > >>> print( "2+2 =", 2+2 ) > 2+2 = 4 > >>> _ True. However, as someone else pointed out in a neighbouring thread you can do Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) [GC

Re: python 3's adoption

2010-01-27 Thread Daniel Fetchinson
;> from __future__ import print_function >>>>> print( "2+2 =", 2+2 ) >> 2+2 = 4 >> >> which gives 100% compatibility as far as print is concerned between 2.6 >> and 3.x. > > That makes the code behave with 3.x syntax and semantics regarding print. &g

Re: myths about python 3

2010-01-27 Thread Daniel Fetchinson
lly, in this thread tons of rebuttals can be found to your statements but I doubt you will change your mind :) Hopefully others reading all of this will at least see what is BS and what is the actual situation about python 3. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO module for binomial coefficients, etc.

2010-01-27 Thread Daniel Stutzbach
1 return part_product(n, k) * part_product(k+2, m) def n_minus_num_of_bits(v): w = v if w >= 2**32-1: raise OverflowError w -= (0x & w) >> 1 w = (w & 0x3333) + ((w >> 2) & 0x) w = w + (w >> 4) & 0x0f0f0f0f w += w >&g

Re: Library support for Python 3.x

2010-01-28 Thread Daniel Fetchinson
n said other thread, anyone can look them up. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop searching takes too long!

2010-01-28 Thread Daniel Stutzbach
a number between 1 and your sum without generating each and every one. choice = random.randrange(1, sum(i[0] for i in myList)+1) -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: super() and multiple inheritance failure

2009-09-25 Thread Daniel Stutzbach
iour. > super() does not have the behavior that I would have expected, either, and IMO the documentation is unenlightening. I found the following website helpful in understanding what super() *actually* does (though I do not support the author's hyperbolic criticisms): http://fuhm.net/sup

Re: SQLObject

2009-09-28 Thread Daniel Fetchinson
ore or after I've told SQLObject that the BOB column is a > String column? > > Is there a published list of the default naming convention that > SQLObject follows? I couldn't find it on the website. The current maintainer of sqlobject is Oleg Broytmann and he frequently answers

Re: iterate over list while changing it

2009-09-30 Thread Daniel Stutzbach
[1, 2, 3, 4, 5, 6] i = 0 while i < len(a): x = a[i] if x == 3: a.pop(i) i += 1 continue if x == 4: a.append(88) print "i", i, "x", x i += 1 -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: AJAX Widget Framework

2009-10-02 Thread Daniel Fetchinson
I > have never used a system like that. I do things like these via turbogears on the server side and extjs on the client: turbogears.org extjs.com HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient running median

2009-10-13 Thread Daniel Stutzbach
_median if my_median < value: my_median += step_size else: my_median -= step_size Let me know if you have any questions about it. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

ANN: blist 1.0.2

2009-11-01 Thread Daniel Stutzbach
es in debug builds - Ported tests to run under Python 2.6 and Python 3.1 (but no longer Python 2.5) - Got rid of warnings on non-ix86 platforms -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: have opensource crawler written by python?

2009-11-02 Thread Daniel Fetchinson
> Is there a crawler written by python? anybody can give me more information? http://www.google.com/search?q=python+web+crawlers HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyfora, a place for python

2009-11-02 Thread Daniel Fetchinson
s and mailing lists) rather than setting up new walled > gardens. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyfora, a place for python

2009-11-02 Thread Daniel Fetchinson
nsive overview of that, and features like "jump to next unread > article". These are perfectly legitimate reasons for you to not use online forums and stick to c.l.p. I do the same thing. But again, if an enthusiastic python community member wants to open new channels for those folks who like them, why should anyone be hostile to him/her? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyfora, a place for python

2009-11-03 Thread Daniel Fetchinson
On 11/3/09, Diez B. Roggisch wrote: > Daniel Fetchinson schrieb: >>>>>> If you have any suggestions, let me know -- this is a community >>>>>> effort! >>>>> Suggestion: Please don't make efforts to fragment the community. >>>&

Re: Pyfora, a place for python

2009-11-03 Thread Daniel Fetchinson
quot;. This assumption on the part of Ben, I think, is hostile, since it assumes that the OP is making an effort to do something not nice. Whether the OP is indeed doing something not nice, is irrelevant. If the OP does do something not nice, the hostility is warranted. If the OP is not

Re: Pyfora, a place for python

2009-11-04 Thread Daniel Fetchinson
deas. And yet in other words, Ben was not hospitable. So perhaps 1a and 1b doesn't quite fit the bill since Ben didn't go as far as call the OP an enemy and he wasn't evil or wished harm to the OP, but 1c and d(1) are certainly correctly describing his behavior and to a lesser extent

Re: Pyfora, a place for python

2009-11-04 Thread Daniel Fetchinson
ut the right kind of response I think everybody deserves who puts energy/enthusiasm/effort/time into putting together a python-related forum. Cheers, Daniel >> It would be the Internet equivalent of looking for a poker tournament in >> a desert valley instead of driving half an hour

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
you allow clients to inject arbitrary code > into your server. Including the notorious "os.system('rm -rf /')". > > So - don't do that. Use e.g. CORBA if you need a richer, object-base > protocol than XMLRPC. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
at solution to use in which environment and I intend to not over kill. No risk environment = security holes are okay. Risky environment = secure code from day one. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
heir system to code injection > attacks. On general grounds, you are right, of course. My point is that hacking can still be a fun and easy-going activity when one writes code for himself (almost) without regards to security and nasty things like that creeping in from the outside. I'm the king in my castle, although I'm fully aware of the fact that my castle might be ugly from the outside :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
t, the OP did want restricted scope, so probably his environment is not completely risk free. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Basic list/dictionary question

2009-11-11 Thread Daniel Jowett
;, 'pear', 'orange', 'banana'], 'banana': ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']} >>> >From what I can work out, there is only ONE list that is referenced from the dictionary 4 times. Which would be because the *same empty list* is assigned to every key in the dictionary by the "fromkeys" line. But that seems *seriously *counter-intuitive to me... Would anyone beg to differ and try to rewire my thinking? (I'm from a Java background if that helps) I've already solved the problem a different way, but I am concerned about this counter-intuitiveness as I see it. rgds, Daniel Jowett -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic list/dictionary question

2009-11-11 Thread Daniel Jowett
Thanks Chris, yes it's becoming clearer now. And defaultdict looks nice - unfortunately I'm stuck to python 2.4 as I'm using Plone. Thanks again, Daniel 2009/11/11 Chris Rebert > On Wed, Nov 11, 2009 at 4:16 AM, Daniel Jowett > wrote: > > Greetings, > > &

Re: ask a question about the module

2009-11-12 Thread Daniel Fetchinson
lem still exist. Is there any expert can help me > solve this problem? > Thank you very much! Did you also install the python bindings for gnuplot? If not, you can get it from http://gnuplot-py.sourceforge.net/ HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Vote on PyPI comments

2009-11-13 Thread Daniel Fetchinson
ython-list should be a prerequisite for people who want to have some clue which python software they want to use? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Vote on PyPI comments

2009-11-15 Thread Daniel Fetchinson
about a single vote, but the way these things usually work is that out of 1000 votes the non-informative ones average out ("wow! awsome package!" vs "this sucks bad!") and the net vote result is generally indicative of the actual thing that was voted on especially when ther

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-17 Thread Daniel Fetchinson
me kind of urwid2html tool or some such or is it plain ncurses? Urwid is really cool! Cheers, Daniel > Tarball: >http://excess.org/urwid/urwid-0.9.9.tar.gz > > RSS: >http://excess.org/feeds/tag/urwid/ > > > About this release: > === > > Thi

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-18 Thread Daniel Fetchinson
en = urwid.web_display.Screen() > else: > screen = urwid.raw_display.Screen() Thanks, I missed that. >> Urwid is really cool! > > No argument there :) None, indeed. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: non-copy slices

2009-11-18 Thread Daniel Stutzbach
it -s 'from blist import blist' 'small_list=blist([0])' ''BIG_list=small_list*2**29' 'BIG_slice=BIG_list[4:-5]' 1 loops, best of 3: 21.5 usec per loop -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

python and web pages

2009-11-18 Thread Daniel Dalton
Hi, Here is my situation: I'm using the command line, as in, I'm not starting gnome or kde (I'm on linux.) I have a string of text attached to a variable,. So I need to use one of the browsers on linux, that run under the command line, eg. lynx, elinks, links, links2 and do the following. 1. Open

Re: non-copy slices

2009-11-19 Thread Daniel Stutzbach
ce, though. That takes O(n) time if you're taking a big slice. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/HTML integration: phileas v0.3 released

2009-11-20 Thread Daniel Fetchinson
nsidered markup.py from http://markup.sourceforge.net/ ? It's comparable to your project as far as I can see, a more detailed comparison would probably be useful. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: python and web pages

2009-11-20 Thread Daniel Dalton
On Thu, Nov 19, 2009 at 09:43:50AM +0100, Diez B. Roggisch wrote: > >elinks, links, links2 and do the following. > >1. Open a certain web page and find the first text box on the page, and > >put this text into the form. > >2. Press the submit button, and wait for the result page to load. > >3. Clic

Re: How do I create a vanilla object in C?

2009-11-21 Thread Daniel Fetchinson
ex.html http://docs.python.org/c-api/index.html http://docs.python.org/c-api/object.html HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpc idea for getting around the GIL

2009-11-22 Thread Daniel Fetchinson
cessing.html For what you describe (separate tasks running concurrently without communicating) the multiprocessing module would be ideal. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpc idea for getting around the GIL

2009-11-24 Thread Daniel Fetchinson
using C function pointers, and I > can't think of a way that this would be able to re-gain access to the > original app's respective functions if the interpreter was living in > another processes. > > That's not to mention the impossibility of debugging. > > Damn you,

Re: vpython installation problem

2009-11-26 Thread Daniel Fetchinson
> I am trying to install Vpython. > > configure worked well [snip] > but make fails: [snip] > what I can do? I'd suggest asking for help on vpython's mailing list: https://lists.sourceforge.net/lists/listinfo/visualpython-users HTH, Daniel -- Psss,

ANN: blist 1.1.1 - now with sortedlist, sortedset, and sorteddict

2010-01-31 Thread Daniel Stutzbach
le(x) # y is a btuple with > 500 million elements Feedback We're eager to hear about your experiences with the blist. You can email me at [email protected]. Alternately, bug reports and feature requests may be reported on our bug tracker at: http://github.com/DanielStutzbach/blist/issues -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com/> -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3147 - new .pyc format

2010-02-01 Thread Daniel Fetchinson
honX.Y/site-packages there would be only pyc files with magic number matching python X.Y. So, basically nothing would change only the location of py and pyc files would be different from current behavior, but the same algorithm would be run to determine which one to load, when to create a pyc file,

Re: PEP 3147 - new .pyc format

2010-02-01 Thread Daniel Fetchinson
t;> What would be wrong with this setup? > > Consider: > > ./module.py > ./package/module.py > > Under your suggestion, both of these will compile to > > /usr/lib/pythonX.Y/site-packages/module.pyc I see the problems with my suggestion. However it would be great if in some other way the .pyc files could be kept out of the way. Granted, I don't have a good proposal for this. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3147 - new .pyc format

2010-02-02 Thread Daniel Fetchinson
se maybe there is nothing to fix, according to some) this issue and make all pyc files go away and having python magically doing the right thing. A central pyc repository would be something I was thinking about, but I admit it's a half baked or not even that, probably quarter baked idea. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3147 - new .pyc format

2010-02-03 Thread Daniel Fetchinson
the relationship to python source files and the created pyc files, please don't nitpick on this point. The analogy is in the sense that your project inevitable needs for whatever reason some binary files which are rarely needed at hand, only the linker/compiler/interpreter/etc needs to know where they are. These files can be stored separately, but at a location where one can inspect them if needed (which rarely happens). Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3147 - new .pyc format

2010-02-03 Thread Daniel Fetchinson
re other than immediately > next to the .py file (either in the same directory, or in a clearly named > sub-directory). Okay, I think we got to a point where it's more about rationalizing gut feelings than factual stuff. But that's okay, system/language/architecure design is often times more about gut feelings than facts so nothing to be too surprised about :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Your beloved python features

2010-02-05 Thread Daniel Fetchinson
ved python features. >> >> So, may you help me please? If there's a similar thread/blogpost/ >> whatever, please give it to me, google couldn't. >> >> Regards >> Julian > > http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/ch

<    10   11   12   13   14   15   16   17   18   19   >