Re: Porn Addiction Solutions?

2008-10-09 Thread Dotan Cohen
2008/10/9 suntzu <[EMAIL PROTECTED]>: > try xnxx.com, at least you won't have to pay for anything or deal with > malware. Doesn't work with Flash on Linux! I'm going back to google images search! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע

Re: Total Python Noob

2008-10-09 Thread Tom Lake
"Chris Rebert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Thu, Oct 9, 2008 at 11:22 PM, Tom Lake <[EMAIL PROTECTED]> wrote: I have Python 2.6 installed on Vista Ultimate. When I try to calculate sqrt (or any transcendental functions) I get the following error sqrt(2) Tra

About upgrade my graphics memory

2008-10-09 Thread robin
PROBLEM i need to upgrade my graphics memory to enjoy the features of windows vista aero theme.. i am intel D915GLVG motherboard. what type of graphics card is supported on my motherboard and how much it cost?? fiend solution here http://pc-solution4u.blogspot.com/ -- http://mail.python.org/mailm

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
>> I know for a fact that the implementation is incomplete. In Windows >> Installer, there is no way (that I know of) to create an MSI file >> that conditionally turns on UAC, only when the installation actually >> needs privilege elevation. > > You cannot turn on (or turn off) UAC for a single ap

Re: Total Python Noob

2008-10-09 Thread shstein2002
On Oct 9, 11:22 pm, "Tom Lake" <[EMAIL PROTECTED]> wrote: > I have Python 2.6 installed on Vista Ultimate.  When I try to calculate > sqrt (or any transcendental functions) I get the following error > > >>> sqrt(2) > > Traceback (most recent call last): >   File "", line 1, in > NameError: name 's

Re: Total Python Noob

2008-10-09 Thread Chris Rebert
On Thu, Oct 9, 2008 at 11:22 PM, Tom Lake <[EMAIL PROTECTED]> wrote: > I have Python 2.6 installed on Vista Ultimate. When I try to calculate > sqrt (or any transcendental functions) I get the following error > sqrt(2) > > Traceback (most recent call last): > File "", line 1, in > NameError

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
> I'm not a developer, just a lowly end user. I'm not in > a position to be able to fix anything. All I can do is > report it and if it's legitimate, then hopefully someone > who knows what he's doing will fix it. Ok. It's then still unfortunate that nobody reported the problem; your message to co

Total Python Noob

2008-10-09 Thread Tom Lake
I have Python 2.6 installed on Vista Ultimate. When I try to calculate sqrt (or any transcendental functions) I get the following error sqrt(2) Traceback (most recent call last): File "", line 1, in NameError: name 'sqrt' is not defined What am I doing wrong? Tom Lake -- http://mail.pyth

urlparse import Faillure

