Re: TopSort in Python?

2008-01-19 Thread Paddy
On Jan 19, 4:30 pm, duncan smith <[EMAIL PROTECTED]> wrote: > Carl Banks wrote: > > On Jan 18, 7:01 pm, Paddy <[EMAIL PROTECTED]> wrote: > >> On Jan 18, 9:47 pm, [EMAIL PROTECTED] wrote:> Tim, > > >>> Thanks for the topsort code. It would be useful in a project I'm > >>> working on. Can I use the

psyco problem on mac wingide

2008-01-19 Thread Arash Arfaee
Hello All, I have no problem using psyco on python shell on my new Mac, however I cannot import it from WingIDE. I copied psyco directory into mac python folder. Does wingide installs another python shell? Thanks, Arash -- http://mail.python.org/mailman/listinfo/python-list

Memory errors with imaplib

2008-01-19 Thread Martey
Hi everyone, I am trying to use imaplib to download messages, but I keep getting memory errors when I try to download a large message (i.e. one with attachments). Here is my test code (similar to the example in the imaplib documentation): import getpass, imaplib M = imaplib.IMAP4_SSL("imap.gmail

Re: HTTP POST uploading large files

2008-01-19 Thread Gabriel Genellina
En Sat, 19 Jan 2008 21:19:24 -0200, Wolfgang Draxinger <[EMAIL PROTECTED]> escribi�: > I'm thinking about writing a script to upload videos to sites > like YouTube or Google Video, which is usually done by a HTTP > POST. > > The problem is, that videos, by nature are rather big files, > however

Re: Default attribute values pattern

2008-01-19 Thread David Tweet
Ah! nice, thanks, knew I was probably missing something. On Jan 19, 2008 5:01 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Jan 19, 11:02pm, "David Tweet" <[EMAIL PROTECTED]> wrote: > > > def Grab(argdict, key, default): > > """Like argdict.get(key, default), but also deletes key from argdi

Re: Naming a file

2008-01-19 Thread Diez B. Roggisch
Matthias Bläsing schrieb: > Am Sat, 19 Jan 2008 14:14:30 -0800 schrieb snoylr: > >> For example if the variable is 105Markum >> >> What statement do I need to create a file name 105Markum.txt? > > filename_base = '105Markum' > filename = '%s.txt' % filename_base > f = open(filename, 'w') > f.writ

Re: Gui front-end to version control program

2008-01-19 Thread Grant Edwards
On 2008-01-20, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Sat, 19 Jan 2008 17:15:21 -0200, David Delony <[EMAIL PROTECTED]> > escribi?: > >> I want something that can work with any file, as Subversion does. I can't >> think of any >> GUI wrappers written in Python off the top of my head. I

Re: Gui front-end to version control program

2008-01-19 Thread Neal Becker
David Delony wrote: > I spoke with Eric S. Raymond at a Linux user's group meeting a few days > ago about the need for version control for end users. > I thought that Python might be a good candidate for this. > > Luckily, Guido was there as well. I talked this over with him and he > suggested us

Re: Gui front-end to version control program

2008-01-19 Thread Gabriel Genellina
En Sat, 19 Jan 2008 17:15:21 -0200, David Delony <[EMAIL PROTECTED]> escribi�: > I want something that can work with any file, as Subversion does. I can't > think of any > GUI wrappers written in Python off the top of my head. I would like to There exist TortoiseCVS and TortoiseSVN. They are ve

How to get the user/group name from uid/gid in python ?

2008-01-19 Thread raocheng
We know that we can get process or file's uid/gid in python. For example: $ python >>> import os >>> os.getuid() 1516 >>> os.getgid() 102 >>> os.geteuid() 1516 >>> os.getegid() 102 >>> os.getgroups() [102, 600] >>> $ python >>> import os,stat >>> uid = os.stat("./file1")[stat.ST_UID] >>> gid = os

Re: Default attribute values pattern

2008-01-19 Thread Arnaud Delobelle
On Jan 19, 11:02 pm, "David Tweet" <[EMAIL PROTECTED]> wrote: > def Grab(argdict, key, default): >   """Like argdict.get(key, default), but also deletes key from argdict.""" >   if key in argdict: >     retval = argdict["key"] >     del(argdict[key]) >   else: >     retval = default >   return ret

Re: Python 3000 and import __hello__

2008-01-19 Thread ajaksu
On Jan 19, 7:54 pm, Brad <[EMAIL PROTECTED]> wrote: > Just playing around with Python3000 a2 release on Windows XP 32-bit x86. > > import __hello__ > > doesn't print 'hello world...' as it does on 2.5 Thanks for spoiling this easter egg for me! ;) -- http://mail.python.org/mailman/listinfo/p

HTTP POST uploading large files

2008-01-19 Thread Wolfgang Draxinger
I'm thinking about writing a script to upload videos to sites like YouTube or Google Video, which is usually done by a HTTP POST. The problem is, that videos, by nature are rather big files, however urllib2 wants it's Request objects being prepared beforehand, which would mean to first load the wh

Re: Python 3000 and import __hello__

2008-01-19 Thread Christian Heimes
Brad wrote: > Just playing around with Python3000 a2 release on Windows XP 32-bit x86. > > import __hello__ > > doesn't print 'hello world...' as it does on 2.5 > > The import doesn't fail or generate errors... just no output. Perhaps > this is by design? I changed the __hello__ frozen module

Re: Default attribute values pattern

2008-01-19 Thread David Tweet
Hello, Seems to me that setattrs sort of assumes that you want to have all your initialization arguments set as attributes of the same name. I would think you'd sometimes want to be able to process the extra arguments inside of each __init__, assign them to attributes with different names, etc.

Re: Naming a file

2008-01-19 Thread Matthias Bläsing
Am Sat, 19 Jan 2008 14:14:30 -0800 schrieb snoylr: > For example if the variable is 105Markum > > What statement do I need to create a file name 105Markum.txt? filename_base = '105Markum' filename = '%s.txt' % filename_base f = open(filename, 'w') f.write(http://mail.python.org/mailman/listinfo/

Naming a file

2008-01-19 Thread snoylr
I have a variable called filename How do I create a file using the filename variable as the name of the file? For example if the variable is 105Markum What statement do I need to create a file name 105Markum.txt? -- http://mail.python.org/mailman/listinfo/python-list

Python 3000 and import __hello__

2008-01-19 Thread Brad
Just playing around with Python3000 a2 release on Windows XP 32-bit x86. import __hello__ doesn't print 'hello world...' as it does on 2.5 The import doesn't fail or generate errors... just no output. Perhaps this is by design? Brad -- http://mail.python.org/mailman/listinfo/python-list

Re: finding memory leak in edgewall trac 0.11

2008-01-19 Thread Christian Heimes
Jeroen Ruigrok van der Werven wrote: > Hi Christian, > > -On [20080119 16:16], Christian Heimes ([EMAIL PROTECTED]) wrote: >> I forgot one important point in my reply. The GC module contains some >> useful methods for debugging. Check gc.garbage. It should be empty. >

Re: writing Python in Emacs

2008-01-19 Thread Thierry Volpiatto
I add just a note about ipython: if you use a version > 0.6.15 may be you will have a bad output on error like: == " ": instead of: if __name__ == "__main__": all the characters are missing. To avoid that, run in ipython: %upgrade -nolegacy uncomment in ~/.ipython/ipy_user_config.p

Re: finding memory leak in edgewall trac 0.11

2008-01-19 Thread Jeroen Ruigrok van der Werven
Hi Christian, -On [20080119 16:16], Christian Heimes ([EMAIL PROTECTED]) wrote: >I forgot one important point in my reply. The GC module contains some >useful methods for debugging. Check gc.garbage. It should be empty. Yeah, we're messing around with that stuff as well as many ot

Re: python scripts with IIS

2008-01-19 Thread william paul
Thank you, William - Original Message From: Rolf van de Krol <[EMAIL PROTECTED]> To: python-list@python.org Sent: Saturday, January 19, 2008 5:33:59 PM Subject: Re: python scripts with IIS Adding the following lines before your print statement should do the trick. IIS complains about

Re: Gui front-end to version control program

2008-01-19 Thread Paul Rubin
David Delony <[EMAIL PROTECTED]> writes: > I want something that can work with any file, as Subversion does. I > can't think of any GUI wrappers written in Python off the top of my > head. I would like to use one as a model and get my feet wet by > contributing to it. I don't feel proficient enough

Gui front-end to version control program

2008-01-19 Thread David Delony
I spoke with Eric S. Raymond at a Linux user's group meeting a few days ago about the need for version control for end users. I thought that Python might be a good candidate for this. Luckily, Guido was there as well. I talked this over with him and he suggested using Google Documents sinceI usu

Okay I got a question regarding Tkinter and Labels

2008-01-19 Thread Lamonte Harris
Okay I've created a script and basically when I loop through a folder it is supposed to change the Label everytime it updates a file then again it doesn't do nothing but shows the last file edited, whats the best way to loop through files and display that file name in a Label's text without skippin

Re: python scripts with IIS

2008-01-19 Thread Rolf van de Krol
Adding the following lines before your print statement should do the trick. IIS complains about the headers, so adding headers should help. print "Content-Type: text/html" # HTML is following print # blank line, end of headers william paul wrote: > > Hello:

Re: Details about pythons set implementation

2008-01-19 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, bukzor <[EMAIL PROTECTED]> wrote: >On Jan 4, 2:15 pm, Steven D'Aprano <[EMAIL PROTECTED] >cybersource.com.au> wrote: >> On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote: >> > Why cant you implement < for complex numbers? Maybe I'm being naive, but >> > isn't this th

Default attribute values pattern

2008-01-19 Thread George Sakkis
A situation that often comes up is having to initialize several instance attributes that accept a default value. For a single class, passing the default values in __init__ is fine: class Base(object): def __init__(self, x=0, y=None): self.x = x self.y = y For i

Re: pyExcelerator: writing multiple rows

2008-01-19 Thread [EMAIL PROTECTED]
On Jan 19, 7:46�am, [EMAIL PROTECTED] wrote: > Hi all, > > I was just curious if there was a �built-in or a more efficient way to > do take multiple rows of information and write them into excel using > pyExcelerator. �This is how I resolved the problem: > > from pyExcelerator import * > > data = [

Re: writing Python in Emacs

2008-01-19 Thread Terry Jones
> "Richard" == Richard Szopa <[EMAIL PROTECTED]> writes: Richard> I am a devoted Emacs user and I write a lot in Python. Me too. Richard> I need the following features: Richard> 1) Tab completion, ideally Slime like. That is, when there's not Richard> enough letters to unambiguously complet

Re: What is a shortcut to the Default home directory in Windows

2008-01-19 Thread Christian Heimes
Tim Golden wrote: > Umm... Is it not? The only thing I'm aware of doing is > retaining backwards compat. by using SHGetPathFromIDList > on the SHGetSpecialFolderLocation because I was writing against > Win9x at the time. Or are you saying something else? > > (Admit I haven't checked all the docs s

Re: TopSort in Python?

2008-01-19 Thread duncan smith
Carl Banks wrote: > On Jan 18, 7:01 pm, Paddy <[EMAIL PROTECTED]> wrote: >> On Jan 18, 9:47 pm, [EMAIL PROTECTED] wrote:> Tim, >> >>> Thanks for the topsort code. It would be useful in a project I'm >>> working on. Can I use the code for free under public domain? Thanks! >> When I needed one I d

Re: ANN:proxysocket(socks4,socks5)v0.1

2008-01-19 Thread Samuel
v0.2 http://proxysocket.googlecode.com/files/ProxySocket.py On 1月18日, 下午3时04分, Tim Roberts <[EMAIL PROTECTED]> wrote: > Samuel <[EMAIL PROTECTED]> wrote: > > >http://code.google.com/p/proxysocket/downloads/list > > Allow me to introduce you to the concept of comments. Python allows you to > inclu

Re: Using "pickle" for interprocess communication - some notes and things that ought to be documented.

2008-01-19 Thread Paul Boddie
On 19 Jan, 17:06, John Nagle <[EMAIL PROTECTED]> wrote: > Paul Boddie wrote: > > Unlike your approach, pprocess employs the fork system call. > > Unfortunately, that's not portable. Python's "fork()" is > "Availability: Macintosh, Unix." I would have preferred > to use "fork()". There was a

Re: Ruby Programming

2008-01-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > iTechArt has specialized in Ruby on Rails (ROR) development and > provides a complete software outsourcing services for web development > solutions based on Ruby. We suggest use Ruby framework for developing > database-backed web applications with Ajax on front-end beca

Re: Using "pickle" for interprocess communication - some notes and things that ought to be documented.

2008-01-19 Thread John Nagle
Paul Boddie wrote: > Unlike your approach, pprocess employs the fork system call. Unfortunately, that's not portable. Python's "fork()" is "Availability: Macintosh, Unix." I would have preferred to use "fork()". John Nagle -- http://mail.python.org/mailma

Ruby Programming

2008-01-19 Thread LinkExchange . AB
iTechArt has specialized in Ruby on Rails (ROR) development and provides a complete software outsourcing services for web development solutions based on Ruby. We suggest use Ruby framework for developing database-backed web applications with Ajax on front-end because it's a great fit for practicall

Re: Efficient processing of large nuumeric data file

2008-01-19 Thread David Sanders
On Jan 18, 11:15 am, David Sanders <[EMAIL PROTECTED]> wrote: > Hi, > > I am processing large files of numerical data. Each line is either a > single (positive) integer, or a pair of positive integers, where the > second represents the number of times that the first number is > repeated in the dat

python scripts with IIS

2008-01-19 Thread william paul
Hello: I am trying to configure IIS to work with Python scripts: I've added in the Home Directory/Configuration the .py extention and the path to the python.exe as: c:\Python24\python.exe %S %S The python script has 1 line: print "This is a test for python scripts with IIS" When I launch the

Re: finding memory leak in edgewall trac 0.11

2008-01-19 Thread Christian Heimes
rupert.thurner wrote: > what would be a good means of finding where the 0.11 version of > edgewall trac uses excessive memory. see > http://groups.google.com/group/trac-dev/browse_thread/thread/116e519da54f16b > for some details, where jonas suggested > http://wingolog.org/archives/2007/11/27/reduc

finding memory leak in edgewall trac 0.11

2008-01-19 Thread rupert.thurner
what would be a good means of finding where the 0.11 version of edgewall trac uses excessive memory. see http://groups.google.com/group/trac-dev/browse_thread/thread/116e519da54f16b for some details, where jonas suggested http://wingolog.org/archives/2007/11/27/reducing-the-footprint-of-python-appl

Re: Pythonland documentation

2008-01-19 Thread Laurent Pointal
Le Fri, 18 Jan 2008 18:51:19 +, Simon Pickles a écrit : > Hi > > I am new to python (fairly) but can't stop pythonning. > > c++ seems so far away now from here it looks like a horrid scribble > :) > > Anyway my question is really about doc tools. I've been used to > doxygen in c++ l

Re: Core Python Programming . . .

2008-01-19 Thread Yu-Xi Lim
FireNWater wrote: > I guess I'm not fully up to speed on what constitutes an IP address. > Does the term 'octet' refer to an 8-bit (xFF) number? Yes, it somewhat archaic though. It's used when "byte" is ambiguous. On some ancient (by computing standards) computers, the size of a byte may be as

SPARQL server in Python?

2008-01-19 Thread Bart Ogryczak
Hi, I'm trying to migrate some R&D I've done with PHP and RAP[1] to Python. But I've got hard time finding Python RDF/SPARQL server. Most things I find are SPARQL clients. Do you know of a Python library, that could do the job? [1] http://sites.wiwiss.fu-berlin.de/suhl/bizer/rdfapi/ bart --

Re: Core Python Programming . . .

2008-01-19 Thread FireNWater
On Jan 18, 6:00 pm, Yu-Xi Lim <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > > > 6-11 Conversion. > > (a) Create a program that will convert from an integer to an > > Internet Protocol (IP) address in the four-octet format of WWW.XXX.YYY.ZZZ > > (b) Update your program to be able to do the

pyExcelerator: writing multiple rows

2008-01-19 Thread patrick . waldo
Hi all, I was just curious if there was a built-in or a more efficient way to do take multiple rows of information and write them into excel using pyExcelerator. This is how I resolved the problem: from pyExcelerator import * data = [[1,2,3],[4,5,'a'],['','s'],[6,7,'g']] wb=pyExcelerator.Work

Re: Excess whitespace in my soup

2008-01-19 Thread Stefan Behnel
John Machin wrote: > On Jan 19, 11:00 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> John Machin wrote: >>> I'm happy enough with reassembling the second item. The problem is in >>> reliably and correctly collapsing the whitespace in each of the above >> > fiveelements. The standard Python idiom

Re: Excess whitespace in my soup

2008-01-19 Thread John Machin
On Jan 19, 11:00 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > I'm happy enough with reassembling the second item. The problem is in > > reliably and correctly collapsing the whitespace in each of the above > > > fiveelements. The standard Python idiom of u' '.join(text.sp

Re: Excess whitespace in my soup

2008-01-19 Thread Remco Gerlich
Not sure if this is sufficient for what you need, but how about import re re.sub(u'[\s\xa0]+', ' ', s) That should replace all occurances of 1 or more whitespace or \xa0 characters, by a single space. Remco On Jan 19, 2008 12:38 PM, John Machin <[EMAIL PROTECTED]> wrote: > I'm trying to recove

Re: Is this a bug, or is it me?

2008-01-19 Thread Arnaud Delobelle
On Jan 17, 3:55 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Here is a simpler example: > > >>> class A: > > ...     a = 42 > ...     list(a for _ in "a") > ... > Traceback (most recent call last): >   File "", line 1, in >   File "", line 3, in A >   File "", line 3, in > NameError: global name

writing Python in Emacs

2008-01-19 Thread Richard Szopa
Hi All, I am a devoted Emacs user and I write a lot in Python. However, I never managed to get my Emacs configuration right for this purpose. There were some discussions on this, but the threads that show if I search the group are either old or not so relevant. I need the following features: 0)

Re: Excess whitespace in my soup

2008-01-19 Thread Fredrik Lundh
John Machin wrote: > I'm happy enough with reassembling the second item. The problem is in > reliably and correctly collapsing the whitespace in each of the above > fiveelements. The standard Python idiom of u' '.join(text.split()) > won't work because the text is Unicode and u'\xa0' is whitesp

Excess whitespace in my soup

2008-01-19 Thread John Machin
I'm trying to recover the original data from some HTML written by a well-known application. Here are three original data items, in Python repr() format, with spaces changed to tildes for clarity: u'Saturday,~19~January~2008' u'Line1\nLine2\nLine3' u'foonly~frabjous\xa0farnarklingliness' Here is

All about DOGS

2008-01-19 Thread mayasmith1
Hi How much do you know about Dogs? http://www.dogsinfos.com -- http://mail.python.org/mailman/listinfo/python-list

Movie Stars As Sources Of Wisdom

2008-01-19 Thread bs866806
Why do many people look to movie stars for answers to some of life's most challenging questions? While we have great respect for the art of acting, as explicated from Stanislavsky to Strasberg, the latter of whom we knew well and were fond of, we have never understood how the usual snippets who de

Re: Is this a bug, or is it me?

2008-01-19 Thread Arnaud Delobelle
On Jan 18, 7:01 pm, [EMAIL PROTECTED] wrote: > I filed a bug report, and here is the short answer to my question: > genexps are code blocks, and code blocks cannot see variables in class > scopes. Congrats to Neil Cerutti who figured it out. > > Now here is another one for your enjoyment: > > class