Re: A design problem I met again and again.

2009-04-03 Thread Michele Simionato
On Apr 3, 7:18 am, Emile van Sebille em...@fenx.com wrote:  So, I think the question becomes, when does code need refactoring? I would say that 99.9% of the times a single class with 15,000 lines of code is a signal that something is wrong, and refactoring is needed. M. Simionato --

Re: xml to xhtml

2009-04-03 Thread Stefan Behnel
jud...@gmail.com wrote: On Apr 1, 11:16 am, Joe Riopel goo...@gmail.com wrote: On Wed, Apr 1, 2009 at 10:43 AM, jud...@gmail.com wrote: If anyone can give me some guidance what should be the best way to generate html/xhtml page using python would be great. I am open to other options like xsl

Re: A design problem I met again and again.

2009-04-03 Thread 一首诗
Consolidate existing functions? I've thought about it. For example, I have two functions: #= def startXXX(id): pass def startYYY(id): pass #= I could turn it into one: #= def start(type, id): if(type ==

Re: python for loop

2009-04-03 Thread Lie
On Apr 2, 5:29 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 01 Apr 2009 21:58:47 -0700, Lie wrote: On Apr 1, 7:06 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: There is a major clash between the names of ordinals in human languages and

Re: py2exe problem

2009-04-03 Thread Wolfgang Forstmeier
On 03.04.2009 05:29, Gabriel Genellina wrote: En Thu, 02 Apr 2009 08:06:22 -0300, Wolfgang Forstmeier mail...@supai.de escribió: On 02.04.2009 11:34, Gabriel Genellina wrote: En Wed, 01 Apr 2009 17:51:52 -0300, Wolfgang Forstmeier mail...@supai.de escribió: what kind of error do I have with

HTML Generation

