Re: Python web framework choice

2008-08-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Quoting Mahdi <[EMAIL PROTECTED]>: I need to develop a medium-sized database web application for my company. Given that: I don't know much about building web UI(s) but i have fair knowledge about HTML & My schedule is tight. a recommendation is v v v appreciated.

threading

2008-08-13 Thread Parimala
Hello, I am using *python2.5.1* version to run my test scripts. I want to use '*threading*' module in my tests. As a startup program, I had run the following one. *import threading import sys import time def hello(): i=0 try: while i<10: print "hi" time.sleep(1) i+=

Re: very rare python expression

2008-08-13 Thread Fredrik Lundh
Edward A. Falk wrote: It parses as "x & 528 or x in l". Looks like it came from http://www.pygame.org/project/833/ and is an attempt to squash the program to as few bytes as possible. Sheesh. The 80's called; they want their floppy drives back. Even with the whitespace restored, it's awf

Re: How to execute commands in internal zones of solaris using python running from the global zone ?

2008-08-13 Thread nntpman68
Hishaam wrote: How to execute commands in internal zones of solaris using python running from the global zone ? i tried -- 1> os.popen("zlogin ") 2> os.popen("zonename") the 2nd command executes back into the global zone and not into the internal zone can anyone help? Hishaam Very probably

RE: Looking out a module for Subversion

2008-08-13 Thread Dudeja, Rajat
> That's not really correct... Pydev should be able to debug (there's a video at > http://showmedo.com/videos/video? name=PydevEclipseFabio&fromSeriesID=8 which goes from configuring Pydev to debugging source > code) and

migration guide (tool) for tkinter to pygtk porting?

2008-08-13 Thread nntpman68
Hi, I have some scripts written for tkinter. Maemo devvice however (for example the Nokia n800) support only pygtk and not tkinter. Are there any migration guide lines or wrapper tools? bye N -- http://mail.python.org/mailman/listinfo/python-list

about spidermonkey

2008-08-13 Thread 徐新丽
I want to ask some questions about python-spidermonkey. can spidermonkey.py be tested on windows platforms? How the python deal with javascript? I am waiting for you response. best withes. _ 用手机MSN聊天写邮件看空间,无限沟通,分享精彩! http://mobile.m

Re: ANN: Chandler 1.0

2008-08-13 Thread Fredrik Lundh
Carl Banks wrote: Thanks for your interest in Chandler Desktop! Cool. Maybe we'll Duke Nukem Forever soon, too. it's rumored to be available as an easter egg in chandler. I don't seem to have found the right key combination yet, though. -- http://mail.python.org/mailman/listinfo/pytho

Usual practice: running/testing modules in a package

2008-08-13 Thread alito
Hi all, I am new to using packages to group my modules. I can't figure out how to run a module that uses relative imports without writing a wrapper that imports that module. Everything I try it complains that I am attempting a relative import in a non-package. eg ~/python/testpackage$ ls config

python tr equivalent (non-ascii)

2008-08-13 Thread kettle
Hi, I was wondering how I ought to be handling character range translations in python. What I want to do is translate fullwidth numbers and roman alphabet characters into their halfwidth ascii equivalents. In perl I can do this pretty easily with tr: tr/\x{ff00}-\x{ff5e}/\x{0020}-\x{007e}/;

Re: PIL (etc etc etc) on OS X

2008-08-13 Thread Fredrik Lundh
David C. Ullrich wrote: Thanks. Sorry to be so dumb - yes, it's perfectly reasonable for eff to assume that people using PIL are programmers. well, my only assumption is that people building PIL from basic building blocks must have some understanding of how that's done on their specific pla

Re: python tr equivalent (non-ascii)

2008-08-13 Thread kettle
On Aug 13, 5:18 pm, kettle <[EMAIL PROTECTED]> wrote: > Hi, > I was wondering how I ought to be handling character range > translations in python. > > What I want to do is translate fullwidth numbers and roman alphabet > characters into their halfwidth ascii equivalents. > In perl I can do this

Re: python tr equivalent (non-ascii)