2008-10-09 Thread Robert Hancock
Python 2.5.2 (r252:60911, Aug 28 2008, 23:51:17) [GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import CGIHTTPServer Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.5/CGIHTTPServer.

Re: Problem with cPickle and cElementTree

2008-10-09 Thread Stefan Behnel
Barry wrote: > I recently tried switching from ElementTree to cElementTree. My > application parses a collection of large XML files and creates indexes > based on certain attributes. This entire collection is saved as an > instance of my Database class. Using ElementTree and cPickle has > allowe

This can't get more amazing see for yourself! http://tardis-db.co.uk/

2008-10-09 Thread Wonderluder
This can't get more amazing see for yourself! http://tardis-db.co.uk/ -- http://mail.python.org/mailman/listinfo/python-list

!!!!...Hi Hi Hi

2008-10-09 Thread the great win
Hi My name is fatima I’ve seen many places of the world on TV screen and few that I’ve visited either for fun or/and business As you know when we travel we meet a lot of different cultures and people, I found in many places I’ve been to; that people stereotyped Islam (that's my religion) they p

epoll socket server

2008-10-09 Thread James Mills
Does anyone have any simple examples of using Python 2.6/3.0's epoll with a simpler socket (tcp) server ? Thanks, cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: new package posix_ipc 0.1 available

2008-10-09 Thread Philip Semanchuk
The package posix_ipc provides a Python interface to POSIX shared memory and named semaphores on platforms that support them (i.e. most Unices). Platform details, source code, sample code and usage instructions are provided at the link below. This package is GPLed. http://semanchuk.com/phil

Re: Python HTML parser chokes on UTF-8 input

2008-10-09 Thread Terry Reedy
Johannes Bauer wrote: Terry Reedy schrieb: Johannes Bauer wrote: Hello group, I'm trying to use a htmllib.HTMLParser derivate class to parse a website which I fetched via httplib.HTTPConnection().request().getresponse().read(). Now the problem is: As soon as I pass the htmllib.HTMLParser UTF-8

Excuse me Would you stop for a moment?!

2008-10-09 Thread the . great . win . aljana
Excuse me!! Would you stop for a moment?! O...man...Haven't you thought-one day- about yourself ? Who has made it? Have you seen a design which hasn't a designer ?! Have you seen a wonderful,delicate work without a worker ?! It's you and the whole universe!.. Who has made them all ?!! You know who

Twelve Proofs that Muhammad is a True Prophet

2008-10-09 Thread the . great . win . aljana
My brothers and sisters everywhere! With this essay, I am not singling out the adherents of Islam - to which I ascribe - but rather I am writing this essay to every man and woman throughout the whole world. I ask Allah that He facilitates tat this essay reaches every ear, falls under the sight of

!!! ...YOU MUST KNOW THIS MAN

2008-10-09 Thread the . great . win . aljana
In The Name Of Allaah, Most Gracious, Most Merciful YOU MUST KNOW THIS MAN MUHAMMAD (May peace and blessings of God Almighty be upon him) You may be an atheist or an agnostic; or you may belong to anyone of the religious denominations that exist in the world today. You may be a Communist or a bel

Crunchy 1.0 alpha 1 released

2008-10-09 Thread André
Hi everyone, Crunchy version 1.0 alpha 1 has been released. Crunchy is an application that transforms normally static Python tutorial (html files, or reStructuredText ones - if docutils is installed on your computer) into interactive sessions within your browser (Firefox). It is available from h

Re: About print exception message

2008-10-09 Thread WaterWalk
On Oct 9, 9:46 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Thu, 9 Oct 2008 06:37:04 -0700 (PDT), WaterWalk <[EMAIL PROTECTED]> wrote: > >Until Python 2.5, the exception object still uses ansi string.  Thus, > >in the following example: > > >f = open(u"\u6d4b.log") > > >Suppose the file

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Craig Allen
as a 20 year observer of microsoft, I have to say this is not amazing at all... and I do not mean that as a random put down of Microsoft. Microsoft often develops things in response to demand... but they don't always fit in their system well, and thus are not really used in the spirit of the demand

Re: Python HTML parser chokes on UTF-8 input

2008-10-09 Thread Jerry Hill
On Thu, Oct 9, 2008 at 4:54 PM, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Hello group, > > Now when I take "website" directly from the parser, everything is fine. > However I want to do some modifications before I parse it, namely UTF-8 > modifications in the style: > > website = website.replace(

Re: On the indexing order in (numpy) arrays

2008-10-09 Thread Robert Kern
Almar Klein wrote: Basically, we want a[i][j] == a[i,j]. Since there is no literal syntax for numpy arrays, we need to be able to convert from a sequence of sequences to an array. The indexing needs to correspond between the two. Thanks for the reply. I guess that explains th

Re: subdirectories for sys.path import?

2008-10-09 Thread mh
[EMAIL PROTECTED] wrote: > Is there a way to import a module from one of these subdirectories? > Any other more pythonic ways to approach the situation? ah, the magic of __init__.py. Thanks all! -- Mark Harrison Pixar Animation Studios -- http://mail.python.org/mailman/listinfo/python-list

subdirectories for sys.path import?

2008-10-09 Thread mh
I'm currently sharing a directory on sys.path with another group. We don't have the option to modify sys.path. In order to reduce conflicts between the two group's code, installation procedures, etc, I'd like to make a subdirectory for each group, and have each group manage their own subdirectory

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Mensanator
On Oct 9, 5:48 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > I posted a problem with Vista on Jul 6 concerning not being > > able to run IDLE in 2.6b1. No replies. > > Where did you post that? On python-dev? No, right here on comp.lang.python. I don't even know what you're referring to. >

Re: Inefficient summing

2008-10-09 Thread beginner
On Oct 9, 3:53 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > beginner <[EMAIL PROTECTED]> writes: > > Hi All, > > > I have a list of records like below: > > > rec=[{"F1":1, "F2":2}, {"F1":3, "F2":4} ] > > > Now I want to write code to find out the ratio of the sums of the two > > fields. > >

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Thorsten Kampe
* "Martin v. Löwis" (Thu, 09 Oct 2008 23:41:44 +0200) > > You can believe what you want. The people who developed UAC don't > > have to support it. > > I know for a fact that the implementation is incomplete. In Windows > Installer, there is no way (that I know of) to create an MSI file > that con

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
> I posted a problem with Vista on Jul 6 concerning not being > able to run IDLE in 2.6b1. No replies. Where did you post that? On python-dev? > What am I supposed to do? File bug reports on things > I don't even know are bugs? You mean, it might have been intentional that IDLE won't run on Vist

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Mensanator
On Oct 9, 4:41 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > You can believe what you want. The people who developed UAC don't have > > to support it. > > I know for a fact that the implementation is incomplete. In Windows > Installer, there is no way (that I know of) to create an MSI file >

Re: Python HTML parser chokes on UTF-8 input

2008-10-09 Thread Johannes Bauer
Terry Reedy schrieb: > Johannes Bauer wrote: >> Hello group, >> >> I'm trying to use a htmllib.HTMLParser derivate class to parse a website >> which I fetched via >> httplib.HTTPConnection().request().getresponse().read(). Now the problem >> is: As soon as I pass the htmllib.HTMLParser UTF-8 code,

Re: Traceback not going all the way to the exception?

2008-10-09 Thread sert
sert <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > It's on Python 2.6. > On Windows. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Thorsten Kampe
* "Martin v. Löwis" (Thu, 09 Oct 2008 23:32:42 +0200) > >> I say, ignore this advice and disable UAC. > > Fine. Can you then see to it that this is mentioned on the Python > > download page? > > I think Thorsten's advice is helpful (in the sense that it solves the > problem, and is IMO pragmatic a

Re: Python HTML parser chokes on UTF-8 input

2008-10-09 Thread Terry Reedy
Johannes Bauer wrote: Hello group, I'm trying to use a htmllib.HTMLParser derivate class to parse a website which I fetched via httplib.HTTPConnection().request().getresponse().read(). Now the problem is: As soon as I pass the htmllib.HTMLParser UTF-8 code, it chokes. The code is something like

Re: template strings for matching?

2008-10-09 Thread MRAB
On Oct 9, 5:20 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > Wow, this was harder than I thought (at least for a rusty Pythoneer   > like myself).  Here's my stab at an implementation.  Remember, the   > goal is to add a "match" method to Template which works like   > Template.substitute, but in reve

Re: python 3: sorting with a comparison function

2008-10-09 Thread Terry Reedy
Thomas Heller wrote: Does Python 3 have no way anymore to sort with a comparison function? Both [].sort() and sorted() seem to accept only 'key' and 'reverse' arguments, the 'cmp' argument seems to be gone. Can that be? Yes. When this was discussed, no one could come up with an actual use c

Re: Traceback not going all the way to the exception?

2008-10-09 Thread sert
Terry Reedy <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > You forgot to specify which version of Python on which > computer system. > It's on Python 2.6. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
> You can believe what you want. The people who developed UAC don't have > to support it. I know for a fact that the implementation is incomplete. In Windows Installer, there is no way (that I know of) to create an MSI file that conditionally turns on UAC, only when the installation actually need

Re: On the indexing order in (numpy) arrays

2008-10-09 Thread Almar Klein
> Basically, we want a[i][j] == a[i,j]. Since there is no literal syntax for > numpy arrays, we need to be able to convert from a sequence of sequences to > an array. The indexing needs to correspond between the two. > Thanks for the reply. I guess that explains the *why*... Adopt the numpy orde

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Martin v. Löwis
>> I say, ignore this advice and disable UAC. > > Fine. Can you then see to it that this is mentioned on the Python > download page? I think Thorsten's advice is helpful (in the sense that it solves the problem, and is IMO pragmatic also), but I *still* wouldn't put it on the Python download page

Re: inspect bug

2008-10-09 Thread Terry Reedy
Aaron "Castironpi" Brady wrote: On Oct 9, 9:47 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Thu, 09 Oct 2008 00:24:20 -0300, Aaron "Castironpi" Brady <[EMAIL PROTECTED]> escribió: Found this bug. It's in 2.6, too bad. Posting here is not going to help much, it just will be lost. Wo

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Jerry Hill
On Thu, Oct 9, 2008 at 3:48 PM, Mensanator <[EMAIL PROTECTED]> wrote: > Fine. Can you then see to it that this is mentioned on the Python > download page? I'm not sure if anyone has mentioned it in all of the invective, but the right thing to do is to report a bug on http://bugs.python.org. If the

Re: On the indexing order in (numpy) arrays

2008-10-09 Thread Terry Reedy
Almar Klein wrote: Hi, I was wondering... Say we have a np.ndarray A of two dimensions (a grayscale image for example). If we want to access x:2, y:3, we have to do A[3,2]. Why is the order of x and y reversed? Because images are stored by rows, not by columns. So column 3, row 2, is row

Python HTML parser chokes on UTF-8 input

2008-10-09 Thread Johannes Bauer
Hello group, I'm trying to use a htmllib.HTMLParser derivate class to parse a website which I fetched via httplib.HTTPConnection().request().getresponse().read(). Now the problem is: As soon as I pass the htmllib.HTMLParser UTF-8 code, it chokes. The code is something like this: prs = self.parser

Re: Can anyone Pythonize this lexical algorithm?

2008-10-09 Thread Terry Reedy
ShashiGowda wrote: I am writing a package manager and stuck unable to write the version sorting function the algorithm is here http://www.linux.gr/cgi-bin/man/man2html?deb-version+5 and all other info is also in it please tell me how to do lexical comparision in python it'll be cool if you just

Re: Inefficient summing

2008-10-09 Thread Alexander Schmolck
beginner <[EMAIL PROTECTED]> writes: > Hi All, > > I have a list of records like below: > > rec=[{"F1":1, "F2":2}, {"F1":3, "F2":4} ] > > Now I want to write code to find out the ratio of the sums of the two > fields. > > One thing I can do is: > > sum(r["F1"] for r in rec)/sum(r["F2"] for r in re

Re: FLexible formatted text involving nested lists?

2008-10-09 Thread Kerri Reno
Ross, I'm no expert in python, so excuse me if this is inane. What I would do is have fmts be a dictionary where fmts = { 3 = 'oats %0d kilos over %0d days with %0d workers', 2 = 'barley %0d lbs for %0d hours', 1 = 'apples %0d baskets'} then something like for x in bigList:

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread Terry Reedy
Paul Rubin wrote: Lie Ryan <[EMAIL PROTECTED]> writes: in python 2.6, ast.literal_eval may be used to replace eval() for literals. What happens on literal_eval('[1]*9') ? Easy to try. Since it is not a literal or display, ValueError: malformed string, just as with set({1,2,3]) >>>

Re: book recommendation for Python newbie?

2008-10-09 Thread Mike Driscoll
On Oct 9, 3:00 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > I'm trying to (gently) convince my business partner that we should be   > adding Python to our core toolset.  He's never used it before, apart   > from poking around in the tutorial a bit at my urging.  But he's got a   > birthday coming up

Re: python 3: sorting with a comparison function

2008-10-09 Thread bearophileHUGS
Thomas Heller: > the 'cmp' argument seems to be gone. Can that be? Yes, that's a wonderful thing, because from the code I see around 99.9% of people see the cmp and just use it, totally ignoring the presence of the 'key' argument, that allows better and shorter solutions of the sorting problem. S

FLexible formatted text involving nested lists?

2008-10-09 Thread RossRGK
I'm having trouble getting my head around a solution for a situation where I need to flexibly format some text with a varying number of embedded fields. Here's a simplified description of my challenge... I have a list of lists called bigList: bigList = [ little, small, tiny] The sub-lists ha

Re: no unbound methods in py3k

2008-10-09 Thread Thomas Heller
Christian Heimes schrieb: > Thomas Heller wrote: >> Ok, so one has to write an extension to access or expose it. >> >> Oh, wait - there's ctypes: > > I wrote the type to help the Pyrex and Cython developers to port their > software to 3.0. I planed to expose the type as > __builtin__.instanceme

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-09 Thread Derek Martin
On Tue, Oct 07, 2008 at 05:43:41PM -0700, Samuel A. Falvo II wrote: > p = subprocess.Popen( > command, > shell=True, > stdin=subprocess.PIPE, > stdout=subprocess.PIPE, > stderr=subprocess.STDOUT, > close_fds=True > ) > > outputChannel = p

book recommendation for Python newbie?

2008-10-09 Thread Joe Strout
I'm trying to (gently) convince my business partner that we should be adding Python to our core toolset. He's never used it before, apart from poking around in the tutorial a bit at my urging. But he's got a birthday coming up, and I'd like to get him a book that will help him make the tr

Re: Can anyone Pythonize this lexical algorithm?

2008-10-09 Thread Paul McGuire
On Oct 9, 7:29 am, ShashiGowda <[EMAIL PROTECTED]> wrote: > I am writing a package manager and stuck unable to write the version > sorting function the algorithm is > herehttp://www.linux.gr/cgi-bin/man/man2html?deb-version+5 > and all other info is also in it please tell me how to do lexical > co

Re: no unbound methods in py3k

2008-10-09 Thread Christian Heimes
Thomas Heller wrote: Ok, so one has to write an extension to access or expose it. Oh, wait - there's ctypes: I wrote the type to help the Pyrex and Cython developers to port their software to 3.0. I planed to expose the type as __builtin__.instancemethod but forgot it. Maybe we can convince

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Mensanator
On Oct 9, 2:09 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * Mensanator (Thu, 9 Oct 2008 11:03:45 -0700 (PDT)) > > > > > > > On Oct 9, 12:36 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > * Mensanator (Tue, 7 Oct 2008 10:58:24 -0700 (PDT)) > > > > On Oct 7, 12:40 pm, Thorsten Kampe <[EMAIL

Re: On the indexing order in (numpy) arrays

2008-10-09 Thread Robert Kern
Almar Klein wrote: Hi, I was wondering... Say we have a np.ndarray A of two dimensions (a grayscale image for example). If we want to access x:2, y:3, we have to do A[3,2]. Why is the order of x and y reversed? This is reversed in Matlab too, because Matlab is a matrix package and matrix a

Re: no unbound methods in py3k

2008-10-09 Thread Thomas Heller
Terry Reedy schrieb: > Thomas Heller wrote: >> Christian Heimes schrieb: >>> I've written PyInstanceMethod_Type for this use case. It's not (yet) >>> available for Python code.>> Oh, wait - there's ctypes: >> >> Python 3.0rc1 (r30rc1:66507, Sep 18 2008, 14:47:08) [MSC v.1500 32 bit >> (Intel)] o

python 3: sorting with a comparison function

2008-10-09 Thread Thomas Heller
Does Python 3 have no way anymore to sort with a comparison function? Both [].sort() and sorted() seem to accept only 'key' and 'reverse' arguments, the 'cmp' argument seems to be gone. Can that be? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Traceback not going all the way to the exception?

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 3:27 am, sert <[EMAIL PROTECTED]> wrote: > I just got an exception and the traceback wouldn't go all the > way to the statement that threw the exception. I found that out > by using the debugger. > > Contrast the traceback: > > http://tinyurl.com/5xglde > > with the debugger output (notic

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Thorsten Kampe
* Mensanator (Thu, 9 Oct 2008 11:03:45 -0700 (PDT)) > On Oct 9, 12:36 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > * Mensanator (Tue, 7 Oct 2008 10:58:24 -0700 (PDT)) > > > On Oct 7, 12:40 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > > * Lawrence D'Oliveiro (Mon, 06 Oct 2008 23:18:10 +1

Problem with cPickle and cElementTree

2008-10-09 Thread Barry
I recently tried switching from ElementTree to cElementTree. My application parses a collection of large XML files and creates indexes based on certain attributes. This entire collection is saved as an instance of my Database class. Using ElementTree and cPickle has allowed me to save these inst

Re: no unbound methods in py3k

2008-10-09 Thread Terry Reedy
Thomas Heller wrote: Christian Heimes schrieb: Thomas Heller wrote: but this is very ugly, imo. Is there another way? The raw_func instances that I have are not descriptors (they do not implement a __get__() method...) I've written PyInstanceMethod_Type for this use case. It's not (yet) avail

Re: Traceback not going all the way to the exception?

2008-10-09 Thread Terry Reedy
sert wrote: I just got an exception and the traceback wouldn't go all the way to the statement that threw the exception. I found that out by using the debugger. Contrast the traceback: http://tinyurl.com/5xglde with the debugger output (notice the arrow pointing to the last statement the tr

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 1:44 pm, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Oct 9, 9:01 am, Paul Rubin wrote: > > > Lie Ryan <[EMAIL PROTECTED]> writes: > > > in python 2.6, ast.literal_eval may be used to replace eval() for > > > literals. > > > What happens on literal_eval('[1]*9

Re: inspect feature

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 3:48 am, Bruno Desthuilliers wrote: > Aaron "Castironpi" Brady a écrit : > > > > > Hello, > > > The 'inspect' module has this method: > > > inspect.getargvalues(frame) > > > It takes a frame and returns the parameters used to call it, including > > the locals as defined in the frame, as

Re: Inefficient summing

2008-10-09 Thread Terry Reedy
Matt Nordhoff wrote: Chris Rebert wrote: I personally would probably do: from collections import defaultdict label2sum = defaultdict(lambda: 0) FWIW, you can just use: label2sum = defaultdict(int) You don't need a lambda. Indeed, in this case, with two known keys, the defaultdict is not

Re: NameError question - def(self,master) - master not in namespace within class?

2008-10-09 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : bieffe, please, learn to snip irrelevant material... On 9 Ott, 17:43, harijay <[EMAIL PROTECTED]> wrote: (snip) NameError: name 'master' is not defined" (snip) #File runner.py #!/usr/bin/python import master import child if __name__=="__main__": print

Re: default value in __init__

2008-10-09 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, kenneth <[EMAIL PROTECTED]> wrote: > On Oct 9, 10:14 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > > kenneth wrote: > > > the 'd' variable already contains the 'self.d' value of the first > > > instance and not the default argument {}. > > > > > Am I doing som

Re: inspect bug

2008-10-09 Thread Aaron "Castironpi" Brady
On Oct 9, 9:47 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 09 Oct 2008 00:24:20 -0300, Aaron "Castironpi" Brady   > <[EMAIL PROTECTED]> escribió: > > > Found this bug.  It's in 2.6, too bad. > > Posting here is not going to help much, it just will be lost. Would be   > better to fi

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread Jason Scheirer
On Oct 9, 9:01 am, Paul Rubin wrote: > Lie Ryan <[EMAIL PROTECTED]> writes: > > in python 2.6, ast.literal_eval may be used to replace eval() for > > literals. > > What happens on literal_eval('[1]*9') ? The documentation clearly states that it will fail to evalu

Re: default value in __init__

2008-10-09 Thread Bruno Desthuilliers
kenneth a écrit : On Oct 9, 10:14 am, Christian Heimes <[EMAIL PROTECTED]> wrote: kenneth wrote: the 'd' variable already contains the 'self.d' value of the first instance and not the default argument {}. Am I doing some stupid error, or this is a problem ? No, it always contains the default a

Re: How to do regular BASH work in Python?

2008-10-09 Thread Chris Rebert
You might also be interested in the 'shutil' module: http://docs.python.org/library/shutil.html#module-shutil Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com On Thu, Oct 9, 2008 at 7:13 AM, Frantisek Malina <[EMAIL PROTECTED]> wrote: > Hey, > I found it. Python rocks: > htt

Re: A question about funcation parameter and self defined object

2008-10-09 Thread Wei Guo
Hi Terry, Thanks for your reply. But the reason I want to have that is for not changing the functions which already based on translation functions. If there is any idea how to bring parameter in static method, that will be great. Wei On Wed, Oct 8, 2008 at 8:24 PM, Terry Reedy <[EMAIL PROTECTED]

Re: Efficient Bit addressing in Python.

2008-10-09 Thread Mensanator
On Oct 9, 5:30 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Is there a canonical way to address the bits in a structure > like an array or string or struct? > > Or alternatively, is there a good way to combine eight > ints that represent bits into one of the bytes in some > array or string

paramiko and stackless

2008-10-09 Thread Linnorm
I've written a port forwarding wrapper with paramiko for an app we use and it works fine except that it consumes way too much processor. (i.e. 25% +) I'm trying to write a stackless-based server class to replace the threading one but I can't get the tunnel the wrapper creates to work for more than

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Mensanator
On Oct 9, 12:36 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * Mensanator (Tue, 7 Oct 2008 10:58:24 -0700 (PDT)) > > > > > > > On Oct 7, 12:40 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > * Lawrence D'Oliveiro (Mon, 06 Oct 2008 23:18:10 +1300) > > > > In message <[EMAIL PROTECTED]>, Thors

Get High on Rave Pills

2008-10-09 Thread easta01
Many pills in the market today like Ecstasy are popular at rave parties. These pills though effective in giving you a kick can also be risky to consume & possess. Reactions to these drugs include teeth gritting, nausea, hazy vision, chills, spasms & sweating. Increased heart rate & high BP levels a

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Thorsten Kampe
* Mensanator (Tue, 7 Oct 2008 10:58:24 -0700 (PDT)) > On Oct 7, 12:40 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > * Lawrence D'Oliveiro (Mon, 06 Oct 2008 23:18:10 +1300) > > > In message <[EMAIL PROTECTED]>, Thorsten Kampe > > > wrote: > > > > * Lawrence D'Oliveiro (Sun, 05 Oct 2008 22:13:46

Re: Python 2.6, GUI not working on vista?

2008-10-09 Thread Thorsten Kampe
* Lawrence D'Oliveiro (Wed, 08 Oct 2008 10:47:54 +1300) > In message <[EMAIL PROTECTED]>, Thorsten > Kampe wrote: > > * Lawrence D'Oliveiro (Mon, 06 Oct 2008 23:18:10 +1300) > >> In message <[EMAIL PROTECTED]>, Thorsten > >> Kampe wrote: > >>> * Lawrence D'Oliveiro (Sun, 05 Oct 2008 22:13:46 +1300)

Re: Pr. Euler 18, recursion problem

2008-10-09 Thread Lie Ryan
On Mon, 06 Oct 2008 00:14:37 -0700, process wrote: > On Oct 6, 8:13 am, Aidan <[EMAIL PROTECTED]> wrote: >> process wrote: >> > I am trying to solve project euler problem 18 with brute force(I will >> > move on to a better solution after I have done that for problem 67). >> >http://projecteuler.ne

Re: utf-8 read/write file

2008-10-09 Thread gigs
Kent Johnson wrote: On Oct 8, 5:55 pm, gigs <[EMAIL PROTECTED]> wrote: Benjamin wrote: On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: Hi! I have big .txt file which i want to read, process and write to another .txt file. I have done script for that, but im having problem with croatian c

Re: Access to Google Calendar

2008-10-09 Thread Joshua Kugler
pepitovadecurt wrote: > Hi I need to access to the Google Calendar under python. > Is posible? You mean this? http://code.google.com/apis/calendar/developers_guide_python.html j -- http://mail.python.org/mailman/listinfo/python-list

How to delete readonly and hidden files & directories on windows xp?

2008-10-09 Thread dudeja . rajat
Hi, I'm using Windows XP and I'm looking for way out to remove .svn folders from my directory. But I'm unable to do that. Does any one one has written any script for removing the hidden / readonly files or directories? Regards, Rajat -- http://mail.python.org/mailman/listinfo/python-list

Re: split a list based on a predicate

2008-10-09 Thread Rajanikanth Jammalamadaka
Thanks for all of your replies. Rajanikanth On Wed, Oct 8, 2008 at 11:59 PM, beginner <[EMAIL PROTECTED]> wrote: > Hi, > > On Oct 8, 6:36 pm, "Rajanikanth Jammalamadaka" <[EMAIL PROTECTED]> > wrote: >> Hi! >> >> Is there a functional way to do this? >> >> I have an array [0,1,2,3,0,1,2,2,3] and I

Re: How to do regular BASH work in Python?

2008-10-09 Thread Frank Malina @ vizualbod.com
On Oct 9, 3:22 pm, jdd <[EMAIL PROTECTED]> wrote: > On Oct 9, 10:13 am, Frantisek Malina <[EMAIL PROTECTED]> wrote: > > > Hey, > > I found it. Python > > rocks:http://www.python.org/doc/2.5.2/lib/os-file-dir.html > > > If you have any further links that provide some lively code examples > > and re

Re: template strings for matching?

2008-10-09 Thread Joe Strout
Wow, this was harder than I thought (at least for a rusty Pythoneer like myself). Here's my stab at an implementation. Remember, the goal is to add a "match" method to Template which works like Template.substitute, but in reverse: given a string, if that string matches the template, then

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread harijay
Thanks Jerry and beiff , Jerry was right, it was an indent problem . Between using my text editor and running from commandline something went out of sync and I didnt catch it probably. I can now reproduce the error with a bad ident . These are my first posts to comp.lang.python..and I am very grat

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread harijay
Thanks beiff for your prompt reply - But I shouldnt need to import master in child. Actually and very strangely. The problem fixed itself without any change to my code. I dont understand how. It may have been a problem with a bad *.pyc lingering around . But now I cannot get the old NameError to r

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread Jerry Hill
On Thu, Oct 9, 2008 at 11:43 AM, harijay <[EMAIL PROTECTED]> wrote: > Hi I am new to writing module and object oriented python code. I am > trying to understand namespaces and classes in python. > > I have the following test case given in three files runner , master > and child. I am getting an err

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread Paul Rubin
Lie Ryan <[EMAIL PROTECTED]> writes: > in python 2.6, ast.literal_eval may be used to replace eval() for > literals. What happens on literal_eval('[1]*9') ? -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError question - def(self, master) - master not in namespace within class?

2008-10-09 Thread bieffe62
On 9 Ott, 17:43, harijay <[EMAIL PROTECTED]> wrote: > Hi I am new to writing module and object oriented python code. I am > trying to understand namespaces and classes in python. > > I have the following test case given in three files runner , master > and child. I am getting an error within child

Re: Efficient Bit addressing in Python.

2008-10-09 Thread George Sakkis
On Oct 9, 6:30 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Is there a canonical way to address the bits in a structure > like an array or string or struct? I don't know of a canonical way (bit hacking is not really common in Python) but pehaps BitPacket [1] comes close to what you're af

NameError question - def(self,master) - master not in namespace within class?

2008-10-09 Thread harijay
Hi I am new to writing module and object oriented python code. I am trying to understand namespaces and classes in python. I have the following test case given in three files runner , master and child. I am getting an error within child where in one line it understands variable master.name and in

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread Lie Ryan
On Thu, 09 Oct 2008 13:26:17 +0100, Orestis Markou wrote: > The ast module in 2.6 has something... > in python 2.6, ast.literal_eval may be used to replace eval() for literals. It does not accepts statements and function calls, i.e.: >>> a = set([1, 2, 3]) >>> repr(a) set([1, 2, 3]) >>> ast.li

Re: Efficient Bit addressing in Python.

2008-10-09 Thread Lie Ryan
On Fri, 10 Oct 2008 00:30:18 +0200, Hendrik van Rooyen wrote: > Is there a canonical way to address the bits in a structure like an > array or string or struct? > > Or alternatively, is there a good way to combine eight ints that > represent bits into one of the bytes in some array or string or >

Re: Access to Google Calendar

2008-10-09 Thread Grant Edwards
On 2008-10-08, pepitovadecurt <[EMAIL PROTECTED]> wrote: > Hi I need to access to the Google Calendar under python. Odd. You'd think somebody who uses Google Calendar would know how to use Google. > Is posible? http://www.google.com/search?q=google+calendar+python First hit. -- Grant Edward

Re: inspect bug

2008-10-09 Thread Gabriel Genellina
En Thu, 09 Oct 2008 00:24:20 -0300, Aaron "Castironpi" Brady <[EMAIL PROTECTED]> escribió: Found this bug. It's in 2.6, too bad. Posting here is not going to help much, it just will be lost. Would be better to file a bug report at http://bugs.python.org/ -- Gabriel Genellina -- http://

Re: template strings for matching?

2008-10-09 Thread skip
Tino> ??? can you elaborate? I don't see the problem. Tino> "%(foo)s" % mapping Joe wants to go in the other direction. Using your example, he wants a function which takes a string and a template string and returns a dict. Here's a concrete example: s = "My dog has fleas" fmt =

  1   2   >