Problem while reading an outlook in box using python.

2008-10-08 Thread venutaurus539
Hello, I was getting an error in Cocreate instance while trying to access Outlook using python script. The python script looks like: from win32com.client import Dispatch session = Dispatch(MAPI.session) session.Logon('OUTLOOK') # MAPI profile name inbox = session.Inbox When

urllib equivalent for HTTP requests

2008-10-08 Thread K
Hello everyone, I understand that urllib and urllib2 serve as really simple page request libraries. I was wondering if there is a library out there that can get the HTTP requests for a given page. Example: URL: http://www.google.com/test.html Something like:

Re: Losing curses decorations.

2008-10-08 Thread Peter Otten
Joe Keen wrote: I'm working on a small curses application that opens an external editor occasionally; in the current case I'm testing its running vi. Once I exit vi and return to the curses application I lose the background color, window frames, and any text I had on the screen before I

Re: Problem while reading an outlook in box using python.

2008-10-08 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hello, I was getting an error in Cocreate instance while trying to access Outlook using python script. The python script looks like: from win32com.client import Dispatch session = Dispatch(MAPI.session) session.Logon('OUTLOOK') # MAPI profile name inbox =

Re: urllib equivalent for HTTP requests

2008-10-08 Thread Diez B. Roggisch
K schrieb: Hello everyone, I understand that urllib and urllib2 serve as really simple page request libraries. I was wondering if there is a library out there that can get the HTTP requests for a given page. Example: URL: http://www.google.com/test.html Something like:

ANN: Solu 0.1 - Office Resource Finder

2008-10-08 Thread Heikki Toivonen
Solu is a simple web application meant for making it easy to find colleagues, meeting rooms and other resources in an office. Great when you are new in a company and don't know where everyone and everything is located in! In other words, Solu is the cubicle finder. And if you have ever configured

Re: ssh problem using paramiko?

2008-10-08 Thread sa6113
I couldn't find any good source for download Openssh on the net? Would you please introduce a URL for download that? Steve Holden-5 wrote: sa6113 wrote: I use this code : import paramiko import socket hostname = 192.168.1.4 username = test port = 22 password = ''123456 # now

Re: Problem while reading an outlook in box using python.

2008-10-08 Thread Tim Golden
[EMAIL PROTECTED] wrote: May I know how to check whether my Outlook is installed with CDO components? There is no entry in my Registry Database with the name MAPI.Session. Well, that pretty much *is* the check. Get hold of your Office install disk and do a reinstall and look out for

Re: Reading from stdin