2008-08-13 Thread Fredrik Lundh
kettle wrote: > I was wondering how I ought to be handling character range > translations in python. > > What I want to do is translate fullwidth numbers and roman alphabet > characters into their halfwidth ascii equivalents. > In perl I can do this pretty easily with tr: > > tr/\x{ff00}-\x{f

The python not starting under cmd.exe

2008-08-13 Thread [EMAIL PROTECTED]
Hi! My problem is that: The "test.py" is working in every machine that I use except in my home machine. Formerly it worked but now not. I don't know what happened, I searching for some solution. The errormessage is this (after I tried to start test.py under cmd.exe): Microsoft Windows XP

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-13 Thread Palindrom
On Aug 13, 2:12 am, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Aug 12, 9:17 am, Palindrom <[EMAIL PROTECTED]> wrote: > > > > > Hi everyone ! > > > I'd like to apologize in advance for my bad english, it's not my > > mother tongue... > > > My girlfriend (who is a newbie in Python, but knows Pe

Re: newb loop problem

2008-08-13 Thread Dave
arrrggg, now I feel really dumb.. hitNum = 0 stopCnt = 6 + hitNum offSet = 5 for i in range(0,10,1): for x in range(hitNum,len(inLst), 1): print hitNum, stopCnt if x == stopCnt: break hitLst.append(inLst[x]) hitNum +=offSet

Re: The python not starting under cmd.exe

2008-08-13 Thread Ulrich Eckhardt
[EMAIL PROTECTED] wrote: > The "test.py" is working in every machine that I use except in my home > machine. [...] > c:\>test.py > A rendszer nem tudja végrehajtani a megadott programot. > > c:\> > > > Sorry for non english, I try to translate it: > "The system cannot execute the pro

Professional Grant Proposal Writing Workshop (September 2008: British Columbia Institute of Technology - Vancouver Campus)

2008-08-13 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held at the British Columbia Institute of Technology - Vancouver Campus, September 29 - October 1, 2008. Interested development professionals, researchers, faculty, and graduate students should register as soo

decorating base methods

2008-08-13 Thread Alexandru Mosoi
I want to derive a base class, such that some methods are decorated. The only thing I have in mind is: class Base(object): def A(self, x): pass def B(self, y): pass class Derived(Base): @decorator def A(self, x): Base.A(self, x) Is this correct approach? How can avoid call to Base.A(...

Logging library unicode problem

2008-08-13 Thread Victor Lin
Hi, I'm writting a application using python standard logging system. I encounter some problem with unicode message passed to logging library. I found that unicode message will be messed up by logging handler. piese of StreamHandler: try: self.stream.write(fs %

Re: python tr equivalent (non-ascii)

2008-08-13 Thread kettle
On Aug 13, 5:33 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > kettle wrote: > > I was wondering how I ought to be handling character range > > translations in python. > > > What I want to do is translate fullwidth numbers and roman alphabet > > characters into their halfwidth ascii equivalents.

Re: __getattr__, __setattr__ and pickle

2008-08-13 Thread mwojc
Bruno Desthuilliers wrote: > >>> class Prop(object): > ... @apply > ... def prop(): > ... def fget(self): return self._prop > ... def fset(self, val): self._prop = val > ... return property(**locals()) > ... def __init__(self, val): self.prop=val > ... > >>> c

Parse error befor % token

2008-08-13 Thread Anish Chapagain
Hi, i tried to compile the swig .i file but am having probel with the error: parse error before % token example.i 1. %module example 2. %{ 3. #include 4. %} 5. 6. %include "header.h" i have setup.py file and am running through, >>python setup.py build_ext but is showing parse error before % to

Re: The python not starting under cmd.exe

2008-08-13 Thread John Machin
On Aug 13, 6:34 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi! > > My problem is that: > The "test.py" is working in every machine that I use except in my home > machine. > Formerly it worked but now not. I don't know what happened, I searching > for some solution. > > The errormessage is

Re: Perl to Python using MqSQLdb

2008-08-13 Thread Mike P
Thanks for that Daniel, I've been able to apply the logic to the rest of the script i'm converting. There are only two bits that i don't understand in the Perl script that i need to convert, my $sql = shift; and my @row = $sth->fetchrow_array; $$StartDate = $row[0]; $$EndDate = $row[1]

daemon / task framework

2008-08-13 Thread Diez B. Roggisch
Hi, I need to write some daemons/cronjobs/tasks. These have in common that they must - process commandline args - locate and load a configuration - setup logging in a robust way - possibly report status via mails - possibly manage locks to avoid concurrent running I can whip up something my

Re: Perl to Python using MqSQLdb

2008-08-13 Thread Jeroen Ruigrok van der Werven
-On [20080812 15:16], Daniel Mahoney ([EMAIL PROTECTED]) wrote: >cursor=db.cursor() >cursor.execute(sql) >while (1): > row = cursor.fetchone() > if row == None: > break > combined = ', '.join(row) Why not something like: for row in cursor.fetchall(): combined =

You advice please

2008-08-13 Thread Hussein B
Hey, I'm a Java/Java EE developer and I'm playing with Python these days. I like the Python language so much and I like its communities and the Django framework. My friends are about to open a Ruby/Rails shop and they are asking me to join them. I don't know what, sure I'm not leaving Java, but the

Re: __getattr__, __setattr__ and pickle

2008-08-13 Thread Michele Simionato
On Aug 12, 7:28 pm, mwojc <[EMAIL PROTECTED]> wrote: > Hi! > My class with implemented __getattr__ and __setattr__ methods cannot be > pickled because of the Error: Another option is to define __getstate__ on your class: def __getstate__(self): return vars(self) M.S. -- http://mail.python.or

format string to certain line width

2008-08-13 Thread elukkien
Hello! I'm trying to find a way to print out a long string (>400 characters no spaces, tabs or newlines) to a line width of 60 characters. So after every 60 characters a newline would start. Is it possible to transform the string to set the linewidth? for example for a linewidth of 2: >>>str = "

Re: format string to certain line width

2008-08-13 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > I'm trying to find a way to print out a long string (>400 characters > no spaces, tabs or newlines) to a line width of 60 characters. So > after every 60 characters a newline would start. Is it possible to > transform the string to set the linewidth? > > for example for

Re: You advice please

2008-08-13 Thread Álvaro G. Vicario
Hussein B escribió: The sad fact (at least to me), Ruby is getting a lot of attention these days. Why Python isn't getting this attention although is a much more mature language and it is used by many big, big names? And do I dare to say it is much more charming? The opinion of a PHP developer

Re: decorating base methods

2008-08-13 Thread Duncan Booth
Alexandru Mosoi <[EMAIL PROTECTED]> wrote: > I want to derive a base class, such that some methods are decorated. > > The only thing I have in mind is: > > class Base(object): > def A(self, x): pass > def B(self, y): pass > > class Derived(Base): > @decorator > def A(self, x): Base.A(s

Re: You advice please

2008-08-13 Thread Jeroen Ruigrok van der Werven
-On [20080813 13:16], Hussein B ([EMAIL PROTECTED]) wrote: >My friends are about to open a Ruby/Rails shop and they are asking me >to join them. I hope they are fully aware of the scaling problems RoR can have. >Why Python isn't getting this attention although is a much more mature

Re: newb loop problem

2008-08-13 Thread marek . rocki
Dave napisał(a): > Hey there, having a bit of problem iterating through lists before i go > on any further, here is > a snip of the script. > -- > d = "a1 b1 c1 d1 e1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 a4 b4 c4 d4 e4 a5 b5 > c5 d5 e5" > inLst = d.split() > hitLst = [] > > hitNum = 0 > stopCnt = 6 + hitN

Re: You advice please

2008-08-13 Thread Hussein B
On Aug 13, 6:51 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080813 13:16], Hussein B ([EMAIL PROTECTED]) wrote: > > >My friends are about to open a Ruby/Rails shop and they are asking me > >to join them. > > I hope they are fully

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-13 Thread Nigel Rantor
Jonathan Gardner wrote: [...eloquent and interesting discussion of variable system snipped...] > Is Python's variable system better than perl's? It depends on which way you prefer. As for me, being a long-time veteran of perl and Python, I don't think having a complicated variable system such as

Regarding Telnet library in python

2008-08-13 Thread Hishaam
Hi, In python documentation, i found a telnet example as follows: - import getpass import sys import telnetlib HOST = "localhost" user = raw_input("Enter your remote account: ") password = getpass.getpass() tn = telnetlib.T

Re: You advice please

2008-08-13 Thread Jeroen Ruigrok van der Werven
-On [20080813 14:01], Hussein B ([EMAIL PROTECTED]) wrote: >So do you advice me to join them? I will never say yes or no to such a question. Such choices are choices only you can make since you know the whole story. Personally I found Python nicer than Ruby to program in. And I even started w

Re: format string to certain line width

2008-08-13 Thread elukkien
import textwrap print textwrap.fill("HelloWorld", 2) > He > ll > oW > or > ld > > Of course if your assertion that the string contains no spaces, tabs or > newlines turns out to be incorrect this may not do what you wanted. Thanks, i just found this myself and it works fine, but very slo

Re: __getattr__, __setattr__ and pickle

2008-08-13 Thread Bruno Desthuilliers
mwojc a écrit : Bruno Desthuilliers wrote: >>> class Prop(object): ... @apply ... def prop(): ... def fget(self): return self._prop ... def fset(self, val): self._prop = val ... return property(**locals()) ... def __init__(self, val): self.prop=val ... >>>

Re: newb loop problem

2008-08-13 Thread Larry Bates
Dave wrote: arrrggg, now I feel really dumb.. hitNum = 0 stopCnt = 6 + hitNum offSet = 5 for i in range(0,10,1): for x in range(hitNum,len(inLst), 1): print hitNum, stopCnt if x == stopCnt: break hitLst.append(inLst[x]) hitNum +=o

Re: format string to certain line width

2008-08-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Thanks, i just found this myself and it works fine, but very slow... The script without the wrapping takes 30 seconds, with wrapping 30 minutes. Is there not a more efficient way? sounds like you're wrapping a few million long strings, not just one... here are two app

Re: You advice please

2008-08-13 Thread Bruno Desthuilliers
Álvaro G. Vicario a écrit : Hussein B escribió: The sad fact (at least to me), Ruby is getting a lot of attention these days. Why Python isn't getting this attention although is a much more mature language and it is used by many big, big names? And do I dare to say it is much more charming? Th

From Ruby to Python?

2008-08-13 Thread Simon Mullis
Hi All, I just finally found 30 minutes to try and write some code in Python and realized after a couple of minor syntactic false starts that I'd finished my initial attempt without needing to refer to any documention... And after the first few minutes I stopped noticing the whitespace thing that

Re: You advice please

2008-08-13 Thread Hussein B
On Aug 13, 7:40 am, Bruno Desthuilliers wrote: > Álvaro G. Vicario a écrit : > > > > > Hussein B escribió: > >> The sad fact (at least to me), Ruby is getting a lot of attention > >> these days. > >> Why Python isn't getting this attention although is a much more mature > >> language and it is use

Re: format string to certain line width

2008-08-13 Thread John Machin
On Aug 13, 10:13 pm, [EMAIL PROTECTED] wrote: > import textwrap > print textwrap.fill("HelloWorld", 2) > > He > > ll > > oW > > or > > ld > > > Of course if your assertion that the string contains no spaces, tabs or > > newlines turns out to be incorrect this may not do what you wanted. >

Re: You advice please

2008-08-13 Thread Bruno Desthuilliers
Hussein B a écrit : Hey, I'm a Java/Java EE developer and I'm playing with Python these days. I like the Python language so much and I like its communities and the Django framework. My friends are about to open a Ruby/Rails shop and they are asking me to join them. I don't know what, sure I'm not

Re: newb loop problem

2008-08-13 Thread Sion Arrowsmith
Dave <[EMAIL PROTECTED]> wrote: >hitNum = 0 >stopCnt = 6 + hitNum >offSet = 5 > >for i in range(0,10,1): The step argument to range defaults to 1: it's tidier to omit it. Similarly, the start argument defaults to 0, so you can drop that too. for i in range(10): > for x in range(hitNum,len

Re: Manipulating Python Source

2008-08-13 Thread Wilson
On 12 Aug, 15:53, Bruno Desthuilliers wrote: > Kay Schluehr a écrit :> On 12 Aug., 16:35,Wilson<[EMAIL PROTECTED]> wrote: > >> Hi, > > >> I'm wondering if there are any tools available or simple methods for > >> taking a python source file and parsing into some hierarchical format, > >> like the C

Re: Looking out a module for Subversion

2008-08-13 Thread Fabio Zadrozny
> > I've installed Ulipad and must say it is a small nice tool. Thanks > I also want to give eclipse a try. I referred eclispe web site for this and > it does not mention what basic things need installation before you use the > Dynamic Language Toolkit. So, my question is : what combination of > pa

Re: You advice please

2008-08-13 Thread Hussein B
On Aug 13, 7:50 am, Bruno Desthuilliers wrote: > Hussein B a écrit : > > > Hey, > > I'm a Java/Java EE developer and I'm playing with Python these days. > > I like the Python language so much and I like its communities and the > > Django framework. > > My friends are about to open a Ruby/Rails sho

Re: You advice please

2008-08-13 Thread Bruno Desthuilliers
Hussein B a écrit : (snip) Personally, I don't like the RoR framework at all. It doesn't come with any thing new or revolutionary, You could say the same about Python and about Django. None of them come with anything new or revolutionary. And both have warts too. they just take the hard l

Re: Logging library unicode problem

2008-08-13 Thread Patrol Sun
What's your system? Simple Chinese Windows??? 2008/8/13 Victor Lin <[EMAIL PROTECTED]> > Hi, > I'm writting a application using python standard logging system. I > encounter some problem with unicode message passed to logging library. > I found that unicode message will be messed up by logging ha

Re: Regarding Telnet library in python

2008-08-13 Thread Simon Mullis
Hi there, This works (but bear in mind I'm about only 30 minutes into my Python adventure...): -- def connect(host): tn = telnetlib.Telnet(host) return tn def login(session,user,password): session.write("\n") session.read_until("Login: ") sessi

Re: Perl to Python using MqSQLdb

2008-08-13 Thread Mike P
That is a nice piece of code, I cracked the idea of the shift; problem, my final problem is still how to convert my @row = $sth->fetchrow_array; $$StartDate = $row[0]; $$EndDate = $row[1]; $sth->finish() into python code as i'm not sure what $$ means Any help on this final part woul

Re: Perl to Python using MqSQLdb

2008-08-13 Thread Fredrik Lundh
Jeroen Ruigrok van der Werven wrote: cursor=db.cursor() cursor.execute(sql) while (1): row = cursor.fetchone() if row == None: break combined = ', '.join(row) Why not something like: for row in cursor.fetchall(): combined = ', '.join(row) which ca

Re: Perl to Python using MqSQLdb

2008-08-13 Thread Fredrik Lundh
Mike P wrote: That is a nice piece of code, I cracked the idea of the shift; problem, my final problem is still how to convert my @row = $sth->fetchrow_array; $$StartDate = $row[0]; $$EndDate = $row[1]; $sth->finish() into python code as i'm not sure what $$ means according to a

datetime from uuid1 timestamp

2008-08-13 Thread Kent Tenney
Howdy, I have not found a routine to extract usable date/time information from the 60 bit uuid1 timestamp. Is there not a standard solution? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: relative imports improve program organization... suggestions?

2008-08-13 Thread DG
Carl: Your solution is kind of what I was leaning towards after a bit of thinking. Since I have to have the modules each have their own detect() method, then it wouldn't be too hard to have their own test() method to put them through their paces. Catrironpi: I will look into this as it might hel

Re: Regarding Telnet library in python

2008-08-13 Thread Eddie Corns
Hishaam <[EMAIL PROTECTED]> writes: >Hi, >In python documentation, i found a telnet example as follows: >- >import getpass >import sys >import telnetlib >HOST = "localhost" >user = raw_input("Enter your remote account: ") >

Corrupted images after attempting to store PNG images as BLOBs in MySQL?

2008-08-13 Thread Keith Hughitt
Hi all, I've run into a strange error while trying to store some PNG images in a MySQL database using MySQLdb. When I try to insert smaller images (< 64kb or so) everything seems to work fine. When I start trying to insert larger images (~150kb), however, the images get corrupted along the way. T

Re: Corrupted images after attempting to store PNG images as BLOBs in MySQL?

2008-08-13 Thread Fredrik Lundh
Keith Hughitt wrote: I've run into a strange error while trying to store some PNG images in a MySQL database using MySQLdb. When I try to insert smaller images (< 64kb or so) everything seems to work fine. When I start trying to insert larger images (~150kb), however, the images get corrupted al

Re: Corrupted images after attempting to store PNG images as BLOBs in MySQL?

2008-08-13 Thread Fredrik Lundh
Fredrik Lundh wrote: Silently truncating or otherwise mangling columns is a standard MySQL feature. What does the table definition look like? Oh, you did write BLOB in the subject. BLOB columns hold 64k (minus 2 bytes for housekeeping), and excess data is discarded, by default: "If strict

RE: Looking out a module for Subversion

2008-08-13 Thread Dudeja, Rajat
Hi Fabio > Download eclipse 3.3 from http://download.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800 /index.php (you can download only the > "Platform Runtime Binary" in that link) and then follow the instructions to install Pydev at http://fabioz.com/pydev/manual_101_install.html I

Re: Corrupted images after attempting to store PNG images as BLOBs in MySQL?

2008-08-13 Thread Keith Hughitt
Thanks Fredrik. That certainly explains things :) I also appreciate the suggestion on coding guidelines: I'm still becoming familiar with python. Originally we were not using the database to store images, but we started testing out storing images there as well as meta-data. We may end up switching

Re: You advice please

2008-08-13 Thread D'Arcy J.M. Cain
On Wed, 13 Aug 2008 13:47:58 +0200 "Álvaro G. Vicario" <[EMAIL PROTECTED]> wrote: > But I've never came across a Ruby app. Sure, I know Ruby exists and > people are very enthusiastic about it (though they often mistake it with > Ruby on Rails), but that's all. > > Ruby is popular among bloggers

Using trace module from command line

2008-08-13 Thread Alexandru Palade
Hi, I'm trying to profile an application and I want to test the trace module from command line but I can't really get it working. I have generated a result file with the command python -m trace --count --file blah.blah main.py -a us -c ../../conf/config.xml and then tried to read it using py

Re: You advice please

2008-08-13 Thread Calvin Spealman
Ruby (on Rails) people love to talk about Ruby (on Rails). Python people are too busy getting things done to talk as loudly. On Wed, Aug 13, 2008 at 11:04 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Wed, 13 Aug 2008 13:47:58 +0200 > "Álvaro G. Vicario" <[EMAIL PROTECTED]> wrote: >> But I

Re: dict.update() useful or not?

2008-08-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >What do other people find? Do you find use for dict.update()? What other >idioms do you use for combining dictionaries? My company's code relies heavily on d.update() -- it's extremely handy in the context of a web for

Re: Corrupted images after attempting to store PNG images as BLOBs in MySQL?

2008-08-13 Thread GHUM
Keith, > still becoming familiar with python. Originally we were not using the > database to store images, > but we started testing out storing images there as well as meta-data. just a remark: I am using PostgreSQL to store BLOB-Data as there are "Images", "PDFs", "Microsoft Office Files". The

Re: You advice please

2008-08-13 Thread Nigel Rantor
Calvin Spealman wrote: Ruby (on Rails) people love to talk about Ruby (on Rails). Python people are too busy getting things done to talk as loudly. Have you read this list? I would suggest your comment indicates not. Throwaway comments like yours that are pithy, emotional and devoid of any

RE: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Cousson, Benoit
> Defining it as a nested class saves you one line > of code, but IMHO makes the result just a bit more cluttered, while > reducing the elegance of reusing the metaclass. The whole point of nested class is to avoid polluting the namespace with classes that are only used locally. So the argument a

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Calvin Spealman
On Wed, Aug 13, 2008 at 11:32 AM, Cousson, Benoit <[EMAIL PROTECTED]> wrote: >> Defining it as a nested class saves you one line >> of code, but IMHO makes the result just a bit more cluttered, while >> reducing the elegance of reusing the metaclass. > > The whole point of nested class is to avoid

Re: You advice please

2008-08-13 Thread Calvin Spealman
God forbid I try to make a joke. On Wed, Aug 13, 2008 at 11:20 AM, Nigel Rantor <[EMAIL PROTECTED]> wrote: > Calvin Spealman wrote: >> >> Ruby (on Rails) people love to talk about Ruby (on Rails). >> >> Python people are too busy getting things done to talk as loudly. > > Have you read this list?

Re: You advice please

2008-08-13 Thread Fredrik Lundh
Nigel Rantor wrote: Throwaway comments like yours that are pithy, emotional and devoid of any factual content are just the kind of thing that makes lists such as this less useful than they could be. Oh, please. It's a fact that Python advocacy is a lot more low-key than the advocacy of cert

Re: You advice please

2008-08-13 Thread Ken Starks
Hussein B wrote: Hey, I'm a Java/Java EE developer and I'm playing with Python these days. I like the Python language so much and I like its communities and the Django framework. My friends are about to open a Ruby/Rails shop and they are asking me to join them. I don't know what, sure I'm not le

Re: You advice please

2008-08-13 Thread Nigel Rantor
Fredrik Lundh wrote: Nigel Rantor wrote: Throwaway comments like yours that are pithy, emotional and devoid of any factual content are just the kind of thing that makes lists such as this less useful than they could be. Oh, please. It's a fact that Python advocacy is a lot more low-key than

Re: You advice please

2008-08-13 Thread Nigel Rantor
Calvin Spealman wrote: God forbid I try to make a joke. Ah, sorry, sense of humour failure for me today obviously. n -- http://mail.python.org/mailman/listinfo/python-list

RE: You advice please

2008-08-13 Thread Michael . Coll-Barth
> -Original Message- > From: Calvin Spealman > > God forbid I try to make a joke. No kidding! As a lurker newbie, I don't mind one bit. Actually, I have yet to meet a person that codes in Ruby that doesn't also do Python. I have met many Python coders that have never even looked at

Re: Psycho question

2008-08-13 Thread Paul Boddie
On 8 Aug, 20:36, John Krukoff <[EMAIL PROTECTED]> wrote: > > One possibility for the performance difference, is that as I understand > it the psyco developer has moved on to working on pypy, and probably > isn't interested in keeping psyco updated and optimized for new python > syntax. More here o

Re: You advice please

2008-08-13 Thread Alia Khouri
Hussein B wrote: > I'm a Java/Java EE developer and I'm playing with Python these days. > I like the Python language so much and I like its communities and the > Django framework. Sounds familiar... (-: > My friends are about to open a Ruby/Rails shop and they are asking me > to join them. In t

Re: xcompile patch for python 2.5.2?

2008-08-13 Thread Paul Boddie
On 12 Aug, 19:30, "Stephen Cattaneo" <[EMAIL PROTECTED]> wrote: > > A friend of mine is attempting to cross compile python 2.5.2 onto a > MIPS64 box. He is asking if there is a cross compile patch for 2.5.2. > Do any of you know where He might find such a thing? Try here: http://bugs.python.org/

Re: datetime from uuid1 timestamp

2008-08-13 Thread gordyt
Howdy Kent, Interesting question! Give this a shot: import datetime import time import uuid # get offset in seconds between the UUID timestamp Epoch (1582-10-15) and # the Epoch used on this computer DTD_SECS_DELTA = (datetime.datetime(*time.gmtime(0)[0:3])- datetime.datetime(1582, 10, 15)).day

Python Variable System

2008-08-13 Thread Jonathan Gardner
Nigel Rantor wrote: The Python system is the same as the Java system, apart from Java's primitive types, which is a completely different discussion that I really don't want to get into right now. So, everything is by reference. I am not too familiar with Java's system. I understand, and ag

Calling "def" functions from another file.

2008-08-13 Thread frankrentef
Newbie here I'm writing a Python program that has "def" functionality growing in leaps and bounds. I'm a newbie to Python so be detailed. Is there a way to create a py file with all the "def's" listed and just call them from the "program" py file? How would I do this? Say my "def" py file

Replace Several Items

2008-08-13 Thread gjhames
I wish to replace several characters in my string to only one. Example, "-", "." and "/" to nothing "" I did like that: my_string = my_string.replace("-", "").replace(".", "").replace("/", "").replace(")", "").replace("(", "") But I think it's a ugly way. What's the better way to do it? -- http:/

Re: Corrupted images after attempting to store PNG images as BLOBs in MySQL?

2008-08-13 Thread Álvaro G. Vicario
*** Fredrik Lundh escribió/wrote (Wed, 13 Aug 2008 16:46:04 +0200): > Oh, you did write BLOB in the subject. BLOB columns hold 64k (minus 2 > bytes for housekeeping), and excess data is discarded, by default: > > "If strict SQL mode is not enabled and you assign a value to a BLOB or > TEXT colu

Factory for Struct-like classes

2008-08-13 Thread eliben
Hello, I want to be able to do something like this: Employee = Struct(name, salary) And then: john = Employee('john doe', 34000) print john.salary Basically, Employee = Struct(name, salary) should be equivalent to: class Employee(object): def __init__(self, name, salary): self.name = na

Re: gasp

2008-08-13 Thread Simon Brunning
2008/8/13 kumwaka <[EMAIL PROTECTED]>: > I am a beginner in Python. Please tell me how to go about in > downloading and installing the module gasp.I am using Python 2.5.2. Does this work? easy_install gasp -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: si

Re: Calling "def" functions from another file.

2008-08-13 Thread Benjamin Kaplan
On Wed, Aug 13, 2008 at 12:37 PM, frankrentef <[EMAIL PROTECTED]> wrote: > Newbie here > > I'm writing a Python program that has "def" functionality growing in > leaps and bounds. I'm a newbie to Python so be detailed. Is there a > way to create a py file with all the "def's" listed and just

Tkinter updates - Easiest way to install/use Tile?

2008-08-13 Thread Mudcat
So I haven't programmed much in Python the past couple of years and have been catching up the last few days by reading the boards. I'll be making commercial Python applications again and wanted to see what's new in the Gui department. I started using Tkinter several years ago and have a lot of stu

strptime and timezones

2008-08-13 Thread Tom Anderson
Hello! Possibly i'm missing something really obvious here. But ... If i have a date-time string of the kind specified in RFC 1123, like this: Tue, 12 Aug 2008 20:48:59 -0700 Can i turn that into a seconds-since-the-epoch time using the standard time module without jumping through substantial

RE: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Cousson, Benoit
> > There is no point of nested classes because nested classes _are not_ > supported by python. They are simply an artifact of not actively > denying the syntax non-globally. I would fully support a change to the > language to actively forbid a class definition that is not > module-level. > > > I

Re: strptime and timezones

2008-08-13 Thread Christian Heimes
Tom Anderson wrote: Secondly, do you really have to do this just to parse a date with a timezone? If so, that's ridiculous. No, you don't. :) Download the pytz package from the Python package index. It's *the* tool for timezone handling in Python. The time zone definition are not part of the

Hide raw_input text?

2008-08-13 Thread tmallen
I'm working on a little FTP project to get comfortable with ftplib. It's all terminal-based right now, and one issue I'm having is hiding password input text. I'd like one of two things to happen with this: Either don't show any characters while I'm typing (like $ su), or better, a '*' for every ch

Re: Factory for Struct-like classes

2008-08-13 Thread Michele Simionato
On Aug 13, 6:43 pm, eliben <[EMAIL PROTECTED]> wrote: > Hello, > > I want to be able to do something like this: > > Employee = Struct(name, salary) > > And then: > > john = Employee('john doe', 34000) > print john.salary > > Basically, Employee = Struct(name, salary) should be equivalent to: > > cl

win32service and Python

2008-08-13 Thread David
I am collecting informations about win32 services for Python but, except for few basic examples about Mark Hammond's win32serviceutil, I found nothing useful. Any link is welcome. Thank you. David -- http://mail.python.org/mailman/listinfo/python-list

Re: Factory for Struct-like classes

2008-08-13 Thread Christian Heimes
eliben wrote: Ruby's 'Scruct' class (http://ruby-doc.org/core/classes/Struct.html) does this. I suppose it can be done with 'exec', but is there a more Pythonic way ? Try named tuple http://code.activestate.com/recipes/500261/ A named tuple implementation is part of Python 2.6 and 3.0. For ol

Re: Replace Several Items

2008-08-13 Thread bearophileHUGS
gjhames: > What's the better way to do it? Better is a relative term. If with better you mean "faster" (in some circumstances), then the translate method is your friend, as you can see its second argument are the chars to be removed. As first argument you can use something like: "".join(map(chr, x

  1   2   3   >