2009-04-03 Thread Mike
Hello all, I'm writing a web app and wanted to do some html generation (I really do not like to maintain or write html). I'm thinking of writing a dsl based on the following: def html(): return def a(): return def body(): return (html, ...(head, (style, id, {font-color:black}))

Re: interacting with an updatedb generated data file within python

2009-04-03 Thread John Machin
On Apr 3, 1:07 pm, birdsong david.birds...@gmail.com wrote: Does anybody have any recommendations on how to interact with the data file that updatedb generates?  I'm running through a file list in sqlite that I want to check against the file system. updatedb is pretty optimized for building an

Re: HTML Generation

2009-04-03 Thread Tino Wildenhain
Hi Mike, Mike wrote: Hello all, I'm writing a web app and wanted to do some html generation (I really do not like to maintain or write html). I'm thinking of writing a dsl based on the following: def html(): return def a(): return def body(): return That would be writing

Re: Iteratoration question

2009-04-03 Thread Diez B. Roggisch
while what you are doing is interesting, it is not the same as Python's iterators, which use yield from a function and don't require storing a value in a class. look for yield in the python docs. this comment may be irrelevant; i am just worried you are confusing the above (which apart from

Re: interacting with an updatedb generated data file within python

2009-04-03 Thread John Machin
On Apr 3, 6:25 pm, John Machin sjmac...@lexicon.net wrote: The format appears to be documented e.g.http://www.delorie.com/gnu/docs/findutils/locatedb.5.html and thus should be found on the locatedb(5) man page on your system. More comprehensive:

pyreadline, InteractiveConsole, and tab completion on Windows

2009-04-03 Thread Thomas Heller
I have installed pyreadline, and get nice tab completion in the normal interactive interpreter: snip Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import rlcompleter import readline

Re: Python Goes Mercurial

2009-04-03 Thread Jeremiah Dodds
On Thu, Apr 2, 2009 at 9:02 PM, andrew cooke and...@acooke.org wrote: Echo wrote: 2009/4/2 Jeremiah Dodds jeremiah.do...@gmail.com The one thing that makes me want to use git more than any other dvcs is that you don't have to create a new directory for branches. This may be possible in

dictionary and list

2009-04-03 Thread abakarmukhtar
-- http://mail.python.org/mailman/listinfo/python-list

Re: Pythoner,Wish me luck!

2009-04-03 Thread Matteo
On Apr 3, 9:05 am, Linuxwell ahqylang...@gmail.com wrote: Starting today I would like to study Python,Wish me luck! Good luck! Don't forget to... print 'Hello World!' ;) -- http://mail.python.org/mailman/listinfo/python-list

Pythoner,Wish me luck!

2009-04-03 Thread Linuxwell
Starting today I would like to study Python,Wish me luck! -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Generation

2009-04-03 Thread Daniel Fetchinson
Hello all, I'm writing a web app and wanted to do some html generation (I really do not like to maintain or write html). I'm thinking of writing a dsl based on the following: def html(): return def a(): return def body(): return (html, ...(head, (style, id,

config parser -help

2009-04-03 Thread Murali kumar
hi all, i want to all my configuration file names in current/user/home directory.. for that i came across following function in configparser class.. Is it must to specify file names? or only directories enough.. if there anyway to read conf filenames in current/user directory...

Re: Pythoner,Wish me luck!

2009-04-03 Thread Hendrik van Rooyen
Matteo tadw.@gmail.com wrote: On Apr 3, 9:05 am, Linuxwell ahqylang...@gmail.com wrote: Starting today I would like to study Python,Wish me luck! Good luck! Don't forget to... print 'Hello World!' This is better advice than what you may think, because the interactive interpreter is

Re: Python Goes Mercurial

2009-04-03 Thread Patrick Mullen
2009/4/3 Jeremiah Dodds jeremiah.do...@gmail.com: On Thu, Apr 2, 2009 at 9:02 PM, andrew cooke and...@acooke.org wrote: Echo wrote: 2009/4/2 Jeremiah Dodds jeremiah.do...@gmail.com The one thing that makes me want to use git more than any other dvcs is that you don't have to create a

Re: Iteratoration question

2009-04-03 Thread Steven D'Aprano
On Thu, 02 Apr 2009 18:07:38 -0700, grocery_stocker wrote: Okay, I was thinking more about this. I think this is also what is irking me. Say I have the following.. a = [1,2,3,4] for x in a: ... print x ... 1 2 3 4 Would 'a' somehow call __iter__ and next()? If so, does python

Re: config parser -help

2009-04-03 Thread Murali kumar
Is there anyway to read all my configuration filenames with extension (.cfg)? Advanced thanks.. On Fri, Apr 3, 2009 at 3:15 PM, Murali kumar murali...@gmail.com wrote: hi all, i want to all my configuration file names in current/user/home directory.. for that i came across following

SOAPpy serious problem

2009-04-03 Thread ozgur vatansever
Hi, I have a problem about soappy. I have a wsdl file located at http://212.175.81.30:/importWebService/services/ShippingOrderDispatcher?wsdl I want to call the function dispatch but that function takes an array of ShippingOrder objects. I couldn't manage to define that array of

Re: A design problem I met again and again.

2009-04-03 Thread Steven D'Aprano
On Thu, 02 Apr 2009 22:18:02 -0700, Emile van Sebille wrote: Steven D'Aprano wrote: On Thu, 02 Apr 2009 16:51:24 -0700, Emile van Sebille wrote: snip I refactor constantly during development to avoid code reuse through cut-n-paste, but once I've got it going, whether it's 1000 or 6000

Re: config parser -help - anybody please immediately help for me...

2009-04-03 Thread Murali kumar
On Fri, Apr 3, 2009 at 3:59 PM, Murali kumar murali...@gmail.com wrote: Is there anyway to read all my configuration filenames with extension (.cfg)? Advanced thanks.. On Fri, Apr 3, 2009 at 3:15 PM, Murali kumar murali...@gmail.com wrote: hi all, i want to all my configuration file

Re: python for loop

2009-04-03 Thread Lou Pecora
In article 5c92e9bd-1fb4-4c01-a928-04d7f6733...@e21g2000yqb.googlegroups.com, Aaron Brady castiro...@gmail.com wrote: On Apr 2, 6:34 pm, Tim Wintle tim.win...@teamrubber.com wrote: On Thu, 2009-04-02 at 15:16 -0700, Emile van Sebille wrote: Lou Pecora wrote: Confusion only comes when

mmap regex search replace

2009-04-03 Thread David Pratt
Hi. I have a circumstance where I have to search and replace a block of text in a very large file. I have written some psuedo code to locate the text and print the span of text to be removed and replaced by new block. Can someone advise what to do to remove the text span and insert with

Re: py2exe problem

2009-04-03 Thread Gabriel Genellina
En Fri, 03 Apr 2009 03:55:20 -0300, Wolfgang Forstmeier mail...@supai.de escribió: On 03.04.2009 05:29, Gabriel Genellina wrote: En Thu, 02 Apr 2009 08:06:22 -0300, Wolfgang Forstmeier mail...@supai.de escribió: On 02.04.2009 11:34, Gabriel Genellina wrote: En Wed, 01 Apr 2009 17:51:52

Re: Regression test

2009-04-03 Thread Gabriel Genellina
En Mon, 23 Mar 2009 21:04:35 -0300, Colin J. Williams c...@ncf.ca escribió: I am running a regression test, mainly because I wish to explore subprocess, and get a number of errors before crashing. Is this to be expected? The run output is below. C:\Documents and

Re: config parser -help - anybody please immediately help for me...

2009-04-03 Thread Gabriel Genellina
En Fri, 03 Apr 2009 08:46:17 -0300, Murali kumar murali...@gmail.com escribió: Is there anyway to read all my configuration filenames with extension (.cfg)? See the glob module http://docs.python.org/library/glob.html glob.glob(os.path.expanduser('~/*.cfg')) -- Gabriel Genellina --

Re: Class methods read-only by default?

2009-04-03 Thread Emanuele D'Arrigo
Thank you both, Steven and Andrew, for the insightful explanation. I shall keep it in mind when thinking about classes methods and instances. Thank you again. Manu -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-03 Thread srepmub
On Mar 30, 4:36 pm, Michele Simionato michele.simion...@gmail.com wrote: On Mar 30, 3:31 pm, srepmub mark.duf...@gmail.com wrote: for the record, the input forShedskinis pure Python, so there is no added syntax or optional type declaration system. that said, I can understand it not being

Re: python for loop

2009-04-03 Thread MRAB
Lie wrote: [snip] Alternatively: One friend of mine half-seriously advanced the following thesis: We should count from zero. But first is, etymologically, a diminution of foremost, and (as TomStambaugh says) should mean 0th when we count from 0. And second is from the Latin secundus, meaning

Re: Pythoner,Wish me luck!

2009-04-03 Thread MRAB
Matteo wrote: On Apr 3, 9:05 am, Linuxwell ahqylang...@gmail.com wrote: Starting today I would like to study Python,Wish me luck! Good luck! Don't forget to... print 'Hello World!' Or: print('Hello World!') if using Python 3. -- http://mail.python.org/mailman/listinfo/python-list

Re: A design problem I met again and again.

2009-04-03 Thread Emile van Sebille
Steven D'Aprano wrote: On Thu, 02 Apr 2009 22:18:02 -0700, Emile van Sebille wrote: Steven D'Aprano wrote: On Thu, 02 Apr 2009 16:51:24 -0700, Emile van Sebille wrote: snip I refactor constantly during development to avoid code reuse through cut-n-paste, but once I've got it going, whether

Re: with open('com1', 'r') as f:

2009-04-03 Thread Gabriel Genellina
En Thu, 02 Apr 2009 20:04:14 -0300, gert gert.cuyk...@gmail.com escribió: On Apr 2, 8:53 pm, Kushal Kumaran kushal.kuma...@gmail.com wrote: On Thu, 2 Apr 2009 10:01:02 -0700 (PDT) gert gert.cuyk...@gmail.com wrote: from subprocess import * check_call(['mode',

Re: A design problem I met again and again.

2009-04-03 Thread andrew cooke
Emile van Sebille wrote: Whether you (generic you) choose to do so or not is a separate issue. Also agreed - and that is really my point. Doing so feels to me like continuing to look for a lost object once you've found it. i can see your point here, but there's two things more to consider:

Re: py2exe problem

2009-04-03 Thread Dave Angel
Wolfgang Forstmeier wrote: snip / Ok, but do you really use idlelib for something? Or it's just some random code you found somewhere and drop into your application? Ah yes, I really use this. I create some message boxes for a little GUI application that controls some other program with

Re: HTML Generation

2009-04-03 Thread J Kenneth King
Tino Wildenhain t...@living-examples.com writes: Hi Mike, Mike wrote: Hello all, I'm writing a web app and wanted to do some html generation (I really do not like to maintain or write html). I'm thinking of writing a dsl based on the following: def html(): return def a():

Re: HTML Generation

2009-04-03 Thread Stefan Behnel
J Kenneth King wrote: from tags import html, head, meta, title, body, div, p, a mypage = html( head( meta(attrs={'http-equiv': Content-Type, 'content': text/html;}), title(My Page)),

Re: config parser -help - anybody please immediately help for me...

2009-04-03 Thread Tim Chase
1) Posting the same question multiple times in a 3 hour span isn't likely to get you anything more than people who get peeved at your impatience. Take a moment to realize that you posted at 4:00am for my local (CST/CDT) time. That means that, at least for those of us in the US, you posted

Re: config parser -help

2009-04-03 Thread Chris Rebert
On Fri, Apr 3, 2009 at 3:15 PM, Murali kumar murali...@gmail.com wrote: hi all, i want to all my configuration file names in current/user/home directory.. for that i came across following function in configparser class.. Is it must to specify file names? or only directories enough.. if

Re: python needs leaning stuff from other language

2009-04-03 Thread Zamnedix
On Apr 2, 3:25 pm, online.serv...@ymail.com wrote: python's list needs a thing list.clear() like c# arraylist and python needs a writeline() method Please don't post things like list before you do any research. You don't know what you are talking about. --

Re: Sending SMS using python script

2009-04-03 Thread Craig
There's a Python wrapper to the Skype API here: http://sourceforge.net/projects/skype4py/ On Linux I've used the PyGTK GUI that uses this. It's called SkySentials here: http://www.kolmann.at/philipp/linux/skysentials/ Craig On Apr 3, 6:50 am, ISF (Computer Scientists without Frontiers, Italy)

Re: python needs leaning stuff from other language

2009-04-03 Thread Mel
Ben Finney wrote: I think it would also be better to have One (and prefereably Only One) Obvious Way To Do It. That obvious way, for those who work with Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have ‘list’ conform with this also. Does that mean a one-off special case

Re: python for loop

2009-04-03 Thread alex23
On Apr 3, 10:36 pm, Lou Pecora pec...@anvil.nrl.navy.mil wrote:  Aaron Brady castiro...@gmail.com wrote: Did I tell you guys that 'natural' has 38 definitions at dictionary.com? Amazing.  I suggest you pick the one that fits best. You mean the one that feels most natural? --

Re: python needs leaning stuff from other language

2009-04-03 Thread Steven D'Aprano
On Fri, 03 Apr 2009 08:23:22 -0700, Zamnedix wrote: On Apr 2, 3:25 pm, online.serv...@ymail.com wrote: python's list needs a thing list.clear() like c# arraylist and python needs a writeline() method Please don't post things like list before you do any research. You don't know what you

Re: python needs leaning stuff from other language

2009-04-03 Thread Steven D'Aprano
On Fri, 03 Apr 2009 11:41:10 -0400, Mel wrote: Ben Finney wrote: I think it would also be better to have One (and prefereably Only One) Obvious Way To Do It. That obvious way, for those who work with Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have ‘list’ conform with

django model problem

2009-04-03 Thread Mark
Hi, Say I have these simple models: class Musician(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) class Album(models.Model): artist = models.ForeignKey(Musician) name = models.CharField(max_length=100) Now in `Musician`

Best way to pickle functions

2009-04-03 Thread Aaron Scott
I have a number of functions that I need to pickle without necessarily knowing their names in advance. My first thought was to put all the functions in a class, then pickle the class, but it doesn't really work like I expected it to. import cPickle class PickleClass:

Re: A design problem I met again and again.

2009-04-03 Thread Emile van Sebille
andrew cooke wrote: Emile van Sebille wrote: Whether you (generic you) choose to do so or not is a separate issue. Also agreed - and that is really my point. Doing so feels to me like continuing to look for a lost object once you've found it. i can see your point here, but there's two

Re: Best way to pickle functions

2009-04-03 Thread Aaron Brady
On Apr 3, 11:04 am, Aaron Scott aaron.hildebra...@gmail.com wrote: I have a number of functions that I need to pickle without necessarily knowing their names in advance. My first thought was to put all the functions in a class, then pickle the class, but it doesn't really work like I expected

Re: python for loop

2009-04-03 Thread Aaron Brady
On Apr 3, 10:43 am, alex23 wuwe...@gmail.com wrote: On Apr 3, 10:36 pm, Lou Pecora pec...@anvil.nrl.navy.mil wrote:  Aaron Brady castiro...@gmail.com wrote: Did I tell you guys that 'natural' has 38 definitions at dictionary.com? Amazing.  I suggest you pick the one that fits best.

Re: python needs leaning stuff from other language

2009-04-03 Thread Mel
Steven D'Aprano wrote: On Fri, 03 Apr 2009 11:41:10 -0400, Mel wrote: Ben Finney wrote: I think it would also be better to have One (and prefereably Only One) Obvious Way To Do It. That obvious way, for those who work with Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to

Re: with open('com1', 'r') as f:

2009-04-03 Thread gert
On Apr 3, 3:44 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Thu, 02 Apr 2009 20:04:14 -0300, gert gert.cuyk...@gmail.com escribió: On Apr 2, 8:53 pm, Kushal Kumaran kushal.kuma...@gmail.com wrote: On Thu, 2 Apr 2009 10:01:02 -0700 (PDT) gert gert.cuyk...@gmail.com wrote: from

User or UserManager ? Problems of Observer Pattern

2009-04-03 Thread 一首诗
#This is a real world problem I met. # #We have a database containing serveral tables, like : user, role, organization. Each 2 of them has m:n relationships. These relations are stored in association tables. # #Not we have to load all these data in memory to gain higher performances. We create

Hash of None varies per-machine

2009-04-03 Thread ben . taylor
Found this while trying to do something unrelated and was curious... If you hash an integer (eg. hash(3)) you get the same integer out. If you hash a string you also get an integer. If you hash None you get an integer again, but the integer you get varies depending on which machine you're running

Re: Best way to pickle functions

2009-04-03 Thread Aaron Scott
Pickling the source code is much sturdier.  It's very unlikely that the same code runs differently in different interpreters.  It's much more likely that the same code runs the same, or not at all. Okay, I've run into another problem. I've saved the code to a string, so I can call it up when I

platform.architecture, __path__, PYTHONPATH, and dist.utils

2009-04-03 Thread szager
Howdy, I need to support both 32-bit and 64-bit versions of compiled python modules that cannot be installed into the default search path of the python interpreter(s). I use PYTHONPATH to point to the module installations, but I have a problem: I don't know, a priori, whether the user will be

Re: Hash of None varies per-machine

2009-04-03 Thread Paul Rubin
ben.tay...@email.com writes: 1. Is it correct that if you hash two things that are not equal they might give you the same hash value? Yes, hashes are 32 bit numbers and there are far more than 2**32 possible Python values (think of long ints), so obviously there must be multiple values that

Re: A design problem I met again and again.

2009-04-03 Thread paul
一首诗 schrieb: Consolidate existing functions? I've thought about it. For example, I have two functions: #= def startXXX(id): pass def startYYY(id): pass #= I could turn it into one: #= def

Re: Best way to pickle functions

2009-04-03 Thread Aaron Scott
Never mind. Solved the problem by putting the functions in a class and dumping that into a string. Then, when I need it, I executed the string to get myself the class, then created an instance of that class which gave me access to those functions along with the correct scope. Probably not the

Re: django model problem

2009-04-03 Thread Dave Angel
Mark wrote: Hi, Say I have these simple models: class Musician(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) class Album(models.Model): artist = models.ForeignKey(Musician) name = models.CharField(max_length=100) I

Re: Hash of None varies per-machine

2009-04-03 Thread Joshua Judson Rosen
Paul Rubin http://phr...@nospam.invalid writes: ben.tay...@email.com writes: 1. Is it correct that if you hash two things that are not equal they might give you the same hash value? Yes, hashes are 32 bit numbers and there are far more than 2**32 possible Python values (think of long

Re: Pythoner,Wish me luck!

2009-04-03 Thread barisa
On Apr 3, 11:39 am, Hendrik van Rooyen m...@microcorp.co.za wrote: Matteo tadw.@gmail.com wrote: On Apr 3, 9:05 am, Linuxwell ahqylang...@gmail.com wrote: Starting today I would like to study Python,Wish me luck! Good luck! Don't forget to... print 'Hello World!' This is better

Re: HTML Generation

2009-04-03 Thread J Kenneth King
Stefan Behnel stefan...@behnel.de writes: J Kenneth King wrote: from tags import html, head, meta, title, body, div, p, a mypage = html( head( meta(attrs={'http-equiv': Content-Type, 'content': text/html;}),

Re: minor revision encoded in SONAME in libpython.so

2009-04-03 Thread Martin v. Löwis
So no, no minor revision gets encoded into the SONAME. Then what's the significance of the .1.0 at the end of the SONAME? Is it just nipples for men? (I hope no one objects to my extending the Monty Python theme to Time Bandits). Some systems require that shared libraries have a version

Re: Re: Best way to pickle functions

2009-04-03 Thread Dave Angel
Aaron Scott wrote: Pickling the source code is much sturdier. It's very unlikely that the same code runs differently in different interpreters. It's much more likely that the same code runs the same, or not at all. Okay, I've run into another problem. I've saved the code to a string, so

Re: Python Goes Mercurial

2009-04-03 Thread Martin v. Löwis
So what were these strong antipathies towards Git, exactly? i haven't read the article you link to, but compared to what i've read on dev strong antipathies sounds a bit over-hyped. That was the phrase used by GvR. well if you find any, please do report back. I don't like git because it

Re: Pythoner,Wish me luck!

2009-04-03 Thread nrballard
On Apr 3, 12:33 pm, barisa bbaj...@gmail.com wrote: On Apr 3, 11:39 am, Hendrik van Rooyen m...@microcorp.co.za wrote: Matteo tadw.@gmail.com wrote: On Apr 3, 9:05 am, Linuxwell ahqylang...@gmail.com wrote: Starting today I would like to study Python,Wish me luck! Good luck!

Re: Pythoner,Wish me luck!

2009-04-03 Thread Ravi Kumar
Hi, I'm also begginer in python; i did few basic programs about graph etc.. my question is : what benefit is using interactive intrepreter ? the IDLE interractive python IDE is best comparing to any other most advanced IDE available in world. Really, if you are learning the python at any

IIS python web application mapping issue - resolved

2009-04-03 Thread davidj411
i searched the internet for an hour , never found this info, and figured it out myself. posting this so that others won't have to look so hard. ran across this issue and it seems that nobody really documented this correctly on http://support.microsoft.com/kb/276494 in IIS i could not add the

Re: Hash of None varies per-machine

2009-04-03 Thread Dave Angel
ben.tay...@email.com wrote: Found this while trying to do something unrelated and was curious... If you hash an integer (eg. hash(3)) you get the same integer out. If you hash a string you also get an integer. If you hash None you get an integer again, but the integer you get varies depending

Python-URL! - weekly Python news and links (Apr 3)

2009-04-03 Thread Gabriel Genellina
QOTW: A programmer has to know the name of many data structures. - bearophile Code organization: how to split a project into modules http://groups.google.com/group/comp.lang.python/browse_thread/thread/56c320cea02796cc/ A speech generator, expert in leading-edge

Re: Pythoner,Wish me luck!

2009-04-03 Thread barisa
On Apr 3, 8:58 pm, nrball...@gmail.com wrote: On Apr 3, 12:33 pm, barisa bbaj...@gmail.com wrote: On Apr 3, 11:39 am, Hendrik van Rooyen m...@microcorp.co.za wrote: Matteo tadw.@gmail.com wrote: On Apr 3, 9:05 am, Linuxwell ahqylang...@gmail.com wrote: Starting today I would

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-03 Thread Martin v. Löwis
Perhaps we could add something like a sys.namespace_packages that would be updated by this mechanism? Then, pkg_resources could check both that and its internal registry to be both backward and forward compatible. I could see no problem with that, so I have added this to the PEP. Thanks for

confused with creating doctest in xmlrpc server

2009-04-03 Thread Krishnakant
hello all, I am thinking of using the doctest module for my unit testing code in python. I have no problems doing this in usual classes but I am a bit confused with my twisted based rpc classes. given that I directly take the output of running functions on a python prompt for the dockstrings, how

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-03 Thread Martin v. Löwis
Chris Withers wrote: Martin v. Löwis wrote: I propose the following PEP for inclusion to Python 3.1. Please comment. Would this support the following case: I have a package called mortar, which defines useful stuff: from mortar import content, ... I now want to distribute large

Re: django model problem

2009-04-03 Thread Mark
I think the first thing you need to do is decide if there is going to be more than one Musician object. and more than one Album object. Presently you are giving all musicians the same first_name and last_name. I suggest you look up the documentation for the special method __init__()

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-03 Thread Martin v. Löwis
I'd like to extend the proposal to Python 2.7 and later. I don't object, but I also don't want to propose this, so I added it to the discussion. My (and perhaps other people's) concern is that 2.7 might well be the last release of the 2.x series. If so, adding this feature to it would make 2.7

Re: Hash of None varies per-machine

2009-04-03 Thread Christian Heimes
Paul Rubin wrote: Yes, hashes are 32 bit numbers and there are far more than 2**32 possible Python values (think of long ints), so obviously there must be multiple values that hash to the same slot. No, hashs are C longs. On most 64bit platforms a C long has 64bits. As far as I know only 64bit

Re: with open('com1', 'r') as f:

2009-04-03 Thread Christian Heimes
gert wrote: I do understand, and I went looking into pySerial, but it is a long way from getting compatible with python3.x and involves other libs that are big and non pyhton3.x compatible. So don't use Python 3.0. Most people are still using Python 2.5 or 2.6. Christian --

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-03 Thread Martin v. Löwis
Note that there is no such thing as a defining namespace package -- namespace package contents are symmetrical peers. With the PEP, a defining package becomes possible - at most one portion can define an __init__.py. I know that the current mechanisms don't support it, and it might not be

Re: Best way to pickle functions

2009-04-03 Thread Aaron Scott
Why not use import ?  Simply recreate the source file, if necessary, and import it again. Ah, you'd think it would be that easy :P The problem with just importing a module is that the module is then cached in memory. Multiple copies of the program are running on a server, and each of them

Re: is there a way to collect twitts with python?

2009-04-03 Thread Michael Torrie
'2+ wrote: i found a guy twittin supercollider code this means his followers can listen to a noiz by activating that 1 line (well if he has sc installed) if lots of sc users start twittin ... it would be no good to follow each collecting a sc related twitt can be done with python? if

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-03 Thread glyph
On 08:15 pm, mar...@v.loewis.de wrote: Note that there is no such thing as a defining namespace package -- namespace package contents are symmetrical peers. With the PEP, a defining package becomes possible - at most one portion can define an __init__.py. For what it's worth, this is a

SFTP libraries in pure Python?

2009-04-03 Thread hirudo #1
Hi, I am looking for SFTP libraries that are written in pure Python. I already checked out paramiko, but as far as I can see, it requires pycrypto, which is not pure Python. Another candidate, Twisted, isn't pure Python either. I don't really care about speed as much as about

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-03 Thread P.J. Eby
At 10:15 PM 4/3/2009 +0200, Martin v. Löwis wrote: I should make it clear that this is not the case. I envision it to work this way: import zope - searches sys.path, until finding either a directory zope, or a file zope.{py,pyc,pyd,...} - if it is a directory, it checks for .pkg files. If it

Module caching

2009-04-03 Thread Aaron Scott
Is there a way to make a Python app running in mod_python with zero persistence? I have an app that should be resetting its variables every time you access it, but sometimes -- and only sometimes -- the variables persist through a couple refreshes. They'll even persist through multiple browsers,

Re: IIS python web application mapping issue - resolved

2009-04-03 Thread davidj411
I thought i was being clever but not only did i typo , but it does not work with the -u for unbuffered option. remove the -u to avoid the ugly message: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. I am going to use the CGI script to upload

Re: python needs leaning stuff from other language

2009-04-03 Thread Tim Wintle
On Fri, 2009-04-03 at 13:12 -0400, Mel wrote: I think it would also be better to have One (and prefereably Only One) Obvious Way To Do It. That obvious way, for those who work with Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have ‘list’ conform with this also.

Let-expressions

2009-04-03 Thread sloisel
Dear All, I searched this group and found that there have been discussions about introducing a let expression to the language so that you can define local variables in a lambda. I.e., something like f=lambda x: let y=x^2 in sin(y). (My syntax is unpythonic, but I hope you get it). Can someone

Re: Module caching

2009-04-03 Thread Aaron Scott
Okay, I'm at my wit's end. I have a Python app, running via mod_python. There are variables in this app that, when changed, save their changes to a pickled file tied to a session ID. Then, when the page is accessed again, the variables are loaded from the respective file. But, when one user uses

Re: Module caching

2009-04-03 Thread Aaron Scott
Huzzah, another post. I just discovered that even physically deleting the variable doesn't work. The module storylab.game has the class InitGame, which contains daemons = {}. A user runs the code, resulting in some values in daemons: {'berry2': , 'berry3': , 'berry1': }. These are pickled. The

Re: Module caching

2009-04-03 Thread andrew cooke
are you an experienced python programmer? a lot of newbies post here with problems related to unexpected results because they make the usual mistakes about list mutability and default function arguments. i suspect that's not the case here, but it seemed worth mentioning, just in case. andrew

Re: Class methods read-only by default?

2009-04-03 Thread Piet van Oostrum
Emanuele D'Arrigo man...@gmail.com (ED) wrote: ED Hi Everybody! ED I just tried this: class C(object): ED ...def method(self): ED ...pass ED ... c = C() delattr(c, method) ED Traceback (most recent call last): ED File stdin, line 1, in module ED AttributeError: 'C' object

Re: python needs leaning stuff from other language

2009-04-03 Thread MRAB
Tim Wintle wrote: On Fri, 2009-04-03 at 13:12 -0400, Mel wrote: I think it would also be better to have One (and prefereably Only One) Obvious Way To Do It. That obvious way, for those who work with Python's ‘set’ and ‘dict’, is a ‘clear’ method. It seems best to have ‘list’ conform with this

Re: Python Goes Mercurial

2009-04-03 Thread Lawrence D'Oliveiro
In message 49d65b62$0$30904$9b622...@news.freenet.de, Martin v. Löwis wrote: I don't like git because it is too difficult for me. In many cases, git would refuse to do operations like updating or local committing, producing error messages I was not able to understand ... Post an example of

Re: with open('com1', 'r') as f:

2009-04-03 Thread Lawrence D'Oliveiro
In message 8bc55c05-19da-41c4- b916-48e0a4be4...@p11g2000yqe.googlegroups.com, gert wrote: with open('com1', 'r') as f: for line in f: print('line') Why bother, why not just for line in open('com1', 'r') : print line --

Re: Module caching

2009-04-03 Thread Aaron Scott
are you an experienced python programmer? Yeah, I'd link to think I'm fairly experienced and not making any stupid mistakes. That said, I'm fairly new to working with mod_python. All I really want is to have mod_python stop caching variables. This seems like it should be easy enough to do, but

Re: Unix programmers and Idle

2009-04-03 Thread MRAB
Dale Amon wrote: On Mon, Mar 30, 2009 at 08:11:10PM -0500, Dave Angel wrote: I don't know what Idle has to do with it. sys.args contains the command line arguments used to start a script. Dale Amon wrote: I wonder if someone could point me at documentation on how to debug some of the

  1   2   3   >