Re: How to read stdout from subprocess as it is being produced

2008-12-19 Thread Albert Hopkins
On Fri, 2008-12-19 at 06:34 -0800, Alex wrote: > Hi, > > I have a Pyhon GUI application that launches subprocess. > I would like to read the subprocess' stdout as it is being produced > (show it in GUI), without hanging the GUI. > > I guess threading will solve the no-hanging issue, but as far as

Re: no sign() function ?

2008-12-22 Thread Istvan Albert
> conclusions --- try testing on a large number of candidates that are all (or mostly) positive or all (or mostly) negative and you'll see performance numbers that are substantially different than the ones you report: candidates = range(1000) In general the func

Re: print to console without a line break

2008-12-23 Thread Albert Hopkins
On Tue, 2008-12-23 at 13:18 +, Lie Ryan wrote: > On Tue, 23 Dec 2008 11:50:59 +0100, Qian Xu wrote: > > > Hello All, > > > > Is it possible to print something to console without a line break? > > > > I tried: > > sys.stdout.write("Testing something ...") // nothing will be printed > > ti

Re: need help with list/variables

2008-12-30 Thread Albert Hopkins
On Tue, 2008-12-30 at 11:31 -0800, wx1...@gmail.com wrote: > I have a list and would like to parse the list appending each list > item to the end of a variable on a new line. > > for instance > > mylist = ['something\n', 'another something\n', 'something again\n'] > > then parse mylist to make i

Re: parse/slice/...

2009-01-06 Thread Albert Hopkins
On Tue, 2009-01-06 at 11:23 -0800, rcmn wrote: > I'm not sure how to call it sorry for the subject description. >Here what i'm trying to accomplish. > the script i'm working on, take a submitted list (for line in file) > and generate thread for it. unfortunately winxp has a limit of 500 > threa

Re: How do you write to the printer ?

2009-01-08 Thread Albert Hopkins
On Wed, 2009-01-07 at 16:46 -0600, da...@bag.python.org wrote: > Can find nothing in the on-line docs or a book. > Groping in the dark I attempted : > > script24 > import io > io.open('stdprn','w') # accepted > stdprn.write('hello printer') # fails < stdprn is not defined >

Re: parsing grub's menu.lst