2008-10-08 Thread Almar Klein
I guess the phrasing hidden read-ahead buffer implies that buffering cannot be turned off (or at least it is not intended to even if it's somehow possible). I think it can be done, but you would have to use a different approach on linux than on windows. Linux requires fcntl (I dont know what

adding text in properties of ms-word

2008-10-08 Thread gita ziabari
I wanna add text in properties of ms-word. Could anyone help me please? Thanks, Gita -- http://mail.python.org/mailman/listinfo/python-list

Upgrading an instance to a subclass

2008-10-08 Thread Antoon Pardon
I have a subclass of socket. class Mysocket (socket): ... But when I use the python library it will of course just return an instance of socket, like the SocketServer module. So now I was wondering if it is somehow possible to turn this instance into a Mysocket instance, either by somehow

Python/Django hosting on normal hosting plans

2008-10-08 Thread david . lyon
Hi All, I have chosen to use a Django app for a customer site and wish to put it up on the net. Before I waste all day trying it myself (and probably getting it wrong) I thought I would ask the experts here. My questions are: - can most everyday vanilla linux web hosts run a django

Socket With QoS

2008-10-08 Thread Hartman Mario Andres
Hi, this my first message on this list. My problem is that I need to create a socket with QoS. I can create a normal socket and transmit data; but now, I need to ensure the transfer rate. If anyone can help me, be grateful. Greetings -- http://mail.python.org/mailman/listinfo/python-list

Re: ssh problem using paramiko?

2008-10-08 Thread Diez B. Roggisch
sa6113 wrote: I couldn't find any good source for download Openssh on the net? Would you please introduce a URL for download that? http://www.vapor.com/amtelnet/ it supports only SSHv1, but I guess that's ok. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread Mark Dickinson
On Oct 7, 5:19 pm, [EMAIL PROTECTED] wrote: but I want to make clear that I think that (0).numbits()==-1 is the natural solution. At least for all square-and-multiply-like algorithms needed in [...] Can you clarify this? Why is -1 the natural solution? I can see a case for 0, for -infinity

Re: several version of eggs

2008-10-08 Thread Sed
On Oct 7, 5:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Sed wrote: you need to easy_install with -m/--multi-version. All of your packages. Unfortunately, this is not even working :( It is. I see !!! thanks !!! the fact is that if you have only one egg of sqlachemy module (for

Re: Upgrading an instance to a subclass

2008-10-08 Thread Orestis Markou
I would suggest rather than inheriting from socket, encapsulate over it: class MySocket(object): def __init__(self, socket): self.socket = socket Then you don't have to worry about patching instances... On Wed, Oct 8, 2008 at 12:54 PM, Antoon Pardon [EMAIL PROTECTED] wrote: I have a

Re: Python pre-release announcements

2008-10-08 Thread Ben Finney
[EMAIL PROTECTED] writes: Ben Is there an appropriate email destination for such patches? You might try [EMAIL PROTECTED] Thank you. -- \ “I put contact lenses in my dog's eyes. They had little | `\ pictures of cats on them. Then I took one out and he ran around |

Re: Reading from stdin

2008-10-08 Thread Luis Zarrabeitia
On Tuesday 07 October 2008 11:27:19 pm George Sakkis wrote: In order to make a for loop the most efficient way of looping over the lines of a file (a very common operation), the next() method uses a hidden read-ahead buffer. As a consequence of using a read-ahead buffer, combining next()

Re: Python/Django hosting on normal hosting plans

2008-10-08 Thread Tim Chase
My questions are: - can most everyday vanilla linux web hosts run a django site ? - can most everyday vanilla linux web hosts run python web scripts? Depends on your definition of most everyday vanilla linux web hosts. :) The bottom-of-the-barrel hosts will often (but not always)

Re: Python pre-release announcements

2008-10-08 Thread skip
Ben Is there an appropriate email destination for such patches? You might try [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to start thread by group?

2008-10-08 Thread bieffe62
On 7 Ott, 06:37, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 06 Oct 2008 11:24:51 -0300, [EMAIL PROTECTED] escribió: On 6 Ott, 15:24, oyster [EMAIL PROTECTED] wrote: my code is not right, can sb give me a hand? thanx for example, I have 1000 urls to be downloaded, but only 5 thread

Re: Problem while reading an outlook in box using python.

2008-10-08 Thread venutaurus539
May I know how to check whether my Outlook is installed with CDO components? There is no entry in my Registry Database with the name MAPI.Session. Thank you, Venu. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem while reading an outlook in box using python.

2008-10-08 Thread venutaurus539
On Oct 8, 2:54 pm, Tim Golden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: May I know how to check whether my Outlook is installed with CDO components? There is no entry in my Registry Database with the name MAPI.Session. Well, that pretty much *is* the check. Get hold of your

Re: Losing curses decorations.

2008-10-08 Thread Joe Keen
On Oct 8, 1:16 am, Peter Otten [EMAIL PROTECTED] wrote: Joe Keen wrote: I'm working on a small curses application that opens an external editor occasionally; in the current case I'm testing its running vi. Once I exit vi and return to the curses application I lose the background color,

How to calculate two time?

2008-10-08 Thread lookon
I have two string like 2007-03-27T08:54:43+08:00 how do I get the hours between these two time(string format)? -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading from stdin

2008-10-08 Thread Jean-Paul Calderone
On Wed, 8 Oct 2008 09:28:55 -0400, Luis Zarrabeitia [EMAIL PROTECTED] wrote: On Tuesday 07 October 2008 11:27:19 pm George Sakkis wrote: In order to make a for loop the most efficient way of looping over the lines of a file (a very common operation), the next() method uses a hidden read-ahead

Re: How to calculate two time?

2008-10-08 Thread skip
lookon I have two string like 2007-03-27T08:54:43+08:00 how do I get lookon the hours between these two time(string format)? Look in PyPI for dateutil, then: import dateutil.parser t1 = dateutil.parser.parse(2007-03-27T08:54:43+08:00) t1 datetime.datetime(2007, 3,

Re: How to calculate two time?

2008-10-08 Thread Jean-Paul Calderone
On Wed, 8 Oct 2008 06:49:10 -0700 (PDT), lookon [EMAIL PROTECTED] wrote: I have two string like 2007-03-27T08:54:43+08:00 how do I get the hours between these two time(string format)? That's ISO 8601 datetime format. You might use epsilon.extime: from epsilon.extime import Time

Accessing the message of Outlook inbox

2008-10-08 Thread venutaurus539
Hi all, How can I access the body of a mail in Outlook Inbox? I tried various options like message.Body or message.Mesg etc. but didn't work. I could get the subject of the mail using message.Subject though. Any help is appreciated. Thanks in advance, Venu --

Re: Race condition when generating .pyc files

2008-10-08 Thread [EMAIL PROTECTED]
I think this is my best option for now - I'm going to give it a shot. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Race condition when generating .pyc files

2008-10-08 Thread [EMAIL PROTECTED]
Ugggh, I'm not using the exact same version everywhere. Of course, the mystery to me is that this just started failing recently, everything has been fine until last week. Anyway, thanks for the info. -- http://mail.python.org/mailman/listinfo/python-list

PIL problem

2008-10-08 Thread bfrederi
I am having a problem using PIL. I am trying to crop and image to a square, starting from the center of the image, but when I try to crop the image, it won't crop. Here are the relevant code snippets: ### Function I am testing ### def create_square_image(file_name): Creates a thumbnail sized

distributing apps without the Python source?

2008-10-08 Thread Joe Strout
We have a client who's paranoid about distributing the Python source to his commercial app. Is there some way I can distribute and use just the .pyc files, so as to not give away the source? Thanks, - Joe -- http://mail.python.org/mailman/listinfo/python-list

Re: ABCs - infix syntax for isinstance() ?

2008-10-08 Thread Boris Borcic
Bruno Desthuilliers wrote: [EMAIL PROTECTED] a écrit : ... A intriguing wider proposition would be to transpose Ruby's notion of Open Classes to Python built-in metaclasses (or just to type itself ?). No, thanks. Even the Ruby guys start to think making evrything open may not be such a good

Re: distributing apps without the Python source?

2008-10-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Oct 2008 09:18:47 -0600, Joe Strout wrote: We have a client who's paranoid about distributing the Python source to his commercial app. Is there some way I can distribute and use just the .pyc files, so as to not give away the source? Yes. Just use the *.pyc files. Ciao,

config errors

2008-10-08 Thread Kathleen Krause-Thompson
Hello, After having setup my dev environment for Plone 3.0, I've been receiving these errors when using apt-get: Errors were encountered while processing: python-setuptools python-paste python-pastedeploy python-pastescript Is there something that needs to be configured? Thanks in advance.

Re: PIL problem

2008-10-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: I am having a problem using PIL. I am trying to crop and image to a square, starting from the center of the image, but when I try to crop the image, it won't crop. Here are the relevant code snippets: ### Function I am testing ### def

Re: PIL problem

2008-10-08 Thread bfrederi
On Oct 8, 10:30 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: I am having a problem using PIL. I am trying to crop and image to a square, starting from the center of the image, but when I try to crop the image, it won't crop. Here

Quality control in open source development

2008-10-08 Thread Dave
With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe Python 2.7 without any approval of anyone at the PSF? Maybe their

Re: Quality control in open source development

2008-10-08 Thread Chris Mellon
On Wed, Oct 8, 2008 at 10:43 AM, Dave [EMAIL PROTECTED] wrote: With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe

Re: Accessing the message of Outlook inbox

2008-10-08 Thread Mike Driscoll
On Oct 8, 9:24 am, [EMAIL PROTECTED] wrote: Hi all,         How can I access the body of a mail in Outlook Inbox? I tried various options like message.Body or message.Mesg etc. but didn't work. I could get the subject of the mail using message.Subject though. Any help is appreciated.

Re: PIL problem

2008-10-08 Thread bfrederi
On Oct 8, 10:39 am, bfrederi [EMAIL PROTECTED] wrote: On Oct 8, 10:30 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: I am having a problem using PIL. I am trying to crop and image to a square, starting from the center of the

Re: PIL problem

2008-10-08 Thread bfrederi
On Oct 8, 10:39 am, bfrederi [EMAIL PROTECTED] wrote: On Oct 8, 10:30 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 08 Oct 2008 08:10:02 -0700, bfrederi wrote: I am having a problem using PIL. I am trying to crop and image to a square, starting from the center of the

Re: PIL problem

2008-10-08 Thread Peter Otten
bfrederi wrote: image.crop((x1,y1,x2,y2)) This doesn't change `image` but creates and returns a new cropped image which you simply ignore. image.save(file_name, JPEG) Ciao, Marc 'BlackJack' Rintsch How do I output it to an actual file then? Or overwrite the existing file?

Re: distributing apps without the Python source?

2008-10-08 Thread skip
Marc On Wed, 08 Oct 2008 09:18:47 -0600, Joe Strout wrote: We have a client who's paranoid about distributing the Python source to his commercial app. Is there some way I can distribute and use just the .pyc files, so as to not give away the source? Marc Yes. Just use

Re: Quality control in open source development

2008-10-08 Thread Peter Otten
Dave wrote: With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe Python 2.7 without any approval of anyone at the

Re: PIL problem

2008-10-08 Thread J Kenneth King
bfrederi [EMAIL PROTECTED] writes: I am having a problem using PIL. I am trying to crop and image to a square, starting from the center of the image, but when I try to crop the image, it won't crop. Here are the relevant code snippets: ### Function I am testing ### def

Job Posting

2008-10-08 Thread Capuano, Rebecca
HI, Would you be able to post this on your site? I don't know if you post jobs. Thanks! Our client in Princeton, NJ is looking for a Python Developer to join its team. Description A small to medium Python project needs a motivated developer to work with the team lead. The position entails

Re: Quality control in open source development

2008-10-08 Thread Christian Heimes
Dave wrote: If licensees can redisribute as they like, isn't this a huge problem? Is this dealt with be restricting use of the Python trademarks? Just curious.. From http://www.python.org/psf/summary/ --- The PSF also holds and protects the trademarks behind the Python programming language.

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread MRAB
On Oct 8, 9:56 am, Mark Dickinson [EMAIL PROTECTED] wrote: On Oct 7, 5:19 pm, [EMAIL PROTECTED] wrote: but I want to make clear that I think that (0).numbits()==-1 is the natural solution. At least for all square-and-multiply-like algorithms needed in [...] Can you clarify this?  Why is

utf-8 read/write file

2008-10-08 Thread Bruno
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 characters (Š,Đ,Ž,Č,Ć). How can I read/write from/to file in utf-8 encoding? I read file with fileinput.input. thanks --

Re: Accessing the message of Outlook inbox

2008-10-08 Thread venutaurus539
On Oct 8, 8:53 pm, Mike Driscoll [EMAIL PROTECTED] wrote: On Oct 8, 9:24 am, [EMAIL PROTECTED] wrote: Hi all,         How can I access the body of a mail in Outlook Inbox? I tried various options like message.Body or message.Mesg etc. but didn't work. I could get the subject of the mail

Apache log munging

2008-10-08 Thread Joe Python
I have a written a generator for an apache log which returns two types of information, hostname and the filename requested. The 'log' generator can be 'consumed' like this: for r in log: print r['host'], r['filename'] I want to find the top '100' hosts (sorted in descending order of total

Re: how to get the thighest bit position in big integers?

2008-10-08 Thread Terry Reedy
MRAB wrote: On Oct 8, 9:56 am, Mark Dickinson [EMAIL PROTECTED] wrote: On Oct 7, 5:19 pm, [EMAIL PROTECTED] wrote: but I want to make clear that I think that (0).numbits()==-1 is the natural solution. At least for all square-and-multiply-like algorithms needed in [...] Can you clarify this?

Python syntax question

2008-10-08 Thread Daniel
I hope this question is OK for this list. I've downloaded Rpyc and placed it in my site packages dir. On some machines it works fine, on others not so much. Here is one error I get when I try to import it: import Rpyc Traceback (most recent call last): File stdin, line 1, in module File

Re: distributing apps without the Python source?

2008-10-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: Marc On Wed, 08 Oct 2008 09:18:47 -0600, Joe Strout wrote: We have a client who's paranoid about distributing the Python source to his commercial app. Is there some way I can distribute and use just the .pyc files, so as to not

Re: Python syntax question

2008-10-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Oct 2008 11:02:49 -0700, Daniel wrote: Here is one error I get when I try to import it: import Rpyc Traceback (most recent call last): File stdin, line 1, in module File C:\Python25\lib\site-packages\Rpyc\__init__.py, line 7, in module from Rpyc.Lib import

Re: Apache log munging

2008-10-08 Thread Joe Riopel
On Wed, Oct 8, 2008 at 1:55 PM, Joe Python [EMAIL PROTECTED] wrote: I want to find the top '100' hosts (sorted in descending order of total requests) like follows: Is there a fast way to this without scanning the log file many times? As you encounter a new host add it to a dict (or another

Re: Upgrading an instance to a subclass

2008-10-08 Thread Terry Reedy
Antoon Pardon wrote: I have a subclass of socket. class Mysocket (socket): ... But when I use the python library it will of course just return an instance of socket, like the SocketServer module. So now I was wondering if it is somehow possible to turn this instance into a Mysocket

Re: Quality control in open source development

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 8:43 am, Dave [EMAIL PROTECTED] wrote: With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe Python 2.7

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

2008-10-08 Thread Samuel A. Falvo II
On Oct 7, 6:23 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: Is your shell script doing something else, apart from invoking the java   process? Obviously, yes. The script is some 150 lines long. But the hang-up occurs because of the forked Java process, not the other lines. If not, you

Re: Quality control in open source development

2008-10-08 Thread Terry Reedy
Dave wrote: With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe Python 2.7 without any approval of anyone at the PSF?

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

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 11:31 am, Samuel A. Falvo II [EMAIL PROTECTED] wrote: I removed the stdin=PIPE argument, and this works.  Many thanks for bringing this to my attention. OK, I am confused. After observing a bug where the code works every other time, like clockwork, I've used strace to figure out what

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

2008-10-08 Thread Sean DiZazzo
On Oct 8, 11:24 am, Samuel A. Falvo II [EMAIL PROTECTED] wrote: On Oct 7, 6:23 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: Is your shell script doing something else, apart from invoking the java   process? Obviously, yes.  The script is some 150 lines long.  But the hang-up occurs

Re: Quality control in open source development

2008-10-08 Thread Tim Chase
I think it's pretty self-evident that it's not a huge problem, don't you? Do you see lots of low quality python forks cluttering up the internet? hardly any...the best python fork I found: http://www.woopit.com/albums/Australian-snakes/GreenPythonSnake.jpg though they look more like tweezers

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

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 11:24 am, Samuel A. Falvo II [EMAIL PROTECTED] wrote: It does not expect input from stdin.  However, this does not affect any OTHER scripts or commands I run. OK, so, I'm very confused as to why this would matter. I removed the stdin=PIPE argument, and this works. Many thanks for

MRO inconsistency: why?

2008-10-08 Thread Ravi
Why the following code gives inconsistent method resolution order error: class X(object): x = 4 def f(self): print 'f in X' print dir(X) X.g(self) def g(self): print 'g in X' class Y(object, X): def

Re: Python syntax question

2008-10-08 Thread Daniel
On Oct 8, 12:07 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Wed, 08 Oct 2008 11:02:49 -0700, Daniel wrote: Here is one error I get when I try to import it: import Rpyc Traceback (most recent call last):   File stdin, line 1, in module   File

Re: Accessing the message of Outlook inbox

2008-10-08 Thread Mike Driscoll
On Oct 8, 12:50 pm, [EMAIL PROTECTED] wrote: On Oct 8, 8:53 pm, Mike Driscoll [EMAIL PROTECTED] wrote: On Oct 8, 9:24 am, [EMAIL PROTECTED] wrote: Hi all,         How can I access the body of a mail in Outlook Inbox? I tried various options like message.Body or message.Mesg etc.

RE: Python syntax question

2008-10-08 Thread Blubaugh, David A.
Sir, I was just wondering that the module that you are utilizing (Rpyc) is a remote process call module for python? Is this what you are developing with at this time? Thanks, David Blubaugh -Original Message- From: Daniel [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08,

Re: MRO inconsistency: why?

2008-10-08 Thread Christian Heimes
Ravi wrote: Why the following code gives inconsistent method resolution order error: [...] Your problem can be reduced to: class A(object): ... pass ... A.__mro__ (class '__main__.A', type 'object') class B(object, A): ... pass ... Traceback (most recent call last): File stdin,

Re: Porn Addiction Solutions?

2008-10-08 Thread mikejanse
On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: Help, I'm addicted to porn. I've been spending a lot of time downloading hardcore porn and masturbating to it. It's ruining my life. I just found out that one of these sites somehow hacked my card and rang up $5K in charges which they won't even

config errors

2008-10-08 Thread Kathleen Krause-Thompson
I've recently setup an environment on Unbuntu for Plone 3.0 that includes Python 2.4. I get the errors below when doing various things with apt-get like 'install python'. Is there some configuration that needs to be done as the message suggests? Thanks in advance. dpkg: error processing

Re: MRO inconsistency: why?

2008-10-08 Thread Terry Reedy
Ravi wrote: Why the following code gives inconsistent method resolution order error: class X(object): x = 4 def f(self): print 'f in X' print dir(X) X.g(self) def g(self): print 'g in X' class Y(object, X): def g(self): print 'g in Y' o = Y() o.f() Calculating a linear MRO from a

Re: Apache log munging

2008-10-08 Thread Joe Python
I am currently using the following technic to get the info above: all = defaultdict(int) hosts = defaultdict(int) filename = defaultdict(int) for r in log: all[r['host'],r['file']] += 1 hosts[r['host']] += 1 filename[r['file']] = 1 for host in sorted(hosts,key=hosts.get,

Re: Job Posting

2008-10-08 Thread Chris Rebert
On Wed, Oct 8, 2008 at 9:20 AM, Capuano, Rebecca [EMAIL PROTECTED] wrote: HI, Would you be able to post this on your site? I don't know if you post jobs. Thanks! This is a general-interest mailinglist about the Python programming language, not a way of directly contacting just the Python.org

no unbound methods in py3k

2008-10-08 Thread Thomas Heller
I'm currently using code like this to create unbound methods from functions and stick them into classes: method = new.instancemethod(raw_func, None, cls) setattr(cls, name, method) Ok, python 2.6, run with the -3 flag, gives a warning that the new module is going away in python 3.0, so the

Re: Quality control in open source development

2008-10-08 Thread Matimus
On Oct 8, 8:43 am, Dave [EMAIL PROTECTED] wrote: With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe Python 2.7

RE: Porn Addiction Solutions?

2008-10-08 Thread Support Desk
I got a solution, cutt it off, and then Kill yourself. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 2:30 PM To: python-list@python.org Subject: Re: Porn Addiction Solutions? On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: Help, I'm

Re: no unbound methods in py3k

2008-10-08 Thread Christian Heimes
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) available for Python code. Barry hasn't decided

Re: Porn Addiction Solutions?

2008-10-08 Thread Dotan Cohen
2008/10/8 Support Desk [EMAIL PROTECTED]: I got a solution, cutt it off, and then Kill yourself. Cut what off? The OP is female. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ä-ö-ü-ß-Ä-Ö-Ü --

Re: no unbound methods in py3k

2008-10-08 Thread Bruno Desthuilliers
Thomas Heller a écrit : I'm currently using code like this to create unbound methods from functions and stick them into classes: method = new.instancemethod(raw_func, None, cls) setattr(cls, name, method) setattr(cls, name, func) would work better - given that either

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
The documentation for the ast module states that it helps to find out programmatically what the current grammar looks like. I can't find any reference (even when reading the code) on how you should go about this, other than checking the sys.version number and reading up on the changes. Not

Re: distributing apps without the Python source?

2008-10-08 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: Marc On Wed, 08 Oct 2008 09:18:47 -0600, Joe Strout wrote: We have a client who's paranoid about distributing the Python source to his commercial app. Is there some way I can distribute and use

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
My confusion starts with the fact that I'm not sure if all Python 2.4 code is going to be syntactically valid 2.6 code. That's not so much a matter of confusion, but of careful research. I *think* all code that is syntactically correct in 2.4 is also syntactically correct in 2.6 - but only

Inefficient summing

2008-10-08 Thread beginner
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 rec) But this is slow because I have to iterate through the list

RE: Porn Addiction Solutions?

2008-10-08 Thread Support Desk
Oh in that case she can email me, I got lots of porn. -Original Message- From: Dotan Cohen [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 3:15 PM To: Support Desk Cc: [EMAIL PROTECTED]; python-list@python.org Subject: Re: Porn Addiction Solutions? 2008/10/8 Support Desk

RE: Porn Addiction Solutions?

2008-10-08 Thread Michael . Coll-Barth
From: Dotan Cohen 2008/10/8 Support Desk [EMAIL PROTECTED]: I got a solution, cutt it off, and then Kill yourself. Cut what off? The OP is female. Are you sure about that? :) The information contained in this message and any attachment may be proprietary,

Re: Inefficient summing

2008-10-08 Thread Bruno Desthuilliers
beginner a écrit : 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 rec) But this is slow because I have to iterate

Re: Inefficient summing

2008-10-08 Thread Chris Rebert
I personally would probably do: from collections import defaultdict label2sum = defaultdict(lambda: 0) for r in rec: for key, value in r.iteritems(): label2sum[key] += value ratio = label2sum[F1] / label2sum[F2] This iterates through each 'r' only once, and (imho) is pretty

Re: Porn Addiction Solutions?

2008-10-08 Thread [EMAIL PROTECTED]
On Oct 8, 12:07 pm, [EMAIL PROTECTED] wrote: Help, I'm addicted to porn. I've been spending a lot of time downloading hardcore porn and masturbating to it. It's ruining my life. I just found out that one of these sites somehow hacked my card and rang up $5K in charges which they won't even

Re: Porn Addiction Solutions?

2008-10-08 Thread Dotan Cohen
2008/10/8 [EMAIL PROTECTED]: I got a solution, cutt it off, and then Kill yourself. Cut what off? The OP is female. Are you sure about that? :) On the internet, nobody knows you're a dog. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il

Re: Inefficient summing

2008-10-08 Thread bearophileHUGS
beginner: I can of course use an old-fashioned loop. This is more readable, but also more verbose. What is the best way, I wonder? In such situation the old loop seems the best solution. Short code is good only when it doesn't make the code too much slow/difficult to understand. Keeping the

Re: Python pre-release announcements

2008-10-08 Thread Benjamin
On Oct 8, 12:42 am, Ben Finney [EMAIL PROTECTED] wrote: Martin v. Löwis [EMAIL PROTECTED] writes: Is there some policy document or release management guide that could be updated for release teams to follow on this without needing to have this discussion every time? It's in PEP 101.

Re: utf-8 read/write file

2008-10-08 Thread Benjamin
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 characters (Š,Đ,Ž,Č,Ć). Can you show us what you have so far? How can I read/write

Re: Quality control in open source development

2008-10-08 Thread Martin v. Löwis
Matimus wrote: Others have made some pretty sound arguments around trademarks and such, but I'm going to simply argue that Python as a community has its own inertia, and it simply isn't a practical to be concerned about a dubious fork. It simply wouldn't take off. I think this is indeed the

Re: distributing apps without the Python source?

2008-10-08 Thread Almar Klein
You could encrypt the sensitive pieces of source code. I'm not an expert in that field, but I know Matlab allows encryption of source code files. Almar 2008/10/8 Bruno Desthuilliers [EMAIL PROTECTED] Marc 'BlackJack' Rintsch a écrit : On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: Marc

Re: distributing apps without the Python source?

2008-10-08 Thread James Mills
On Thu, Oct 9, 2008 at 4:19 AM, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Marc 'BlackJack' Rintsch a écrit : On Wed, 08 Oct 2008 10:59:44 -0500, skip wrote: Though of course there is decompyle to consider, assuming Joe's client is truly paranoid. Simply don't tell the client. All he has

Re: Python syntax question

2008-10-08 Thread Diez B. Roggisch
Blubaugh, David A. schrieb: Sir, I was just wondering that the module that you are utilizing (Rpyc) is a remote process call module for python? Is this what you are developing with at this time? Are you internetically challenged?

  1   2   3   >