2008-11-17 Thread Albert Hopkins
On Mon, 2008-11-17 at 10:27 -0800, CarlFK wrote: > I need some code that will read in grubs menu.lst file, and give me a > list of dicts: > > [{'title':'Ubuntu, kernel 2.6.15-23-686', > 'root':'(hd0,0)', > 'kernel':'/boot/vmlinuz-2.6.15-23-686 root=/dev/hda1 ro quiet splash', > 'initrd':'/boot/ini

Re: Retrieve Custom 404 page.

2008-11-17 Thread Albert Hopkins
On Mon, 2008-11-17 at 13:59 -0800, godavemon wrote: > I'm using urllib2 to pull pages for a custom version of a web proxy > and am having issues with 404 errors. Urllib2 does a great job of > letting me know that a 404 happened with the following code. > > import urllib2 > url = 'http://cnn.com/a

Re: subprocess with shared environment?

2008-11-17 Thread Albert Hopkins
On Mon, 2008-11-17 at 15:27 -0800, rowen wrote: > I'd like to replace some shell scripts with Python, but one step of > the script modifies my environment in a way that the subsequent steps > require. > > A simple translation to a few lines of subprocess.call(...) fails > because the first call mo

Re: setting permissions to a file from linux.

2008-11-18 Thread Albert Hopkins
On Tue, 2008-11-18 at 04:36 -0800, gaurav kashyap wrote: > Hi all, > I have a text file in a directory on unix system. > Using a python program i want to change that file's permissions. > How could this be done. > > Thanks os.chmod = chmod(...) chmod(path, mode) Change the access per

Re: Can someone tell me why i get None at the end please this has me stuck for ages

2009-02-23 Thread Albert Hopkins
On Mon, 2009-02-23 at 19:22 +, Gary Wood wrote: > '''exercise to complete and test this function''' > import string > def joinStrings(items): > '''Join all the strings in stringList into one string, > and return the result. For example: > >>> print joinStrings(['very', 'hot', 'day']

Re: Is there any equivalent feature available in Python..?

2009-02-24 Thread Albert Hopkins
On Tue, 2009-02-24 at 11:05 -0800, zaheer.ag...@gmail.com wrote: > Hi, > > Is there any Python equivalent of java jar,can I include all my > sources,properties file etc into a single file.Is there anyway in > Python that I can run like the following > > java -jar Mytest.jar --startwebserver > >

Re: Lambda function

2009-02-25 Thread Albert Hopkins
On Wed, 2009-02-25 at 17:56 +0530, aditya saurabh wrote: > I defined two functions - lets say > fa = lambda x: 2*x > fb = lambda x: 3*x > Now I would like to use fa*fb in terms of x > is there a way? > Thanks in advance I'm not sure what "use fa*fb in terms of x" means. But if you mean fa(x) * fb

Re: Can someone explain this behavior to me?

2009-02-26 Thread Albert Hopkins
On Thu, 2009-02-26 at 13:48 -0800, Jesse Aldridge wrote: > I have one module called foo.py > - > class Foo: > foo = None > > def get_foo(): > return Foo.foo > > if __name__ == "__main__": > import bar > Foo.foo = "foo" > bar.go() > - > A

Re: Wanting to fire an event when property content changes

2009-03-03 Thread Albert Hopkins
On Tue, 2009-03-03 at 13:41 -0600, nuwandame wrote: > What I am wanting to do is execute code whenever a property of a class > object has been changed. > > i.e. > > class test: > > testproperty = None > > > bob = test() > bob.testproperty = 'something' > > So, when bob.testproperty is set

Re: "/a" is not "/a" ?

2009-03-07 Thread Albert Hopkins
On Fri, 2009-03-06 at 23:57 -0800, Paul Rubin wrote: > alex23 writes: > > But _you_ only _just_ stated "It does have some (generally small) > > performance ramifications as > > well" and provided timing examples to show it. Without qualification. > > The performance difference can be large if the

Re: "/a" is not "/a" ?

2009-03-07 Thread Albert Hopkins
On Sat, 2009-03-07 at 03:07 -0500, Albert Hopkins wrote: > On Fri, 2009-03-06 at 23:57 -0800, Paul Rubin wrote: > > alex23 writes: > > > But _you_ only _just_ stated "It does have some (generally small) > > > performance ramifications as > > > well

Re: Raw String Question

2009-03-12 Thread Albert Hopkins
> > Yep...as documented[1], "even a raw string cannot end in an odd number > > of backslashes". > > So how do you explain this? > > >>> r'a\'b' > "a\\'b" That doesn't "end in an odd number of backslashes." Python is __repr__esenting a raw string as a "regular" string. Literally they

Re: unbiased benchmark

2009-03-12 Thread Albert Hopkins
On Thu, 2009-03-12 at 13:25 -0700, Chris Rebert wrote: > On Thu, Mar 12, 2009 at 1:07 PM, Sam Ettessoc wrote: > > I would like to share a benchmark I did. The computer used was a > > 2160MHz Intel Core Duo w/ 2000MB of 667MHz DDR2 SDRAM running MAC OS > > 10.5.6 and a lots of software running (a t

Re: Getting final url when original url redirects

2009-03-12 Thread Albert Hopkins
On Thu, 2009-03-12 at 12:57 -0700, IanR wrote: > I'm processing RSS content from a # of given sources. Most of the > time the url given by the RSS feed redirects to the real URL (I'm > guessing they do this for tracking purposes) > > For example. > > This is a url that I get from and RSS feed, >

Re: How to find "in" in the documentation

2009-03-13 Thread Albert Hopkins
On Fri, 2009-03-13 at 21:01 +, tinn...@isbd.co.uk wrote: > I've had this trouble before, how do I find the details of how "in" > works in the documentation. E.g. the details of:- > > if string in bigstring: > > It gets a mention in the "if" section but not a lot. > >From http://docs.py

Re: Neatest way to do a case insensitive "in"?

2009-03-13 Thread Albert Hopkins
On Fri, 2009-03-13 at 21:04 +, tinn...@isbd.co.uk wrote: > What's the neatest way to do the following in case insensitive fashion:- > > if stringA in stringB: > bla bla bla > > I know I can just do:- > > if stringA.lower() in stringB.lower(): > bla bla bla > > But I

Re: Tuple passed to function recognised as string

2009-03-18 Thread Albert Hopkins
On Wed, 2009-03-18 at 16:58 -0700, Mike314 wrote: > Hello, > >I have following code: > > def test_func(val): > print type(val) > > test_func(val=('val1')) > test_func(val=('val1', 'val2')) > > The output is quite different: > > > > > Why I have string in the first case? You could h

Re: Can I rely on...

2009-03-19 Thread Albert Hopkins
On Thu, 2009-03-19 at 08:42 -0700, Emanuele D'Arrigo wrote: > Hi everybody, > > I just had a bit of a shiver for something I'm doing often in my code > but that might be based on a wrong assumption on my part. Take the > following code: > > pattern = "aPattern" > > compiledPatterns = [ ] > compi

Re: Missing values in tuple assignment

2009-03-19 Thread Albert Hopkins
On Thu, 2009-03-19 at 11:57 -0500, Jim Garrison wrote: > Use case: parsing a simple config file line where lines start with a > keyword and have optional arguments. I want to extract the keyword and > then pass the rest of the line to a function to process it. An obvious > use of split(None,1) >

Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote: > > > >if stringA.lower() in stringB.lower(): > >bla bla bla > > > > from string import lower > > if lower(stringA) in lower(stringB): > # was this what you were after? > This is analogous to standing behind a

Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Albert Hopkins
On Fri, 2009-03-20 at 08:52 +1100, Jervis Whitley wrote: > On Fri, Mar 20, 2009 at 8:28 AM, Albert Hopkins > wrote: > > On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote: > >> > > >> >if stringA.lower() in stringB.lower(): > >> >

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:16 -0700, Alexzive wrote: > Hello there, > > I'd like to get the same result of set() but getting an indexable > object. > How to get this in an efficient way? > > Example using set > > A = [1, 2, 2 ,2 , 3 ,4] > B= set(A) > B = ([1, 2, 3, 4]) > > B[2] > TypeError: unin

Re: meta question - how to read comp.lang.python w/o usenet feed/google interface?

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:42 -0700, Esmail wrote: > Hi all, > > I've been reading/posting to usenet since the 80s with a variety of > tools (vn, and most recently Thunderbird) but since my ISP > (TimeWarner) no longer provides usenet feeds I'm stuck. > > I am not crazy about the web interface via

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:54 -0700, thomasvang...@gmail.com wrote: > You could use: > B=list(set(A)).sort() > Hope that helps. Which will assign None to B. sorted(list(... or B.sort() is probably what you meant. -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe linux equivalent

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 12:59 -0700, Brendan Miller wrote: > I have a python application that I want to package up and deploy to > various people using RHEL 4. > > I'm using python 2.6 to develop the app. The RHEL 4 machines have an > older version of python I'd rather not code against (although tha

Re: A problem with subprocess

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 22:14 -0400, Colin J. Williams wrote: > Below is a test script: > > # tSubProcess.py > > import subprocess > import sys > try: >v= subprocess.Popen('ftype > py=C:\Python25\Python.exe') > except WindowsError: >print(sys.exc_info()) > > Here is the output: > > *** P

Re: __init__ vs. __del__

2009-03-21 Thread Albert Hopkins
On Sat, 2009-03-21 at 17:41 -0700, Randy Turner wrote: > Hi, > > > I was reading a book on Python-3 programming recently and the book > stated that, while there is an __init__ method for initializing > objects, there was a __del__ method but the __del__ method is not > guaranteed to be called whe

Re: 3.0 - bsddb removed

2009-03-22 Thread Albert Hopkins
On Sun, 2009-03-22 at 15:55 +, Sean wrote: > Anyone got any thoughts about what to use as a replacement. I need > something (like bsddb) which uses dictionary syntax to read and write an > underlying (fast!) btree or similar. > gdbm -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Istvan Albert
On Mar 23, 10:16 am, CinnamonDonkey wrote: > I'm fairly new to Python so I still have a lot to learn. But I'd like > to know how to correectly use relative imports. Relative imports are *fundamentally* broken in python. You will soon see that code using relative import will break if you attempt

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Istvan Albert
On Mar 24, 3:16 pm, "Gabriel Genellina" wrote: > Did you know, once a module is imported by the first time yeah yeah, could we not get sidetracked with details that are not relevant? what it obviously means is to import it in all of your modules that need to access to relative paths > I don't u

Re: Relative Imports, why the hell is it so hard?

2009-03-24 Thread Istvan Albert
On Mar 24, 9:35 pm, Maxim Khitrov wrote: > Works perfectly fine with relative imports. This only demonstrates that you are not aware of what the problem actually is. Try using relative imports so that it works when you import the module itself. Now run the module as a program. The same module t

Re: Another form of dynamic import

2009-03-25 Thread Albert Hopkins
Also, instead of caching exceptions you can do lazy lookups kinda like this: - # a.py class A: pass - # b.py class B:

Re: What way is the best to check an empty list?

2009-03-25 Thread Albert Hopkins
On Wed, 2009-03-25 at 21:26 +, Martin P. Hellwig wrote: > > > > PEP 8 recommends the latter. > > > > > > Raymond > I can't seem to find where this recommendation is mentioned or implied. Wow, you must not have looked very hard: 1. Point your browser to http://www.python.org/dev/peps/p

Re: Odd behavior regarding a list

2009-03-26 Thread Albert Hopkins
On Thu, 2009-03-26 at 08:36 -0700, Edd Barrett wrote: > Hi there, > > My first post here, so hello :) > > Just a little background, I am writing my dissertation, which is a JIT > compiler based upon LLVM and it's python bindings, along with the > aperiot LL(1) parser. > > I have some code here,

Re: Find duplicates in a list and count them ...

2009-03-26 Thread Albert Hopkins
On Thu, 2009-03-26 at 12:22 -0700, paul.scipi...@aps.com wrote: > Hello, > > I'm a newbie to Python. I have a list which contains integers (about > 80,000). I want to find a quick way to get the numbers that occur in > the list more than once, and how many times that number is duplicated > in t

Re: Find duplicates in a list and count them ...

2009-03-26 Thread Albert Hopkins
On Thu, 2009-03-26 at 15:54 -0400, Albert Hopkins wrote: [...] > $ cat test.py > from random import randint > > l = list() > for i in xrange(8): > l.append(randint(0,10)) ^^^ should have been: l.append(randint(0,9)) > > hi

Re: running shelscript inside python

2009-03-26 Thread Albert Hopkins
On Thu, 2009-03-26 at 15:23 -0700, harijay wrote: > Hi > I want to run shell scripts of the following kind from inside python > and for some reason either the os.system or the subprocess.call ways > are not working for me . > > I am calling a fortran command (f2mtz ) with some keyworded input that

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 10:47 -0700, Aahz wrote: > In article , > andrew cooke wrote: > >Aahz wrote: > >> > >> Excuse me? What decline of this newsgroup? > > > >Hmmm. It's hard to respond to this without implicitly criticising others > >here, which wasn't my point at all. But my personal impress

Re: pyqt drop to open a file

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 17:55 -0700, rui.li.s...@gmail.com wrote: > Hi, > > anyone can give a simple example or a link on how to use 'drop' with > pyqt. > > what I'm looking for is drop a file to main widget then program get > the path\filename > > something like: main_widget set to accept 'drop e

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 21:15 -0400, andrew cooke wrote: [...] > c.l.python used to be the core of a community built around a language. It > no longer is. It is a very useful place, where some very helpful and > knowledgeable people hang out and give advice, but instead of representing > the full

Re: Psycopg Documentation

2009-03-29 Thread Albert Hopkins
On Sun, 2009-03-29 at 11:35 +0100, taliesin wrote: > Hi, > > I'm probably being very dense so apologies in advance, but I can't find > any decent documentation for the psycopg module for PostgreSQL interfacing. > > Google and Yahoo don't seem to return much for any of the queries I gave > them an

Re: Did you noticed that Unipath is not more available?

2009-03-29 Thread Albert Hopkins
On Sun, 2009-03-29 at 15:17 +0200, Andrea Francia wrote: > Do you know/use Unipath? > Unipath is a OO path manipulation library. It's used, for example, to > rename, copy, deleting files. > > Unfortunately this library is no more available as I reported in [1]. > > I found a copy of the .egg in

Re: Problems with code

2009-03-30 Thread Albert Hopkins
On Mon, 2009-03-30 at 11:05 -0500, Zach Goscha wrote: > Hi, > > I am trying to call an unbound method (Map.Background) but getting the > following error: > TypeError: unbound method background() must be called with Map > instance as first argument (got nothing instead) > > Here is some of the

Re: imp.load_source() - explanation needed

2009-04-01 Thread Albert Hopkins
On Wed, 2009-04-01 at 12:17 -0700, mynthon wrote: > Hi! > > I need help. I don't understand what doc says. > > I load module from path testmod/mytest.py using imp.load_source(). My > code is > > import imp > testmod = imp.load_source('koko', 'testmod/mytest.py) > print testmod > > but i don't u

Re: statvfs clearance

2009-04-04 Thread Albert Hopkins
On Sat, 2009-04-04 at 03:56 -0700, Sreejith K wrote: > Python's statvfs module contains the following indexes to use with > os.statvfs() that contains the specified information > > statvfs.F_BSIZE > Preferred file system block size. > > statvfs.F_FRSIZE > Fundamental file system block siz

Re: statvfs clearance

2009-04-04 Thread Albert Hopkins
On Sat, 2009-04-04 at 15:48 +0200, Hrvoje Niksic wrote: > Sreejith K writes: > > > Python's statvfs module contains the following indexes to use with > > os.statvfs() that contains the specified information > > > > statvfs.F_BSIZE > > Preferred file system block size. > [...] > > statvfs.F_NA

Re: Issue with subprocess Module

2009-04-07 Thread Albert Hopkins
On Tue, 2009-04-07 at 07:53 -0400, Dave Angel wrote: > > > subprocess.Popen() is expecting the name of a program, which should > normally have an extension of .exe You're handing it a .bat file, > which is not executable. It only executes in the context of a command > interpreter (shell),

Re: Why does Python show the whole array?

2009-04-08 Thread Albert Hopkins
On Wed, 2009-04-08 at 12:01 +0200, Peter Otten wrote: > Gilles Ganault wrote: > > > I'd like to go through a list of e-mail addresses, and extract those > > that belong to well-known ISP's. For some reason I can't figure out, > > Python shows the whole list instead of just e-mails that match: > >

Re: Computed attribute names

2009-04-08 Thread Albert Hopkins
On Wed, 2009-04-08 at 19:47 +0100, Dale Amon wrote: > There are a number of things which I have been used > to doing in other OO languages which I have not yet > figured out how to do in Python, the most important > of which is passing method names as args and inserting > them into method calls. He

Re: Decompression with zlib

2009-04-08 Thread Albert Hopkins
On Wed, 2009-04-08 at 23:51 +0200, Emma Li wrote: > Hello, > > I'm trying to do compression/decompression of stuff with zlib, and I > just don't get it... > Here is an example. I assume that dec should be "a", but it isn't. dec > turns out to be an empty string, and I don't understand why... >

Re: any(), all() and empty iterable

2009-04-11 Thread Albert Hopkins
On Sun, 2009-04-12 at 04:00 +, John O'Hagan wrote: > Hi, > > I was getting some surprising false positives as a result of not expecting > this: > > all(element in item for item in iterable) > > to return True when 'iterable' is empty. > > I guess it goes into hairy Boolean territory tryin

Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
A small foreword: This might look like a cherrypy-oriented post, and should therefore go to the cherrypy group, but if you read to the end, you'll see it's a more basic python problem, with cherrypy only as an example. ;) >From the decorator PEP (318) I get it that you can /add/ parameters to a ca

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:52 pm, Jon Clements wrote: > On 13 Apr, 11:11, Michel Albert wrote: > > > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it&

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:45 pm, Aaron Brady wrote: > On Apr 13, 5:11 am, Michel Albert wrote: > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it's a more b

Re: Processing in Python

2008-05-20 Thread Istvan Albert
On May 20, 6:13 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Salvatore DI DI0 schrieb: > > > Hello, > > > The Processing Graphics language has been implemented in Javascript. > > No, it hasn't. Processing is written in Java. He meant it has been re-implemented in Javascript: http://ejohn.o

qrcode in python?

2008-05-21 Thread Michel Albert
I am planning to write a python-module for python as I haven't found anything on the tubes so far. If anyone has any interesting insight on this topic, replies are welcome! ;) Q: What is QR-Code? A: http://www.denso-wave.com/qrcode/qrstandard-e.html So far (as of May 21st 2008): Google (1 sensi

Re: I am worried about Python 3

2008-04-09 Thread Istvan Albert
On Apr 9, 11:53 am, John Nagle <[EMAIL PROTECTED]> wrote: > The general consensus is that Python 3.x isn't much of an there are a number of unfortunate typos in there that interfere with the message, instead of "The general consensus is" I think you actually meant "In my opinion" i. -- ht

Re: py3k s***s

2008-04-18 Thread Istvan Albert
On Apr 18, 1:39 am, Sverker Nilsson <[EMAIL PROTECTED]> wrote: > Some whine. Some just don't care. Why not whine? Whining and ranting is actually good for the psyche. It is better to get it out of your system. As for your original post, no doubt there are substantial downsides to introducing Py3

Re: Python Success stories

2008-04-22 Thread Istvan Albert
On Apr 22, 6:25 am, azrael <[EMAIL PROTECTED]> wrote: > A friend of mine i a proud PERL developer which always keeps making > jokes on python's cost. > This hurts. Please give me informations about realy famous > aplications. you could show him what Master Yoda said when he compared Python to Pe

Re: Python Success stories

2008-04-23 Thread Istvan Albert
On Apr 23, 2:08 pm, Bob Woodham <[EMAIL PROTECTED]> wrote: > x = x++; > > has unspecified behaviour in C. That is, it is not specified > whether the value of x after execution of the statement is the > old value of x or one plus the old value of x. unspecified means that the result could be anyt

Re: Need help on left padding

2008-04-28 Thread Albert Leibbrandt
Marc 'BlackJack' Rintsch wrote: On Mon, 28 Apr 2008 04:37:02 -0700, rajesh kataraki wrote: My requirement is I am using one variable ex. var = 5 which is integer. And this variable, I m using in some string. But I want this var to be used as 005 again integer in this string.

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-01 Thread Istvan Albert
On Apr 29, 3:51 am, "Zed A. Shaw" <[EMAIL PROTECTED]> wrote: > You can grab the most recent draft of the book at: > > http://zedshaw.com/projects/vellum/manual-final.pdf > However, I'm curious to get other people's thoughts. IMO if you would refrain from using swear words in the manual it would

Re: multiprocessing eats memory

2008-09-25 Thread Istvan Albert
On Sep 25, 8:40 am, "Max Ivanov" <[EMAIL PROTECTED]> wrote: > At any time in main process there are shouldn't be no more than two copies of > data > (one original data and one result). >From the looks of it you are storing a lots of references to various copies of your data via the async set. --

Re: multiprocessing eats memory

2008-09-26 Thread Istvan Albert
On Sep 26, 4:52 am, redbaron <[EMAIL PROTECTED]> wrote: > How could I avoid of storing them? I need something to check does it > ready or not and retrieve results if ready. I couldn't see the way to > achieve same result without storing asyncs set. It all depends on what you are trying to do. The

Re: Tree and Graph structures in Python.

2006-03-14 Thread Istvan Albert
See this: https://networkx.lanl.gov/ -- http://mail.python.org/mailman/listinfo/python-list

GIS

2006-04-03 Thread Albert Leibbrandt
ython? Thanks Albert -- http://mail.python.org/mailman/listinfo/python-list

Re: GIS

2006-04-03 Thread Albert Leibbrandt
own little project. > So you will be able to ask more precises questions. > > Cyril > > On 4/3/06, *Albert Leibbrandt* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Hi > > I need to get myself familiarised with GIS, specifically postgis f

Re: MOO meets Python

2006-04-03 Thread Istvan Albert
Quote from the webpage: "It's a buggy bundle of Python code that, by default, opens interfaces to your computer and makes it insecure." ... just what I was looking for ... -- http://mail.python.org/mailman/listinfo/python-list

CD Burning

2006-04-04 Thread Albert Leibbrandt
Hi Can anybody tell me which windows API or python module they are using for writing cd's / dvd's with python? Thanks Albert -- http://mail.python.org/mailman/listinfo/python-list

Re: UnboundLocalError with extra code after return

2009-09-29 Thread Albert Hopkins
On Tue, 2009-09-29 at 21:15 -0700, Rich Healey wrote: > However: > > def callonce(func): > def nullmethod(): pass > def __(): > return func() > func = nullmethod > return ret > return __ > > @callonce > def t2(): > print "T2 called" > t2() > > Gives me: >

Re: Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Albert Hopkins
On Fri, 2009-10-02 at 20:22 -0400, Simon Forman wrote: > 2.5 +1 I'd like to suggest 2.46 instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: creating class objects inside methods

2009-10-04 Thread Albert Hopkins
Just by a brief look at your code snippet there are a few things that I would point out, stylistically, that you may consider changing in your code as they are generally not considered "pythonic": * As already mentioned the "state" class is best if given a name that is capitalized.

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 07:27 -0700, dpapathanasiou wrote: > When I try to write the filedata to a file system folder, though, I > get an AttributeError in the stack trace. And where might we be able to see that stack trace? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 08:16 -0700, dpapathanasiou wrote: > > And where might we be able to see that stack trace? > > This is it: > > Exception: ('AttributeError', '', [' File "/opt/server/smtp/ > smtps.py", line 213, in handle\ne > mail_replier.post_reply(recipient_mbox, \'\'.join(data))\n',

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 09:17 -0700, dpapathanasiou wrote: > > Which is *really* difficult (for me) to read. Any chance of providing a > > "normal" traceback? > > File "/opt/server/smtp/smtps.py", line 213, in handle > email_replier.post_reply(recipient_mbox, ''.join(data)) > File "/opt/ser

Re: Passing values from html to python

2009-10-22 Thread Albert Hopkins
On Thu, 2009-10-22 at 10:44 +0200, Ahmed Barakat wrote: > Hi guys, > > I am new to python and wed-development, I managed to have some nice > example running up till now. > I am playing with google app engine, I have this situation: > > I have a text box in an html page, I want to get the value in

Re: Web development with Python 3.1

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 15:32 +0200, Dotan Cohen wrote: > > def index(request): > >unmaintanable_html = """ > > > > > >Index > > > > > >Embedded HTML is a PITA > >but some like pains... > > > > > > """ > >return HttpResponse(unmaintanable_html) > > > > And if I need to

Re: Web development with Python 3.1

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote: > > return HttpResponse(unmaintanable_html % data) > > > > That's fine for single variables, but if I need to output a table of > unknown rows? I assume that return means the end of the script. > Therefore I should shove the whole table into a

Re: popen function of os and subprocess modules

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 07:15 -0700, banu wrote: > > Thanks for the reply Jon > Basically I need to move into a folder and then need to execute some > shell commands(make etc.) in that folder. I just gave 'ls' for the > sake of an example. The real problem I am facing is, how to stay in > the folder

Re: Aaaargh! "global name 'eggz' is not defined"

2009-10-29 Thread Albert Hopkins
On Thu, 2009-10-29 at 17:27 -0500, Robert Kern wrote: > I consider "import *" the first error to be fixed, so it doesn't > bother me much. :-) But does pyflakes at least *warn* about the use of "import *" (I've never used it so just asking)? -- http://mail.python.org/mailman/listinfo/python-li

Re: OT: DARPA red balloon challenge

2009-10-30 Thread Albert Hopkins
On Thu, 2009-10-29 at 20:27 -0700, Adam N wrote: [...] > On December 5, DARPA will raise 10 red weather balloons somewhere in > the US. The first person to get the location of all 10 balloons and > submit them will be given $40k. Hasn't the U.S. had enough weather balloon-related publicity stunt

Re: Are *.pyd's universal?

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 21:32 +1300, Lawrence D'Oliveiro wrote: > Modules will sometimes find > > themselves on the path in Windows, so the fact that Windows performs > a > > library search on the path is quite significant. > > Why is it only Windows is prone to this problem? I think as someone po

Re: datetime question

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 10:08 +1100, Ben Finney wrote: > The ‘datetime’ module focusses on individual date+time values (and the > periods between them, with the ‘timedelta’ type). > > For querying the properties of the calendar, use the ‘calendar’ > module. > > Yes, it would be nice if the ‘time’,

Re: datetime question

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 20:34 +1100, Ben Finney wrote: > Fixing ‘time’, ‘datetime’, and ‘calendar’ was the reason for Python 3? > No, it wasn't. > > Or perhaps you mean that any backward-incompatible change was a reason > to have Python 3? Even more firmly no. The extent of changes was > severely li

Re: Python 2.6.4: ./configure does not work

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 03:07 -0700, knipknap wrote: > Hi, > > Running ./configure in the 2.6.4 sources produces the following error: > > config.status: error: cannot find input file: Makefile.pre.in > > Indeed, such a file is not contained anywhere in the Pakage. Which sources are you referring

Re: Are *.pyd's universal?

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 23:58 +1300, Lawrence D'Oliveiro wrote: > I just checked my Debian installation: > > l...@theon:~> find /lib /usr/lib -name \*.so -a -not -name lib\* > -print | wc -l > 2950 > l...@theon:~> find /lib /usr/lib -name \*.so -print | wc -l > 4708 > > So 63% of th

Re: import bug

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 16:27 +, kj wrote: > >2) this has been fixed in Py3 > > In my post I illustrated that the failure occurs both with Python > 2.6 *and* Python 3.0. Did you have a particular version of Python > 3 in mind? I was not able to reproduce with my python3: $ head ham/*

Re: Detecting new removable drives in Linux

2010-03-01 Thread Albert Hopkins
On Mon, 2010-03-01 at 10:48 +0100, Bart Smeets wrote: > Hello, > > > I'm trying to write a script which detects when a new removable drive > is connected to the computer. On #python I was advised to use the > dbus-bindings. However the documentation on this is limited. Does > anyone know of an ex

Re: pythonpath

2010-03-01 Thread Albert Hopkins
On Mon, 2010-03-01 at 02:48 -0800, luca72 wrote: > Sorry for my stupid question if i have to load module from a folder i > have to append it to the sys path the folder? > ex: > if my folder module is /home/lucak904/Scrivania/Luca/enigma2 > i do this : > import sys > sys.path.append('/home/lucak90

os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
I have a snippet of code that looks like this: pid, fd = os.forkpty() if pid == 0: subprocess.call(args) else: input = os.fdopen(fd).read() ... This seems to work find for CPython 2.5 and 2.6 on my Linux system. However, with CPython 3.1 I

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
On Tue, 2010-03-02 at 13:25 -0500, Terry Reedy wrote: > To get help, or report a bug, for something like this, be as specific as > possible. 'Linux' may be too generic. This is on Python on Gentoo Linux x64 with kernel 2.6.33. > > > However, with CPython 3.1 I get: > > > > input =

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
On Tue, 2010-03-02 at 17:32 +, MRAB wrote: > The documentation also mentions the 'pty' module. Have you tried that > instead? I haven't but I'll give it a try. Thanks. -a -- http://mail.python.org/mailman/listinfo/python-list

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
On Tue, 2010-03-02 at 17:32 +, MRAB wrote: > The documentation also mentions the 'pty' module. Have you tried that > instead? I tried to use pty.fork() but it also produces the same error. I also tried passing 'r', and 'rb' to fdopen() but it didn't make any difference. -a -- http://mail

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
This appears to be Issue 5380[1] which is still open. I've cc'ed myself to that issue. [1] http://bugs.python.org/issue5380 -- http://mail.python.org/mailman/listinfo/python-list

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