Re: python needs leaning stuff from other language

2009-04-04 Thread Robert Kern
On 2009-04-03 23:48, Tim Wintle wrote: On Fri, 2009-04-03 at 18:27 -0500, Robert Kern wrote: agreed. If .clear was to be added then really assignments to slices should be entirely removed. Please tell me you are joking. Well I'm not joking as such. I've noticed that python-ideas seems to be

Re: Problem understanding some unit tests in Python distribution

2009-04-04 Thread Peter Otten
André wrote: > Hi everyone, > > In the hope of perhaps contributing some additional unit tests for > Python (thus contributing back to the community), I dove in the code > and found something that should be simple but that I can not wrap my > head around. > > In list_tests.py, one finds > === >

Re: Module caching

2009-04-04 Thread Graham Dumpleton
On Apr 4, 10:41 am, Jon Clements wrote: > On 3 Apr, 23:58, Aaron Scott wrote: > > > > 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 wan

TODAY April 4 -Guido & Python 3000 @ Global FSW Voice Meeting BerkeleyTIP -Linus,Guido,Shuttleworth...

2009-04-04 Thread john_re
Guido - Python 3000 video. 5PM Python hour Anyone: Please email me or the BTIP list if you know of any recent (past 12 months) Python videos. Thanks. :) Join with the friendly, productive, Global FSW community, in the _TWICE_ monthly, Voice over internet meeting, BerkeleyTIP-Global. GNU(Linu

Re: how to optimize zipimport

2009-04-04 Thread Coonay.appspot
On Apr 2, 6:26 pm, John Machin wrote: > On Mar 30, 11:39 pm, Coonay wrote: > > > > > On Mar 26, 1:38 pm, John Machin wrote: > > > > On Mar 26, 2:06 pm, Coonay wrote: > > > > > On Mar 26, 10:41 am, Coonay wrote: > > > > > > in my mudule ,i import another mudule from a zip , > > > > > > when i c

Re: Hash of None varies per-machine

2009-04-04 Thread Thomas Bellman
Steven D'Aprano wrote: > You can hash numbers no matter how big they are. > >>> hash(float('inf')) > 314159 Cute. And hash(float('-inf')) is -271828... -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "God is real, but Jesus is an integer." ! bellman @ lysa

Re: Problem understanding some unit tests in Python distribution

2009-04-04 Thread André
On Apr 4, 4:38 am, Peter Otten <[email protected]> wrote: > André wrote: > > Hi everyone, > > > In the hope of perhaps contributing some additional unit tests for > > Python (thus contributing back to the community), I dove in the code > > and found something that should be simple but that I can not

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

2009-04-04 Thread '2+
anyway i found: http://code.google.com/p/python-twitter/ and http://mike.verdone.ca/twitter/ and both were easy to install on intrepid .. but didn't work python-twitter did work by manually downloading: http://python-twitter.googlecode.com/svn/trunk/twitter.py well but it seems like i have to fol

How to free /destroy object created by PyTuple_New

2009-04-04 Thread grbgooglefan
I am using PyTuple_New to pass function arguments to PyObject_CallObject for execution of a Python function. How can I free up the memory and object allocated by the PyTuple_New function? I am using Python interpreter in my multi-threaded C application & at load condition my application crashes

Re: "Pythoner",Wish me luck!

2009-04-04 Thread Hendrik van Rooyen
"barisa" wrote: >Hi, >I'm also begginer in python; >i did few basic programs about graph etc.. > >my question is : what benefit is using interactive intrepreter ? > >i come from java backround, so I use eclipse for python as well. >I start my program, it does it's job, and that's it. (after som

PyFunction_New examples

2009-04-04 Thread Trigve
Hi, I'm trying to use PyFunction_New() function but I've problem finding out how it works. What I'm trying to do is to create python function on the fly and then trying to create function object from if via PyFunction_New. My problems are similar to this: http://article.gmane.org/gmane.comp.pytho

statvfs clearance

2009-04-04 Thread Sreejith K
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 size. statvfs.F_BLOCKS Total number of blocks in the filesystem. s

Re: Hash of None varies per-machine

2009-04-04 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: On Fri, 03 Apr 2009 10:50:08 -0700, ben.taylor wrote: >> 2. Should the hash of None vary per-machine? I can't think why you'd >> write code that would rely on the value of the hash of None, but you >> might I guess. > >The value of hash(None) appears to be the value of i

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: is there a way to collect twitts with python?

2009-04-04 Thread Hendrik van Rooyen
"Dennis Lee Bieber" wrote: > Given the subject line -- my first thought was "Depends on the > density of the twitt population, and how hungry the python is" I see that everybody is politically correctly maintaining the three "t" twitt spelling, instead of yielding to the obvious temptation to

Re: Undefined symbol PyUnicodeUCS2_DecodeUTF8

2009-04-04 Thread Diez B. Roggisch
Manish Jain schrieb: Hi all, I am using Gnome on FreeBSD 7.1. A few days back, my gnome crashed and I have had to spend over 4 days recovering my gnome environment. Pretty much everything is okay now except for a few python-dependent applications (alacarte, for instance), which exit immediat

Re: User or UserManager ? Problems of Observer Pattern

2009-04-04 Thread 一首诗
Thanks for your advice. I studied python from the tutorial and the library manual, and I think I am familiar enough with Python's grammar and API. That's why I never thought I need to read a book of Python. But if "Programming Python" also explains OO, I would be happy to read it. In fact, I am

Re: django model problem

2009-04-04 Thread Dave Angel
Mark wrote: 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: A design problem I met again and again.

2009-04-04 Thread 一首诗
That's clever. I never thought of that. Not only something concrete, like people, could be class, but a procedure, like a Session, could also be a Class. Thanks for you all who replied. I learned a lot from this thread and I even made some notes of all your advices because I think I might revie

[ANN] Pyro 3.9 released

2009-04-04 Thread Irmen de Jong
Hi, Pyro 3.9 has been released! Pyro is a an advanced and powerful Distributed Object Technology system written entirely in Python, that is designed to be very easy to use. Have a look at http://pyro.sourceforge.net for more information. Highlights of this release are: - improved compatibili

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-04 Thread Dikkie Dik
> Anybody have a solution for Windows (XP) Explorer search not finding > ordinary text in *.py files? This is a known issue. You won't be able to search PHP or even VBScript files either, as they are not "known" text formats and are therefore considered "binary, nothing to see here, move along p

Re: Hash of None varies per-machine

2009-04-04 Thread Steven D'Aprano
On Sat, 04 Apr 2009 13:09:06 +0200, Hendrik van Rooyen wrote: >>Any object can be hashed if it has a working __hash__ method. There's no >>reason not to have None hashable -- it costs nothing and allows you to >>use None as a dict key. > > So what happens if I try to pickle the dict and keep it f

Re: PEP 382: Namespace Packages

2009-04-04 Thread Martin v. Löwis
> -0 > > My main concern is that we'll start seeing all kinds of packages with > names like: > > com.dusinc.sarray.ptookkit.v_1_34_beta.btree.BTree > > The current lack of global package namespace effectively prevents > bureaucratic package naming, which in my mind makes it worth the > cost. Ho

Re: A design problem I met again and again.

2009-04-04 Thread andrew cooke
Note sure who wrote: >> > 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

Re: PEP 382: Namespace Packages

2009-04-04 Thread Martin v. Löwis
Neal Becker wrote: > While solving this problem, is it possible also to address an issue that > shows up in certain distributions? I'm specifically talking about the fact > that on Redhat/Fedora, we have on x86_64 both /usr/lib/pythonxx/ and > /usr/lib64/pythonxx. The former is supposed to be

Re: A design problem I met again and again.

2009-04-04 Thread andrew cooke
andrew cooke wrote: [...] >>> > #= >>> > def start(type, id): >>> > if(type == "XXX"): >>> > pass >>> > else if(type == "YYY"): >>> > pass >>> > #= i just realised i am assuming type is a type of an object, but you might be us

Re: how to optimize zipimport

2009-04-04 Thread John Machin
On Apr 4, 7:06 pm, "Coonay.appspot" wrote: > On Apr 2, 6:26 pm, John Machin wrote: [snip] > > > i found the the module in the zip reloaded  everytime the code is > > > called,i mean, say ,first time it take me 1 second to call a method in > > > the zip,but it take another 1 second to call the mot

Re: python needs leaning stuff from other language

2009-04-04 Thread Giampaolo Rodola'
On 4 Apr, 04:19, Steven D'Aprano wrote: > On Fri, 03 Apr 2009 18:52:52 -0700, Giampaolo Rodola' wrote: > > If "there should be one-- and preferably only one --obvious way to do > > it" then my_list.clear() is more obvious than del my_list[:]. Honestly > > I'm a little surprised that such a topic h

Testing dynamic languages

2009-04-04 Thread grkuntzmd
I am a Java developer. There, I said it :-). When I am writing code, I can rely on the compiler to confirm that any methods I write will be called with parameters of the "right" type. I do not need to test that parameter #1 really is a String before I call some method on it that only works on Str

Trouble with subprocess.Popen()

2009-04-04 Thread Fernando
Hi, I'm having a very strange issue with subprocess.Popen. I'm using it to call several times an external exe and keep the output in a list. Every time you call this external exe, it will return a different string. However, if I call it several times using Popen, it will always return the SAME s

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

2009-04-04 Thread Dotan Cohen
Python can in fact collect twits: http://www.johnwoodwardphotography.com/images/snake_girl_promo_13_x_19.jpg http://www.bennadel.com/resources/uploads/been_busy_at_kinky_solutions.jpg -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-

Re: Testing dynamic languages

2009-04-04 Thread Martin P. Hellwig
[email protected] wrote: If I am writing in Python, since it is dynamically, but strongly typed, I really should check that each parameter is of the expected type, or at least can respond to the method I plan on calling ("duck" typing). Every call should be wrapped in a try/except statement to

Re: statvfs clearance

2009-04-04 Thread Hrvoje Niksic
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_NAMEMAX > Maximum file name length. > > Can anyone tell me (or give me s

Re: Testing dynamic languages

2009-04-04 Thread andrew cooke
[email protected] wrote: > If I am writing in Python, since it is dynamically, but strongly > typed, I really should check that each parameter is of the expected > type, or at least can respond to the method I plan on calling ("duck" > typing). Every call should be wrapped in a try/except stateme

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-04 Thread John Machin
On Apr 4, 3:21 pm, John Doe wrote: > Anybody have a solution for Windows (XP) Explorer search not finding > ordinary text in *.py files? > Get a grep on yourself! http://gnuwin32.sourceforge.net/packages/grep.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing dynamic languages

2009-04-04 Thread Emmanuel Surleau
On Saturday 04 April 2009 15:37:44 [email protected] wrote: > I am a Java developer. There, I said it :-). > > When I am writing code, I can rely on the compiler to confirm that > any methods I write will be called with parameters of the "right" > type. I do not need to test that parameter #1 re

Re: Best way to extract from regex in if statement

2009-04-04 Thread Paul McGuire
On Apr 3, 9:26 pm, Paul Rubin wrote: > bwgoudey writes: > > elif re.match("^DATASET:\s*(.+) ", line): > >         m=re.match("^DATASET:\s*(.+) ", line) > >         print m.group(1)) > > Sometimes I like to make a special class that saves the result: > >   class Reg(o

Re: How to free /destroy object created by PyTuple_New

2009-04-04 Thread Andrew Svetlov
To destroy every python object you need to call Py_DECREF. To call python code fron you C thread you need to use pair PyGILState_Ensure/PyGILState_Release. -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-04 Thread gert
On Apr 4, 12:58 am, Lawrence D'Oliveiro wrote: > In message <8bc55c05-19da-41c4- > > [email protected]>, gert wrote: > >     with open('com1', 'r') as f: > >         for line in f: > >              print('line') > > Why bother, why not just > >     for line in open('co

Re: Testing dynamic languages

2009-04-04 Thread andrew cooke
andrew cooke wrote: > if you are going to do that, stay with java. seriously - i too, am a java > developer about half the time, and you can make java pretty dynamic if you > try hard enough. look at exploiting aspects and functional programming > libraries, for example. also, of course, scala.

Re: Testing dynamic languages

2009-04-04 Thread Luis Gonzalez
On Apr 4, 11:17 am, Emmanuel Surleau wrote: > On Saturday 04 April 2009 15:37:44 [email protected] wrote: > > > I am a Java developer. There, I said it :-). Don't worry. I also do terrible things to support my family... -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-04 Thread [email protected]
On Apr 4, 12:21 am, John Doe wrote: > Anybody have a solution for Windows (XP) Explorer search not finding > ordinary text in *.py files? > > Thanks. Googling turns up this. http://www.pcmag.com/article2/0,4149,1206399,00.asp I haven't tried it myself. -- http://mail.python.org/mailman/listinfo/

Re: python needs leaning stuff from other language

2009-04-04 Thread Paul McGuire
On Apr 3, 11:48 pm, Tim Wintle wrote: > del mylist[:] > * or * > mylist[:] = [] > * or * > mylist = [] > > which, although semantically similar are different as far as the > interpreter are concerned (since two of them create a new list): > Only the last item creates a new list of any consequence

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

2009-04-04 Thread gert
On Apr 3, 10:10 pm, Christian Heimes wrote: > 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

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: python needs leaning stuff from other language

2009-04-04 Thread Zamnedix
On Apr 3, 8:48 am, Steven D'Aprano wrote: > On Fri, 03 Apr 2009 08:23:22 -0700, Zamnedix wrote: > > On Apr 2, 3:25 pm, [email protected] wrote: > >> python's list needs a thing  list.clear()  like c# arraylist and > >> python needs a writeline() method > > > Please don't post things like li

Re: statvfs clearance

2009-04-04 Thread Dave Angel
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_NAMEMAX Maximum file name length. Can anyon

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

2009-04-04 Thread Kushal Kumaran
On Fri, 03 Apr 2009 22:10:36 +0200 Christian Heimes wrote: > 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

Why doesn't StopIteration get caught in the following code?

2009-04-04 Thread grocery_stocker
Given the following [cdal...@localhost ~]$ python Python 2.4.3 (#1, Oct 1 2006, 18:00:19) [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def counter(): ... mylist = range(3) ... for i in mylist: ... yield i*i .

lxml and xslt extensions

2009-04-04 Thread dasacc22
Hi, Im not sure where else to ask this. But basically Im having trouble figuring out how to successfully apply multiple extensions in a single transformation. So for example if i have in my xsl and my xslt extension looks like class TagExtension(etree.XSLTExtension): def execute( ..., ou

Re: Why doesn't StopIteration get caught in the following code?

2009-04-04 Thread Dave Angel
grocery_stocker wrote: Given the following [cdal...@localhost ~]$ python Python 2.4.3 (#1, Oct 1 2006, 18:00:19) [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 Type "help", "copyright", "credits" or "license" for more information. def counter(): ... mylist = range(3) ... fo

Re: Why doesn't StopIteration get caught in the following code?

2009-04-04 Thread andrew cooke
grocery_stocker wrote: while True: > ...i = gen.next() > ...print i > ... > 0 > 1 > 4 python's magic isn't as magic as you hope. roughly speaking, it only does the necessary rewriting (writing the equivalent code with next etc etc) when you define a function or a method that contains

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-04 Thread Dave Angel
John Doe wrote: Tim Golden wrote: Now I think about it, try searching for "xplorer2" since I think I mentioned that I have used that instead of explorer for some while. Yeah... at least by the time I move from Windows XP to Windows 7, very likely I will be using a different file manag

Re: lxml and xslt extensions

2009-04-04 Thread dasacc22
On Apr 4, 11:31 am, dasacc22 wrote: > Hi, > > Im not sure where else to ask this. But basically Im having trouble > figuring out how to successfully apply multiple extensions in a single > transformation. So for example if i have > > > > > > > > in my xsl and my xslt extension looks like > >

Re: Hash of None varies per-machine

2009-04-04 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: >Seems to me you have misunderstood the way pickling works. Yeah right - have you ever looked at the pickle code? Good to hear it "just works" :-) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-04 Thread Bradley Wright
Just to pimp my own wares: http://github.com/bradleywright/yatcip/tree/master A Python Twitter client. -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing dynamic languages

2009-04-04 Thread Francesco Bochicchio
On Sat, 04 Apr 2009 07:37:44 -0700, grkuntzmd wrote: > I am a Java developer. There, I said it :-). > > When I am writing code, I can rely on the compiler to confirm that > any methods I write will be called with parameters of the "right" > type. I do not need to test that parameter #1 really is

Re: Testing dynamic languages

2009-04-04 Thread Tim Wintle
On Sat, 2009-04-04 at 06:37 -0700, [email protected] wrote: > If I am writing in Python, since it is dynamically, but strongly > typed, I really should check that each parameter is of the expected > type, or at least can respond to the method I plan on calling ("duck" > typing). Every call should

Re: python needs leaning stuff from other language

2009-04-04 Thread Tim Wintle
On Sat, 2009-04-04 at 02:03 -0500, Robert Kern wrote: > > Let's be clear: python-ideas seems positive on the idea of adding a .clear() > method. *Completely removing* slice assignment has not been broached there. Yup, sorry - I did mean to refer to the initial suggestion, rather than my comments

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

2009-04-04 Thread gert
On Apr 4, 5:20 pm, Kushal Kumaran wrote: > On Fri, 03 Apr 2009 22:10:36 +0200 > > Christian Heimes wrote: > > 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 p

Re: Testing dynamic languages

2009-04-04 Thread grkuntzmd
This may be obvious but, clearly there are (at least) two general types of errors: those caused by data external to the program and those caused by bugs in the program. For all inputs coming into the program from outside, such as user inputs and data coming over a network, the inputs must be comple

Re: django model problem

2009-04-04 Thread Mark
> > Anyway, since I don't have time to actually install and configure Django > to experiment, I'd suggest you post a query on the django-users mailing > list, at http://groups.google.com/group/django-users Yes, that's what I did - it seems my problem is either a tough one, or it's just impossi

Re: Hash of None varies per-machine

2009-04-04 Thread Peter Pearson
On 03 Apr 2009 10:57:05 -0700, Paul Rubin wrote: > [email protected] 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 lon

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

2009-04-04 Thread Gabriel Genellina
En Sat, 04 Apr 2009 11:29:22 -0300, gert escribió: On Apr 4, 12:58 am, Lawrence D'Oliveiro wrote: In message <8bc55c05-19da-41c4- [email protected]>, gert wrote: >     with open('com1', 'r') as f: >         for line in f: >              print('line') Why bother,

Best Compatible JS Lib for Django

2009-04-04 Thread ntwrkd
Does anyone have experience with using JS Libraries with Django? Do some work better than others and are easier to code with? TIV -- http://mail.python.org/mailman/listinfo/python-list

Re: dict view to list

2009-04-04 Thread Aahz
In article <6b4065b0-6af7-4aff-8023-40e5d521f...@v19g2000yqn.googlegroups.com>, Luis Gonzalez wrote: > >Yes, I know the python approach is to use built-ins. >But wouldn't it be cool if we could do mydict.values().tolist() >instead? >It would be more regular and intuitive and readable from an OO p

Generators/iterators, Pythonicity, and primes

2009-04-04 Thread John Posner
Inspired by recent threads (and recalling my first message to Python edu-sig), I did some Internet searching on producing prime numbers using Python generators. Most algorithms I found don't go for the infinite, contenting themselves with "list all the primes below a given number". Here's a very P

Re: lxml and xslt extensions

2009-04-04 Thread Stefan Behnel
Hi, dasacc22 wrote: > On Apr 4, 11:31 am, dasacc22 wrote: >> Im not sure where else to ask this. The best place to ask is the lxml mailing list: http://codespeak.net/mailman/listinfo/lxml-dev >> But basically Im having trouble >> figuring out how to successfully apply multiple extensions in a

Can't one collect twitts and twits in any language?

2009-04-04 Thread Casey Hawthorne
:) -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-04 Thread John Doe
Dave Angel wrote: > John Doe wrote: >> ...at least by the time I move from Windows XP to Windows 7, >> very likely I will be using a different file manager. If I cannot >> search Python files, now might be a good time to switch. > and the product xplorer2 is athttp://zabkat.com/ > Std versio

Re: Generators/iterators, Pythonicity, and primes

2009-04-04 Thread Mark Tolonen
"John Posner" wrote in message news:af9fbcc3a7624599a6f51bad2397e...@amdup... Inspired by recent threads (and recalling my first message to Python edu-sig), I did some Internet searching on producing prime numbers using Python generators. Most algorithms I found don't go for the infinite, cont

Re: python needs leaning stuff from other language

2009-04-04 Thread Diez B. Roggisch
Tim Wintle schrieb: On Sat, 2009-04-04 at 02:03 -0500, Robert Kern wrote: Let's be clear: python-ideas seems positive on the idea of adding a .clear() method. *Completely removing* slice assignment has not been broached there. Yup, sorry - I did mean to refer to the initial suggestion, rather

Re: Best Compatible JS Lib for Django

2009-04-04 Thread Daniel Fetchinson
> Does anyone have experience with using JS Libraries with Django? > Do some work better than others and are easier to code with? You might want to ask this on the django list. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/lis

RE: Generators/iterators, Pythonicity, and primes

2009-04-04 Thread John Posner
Mark Tolonen said: >> p <= sqrt(n) works a little better :^) >> >> -Mark >> Right you are -- I found that bug in my last-minute check, and then I forgot to trannscribe the fix into the email message. Duh -- thanks! -John E-mail message checked by Spyware Doctor (6.0.0.386) Database

Re: Testing dynamic languages

2009-04-04 Thread bearophileHUGS
grkunt...: > If I am writing in Python, since it is dynamically, but strongly > typed, I really should check that each parameter is of the expected > type, or at least can respond to the method I plan on calling ("duck" > typing). Every call should be wrapped in a try/except statement to > prevent

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

2009-04-04 Thread Diez B. Roggisch
gert schrieb: On Apr 3, 10:10 pm, Christian Heimes wrote: 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 stil

Re: python needs leaning stuff from other language

2009-04-04 Thread Robert Kern
On 2009-04-04 12:07, Tim Wintle wrote: On Sat, 2009-04-04 at 02:03 -0500, Robert Kern wrote: Let's be clear: python-ideas seems positive on the idea of adding a .clear() method. *Completely removing* slice assignment has not been broached there. Yup, sorry - I did mean to refer to the initial

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

2009-04-04 Thread Christian Heimes
gert wrote: > On Apr 3, 10:10 pm, Christian Heimes wrote: >> 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 pe

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

2009-04-04 Thread '2+
nice info, thanx that # stalk my stalkers example look smart i won't use that one if it was for this ml ;D On Sun, Apr 5, 2009 at 1:22 AM, Bradley Wright wrote: > Just to pimp my own wares: > > http://github.com/bradleywright/yatcip/tree/master > > A Python Twitter client. > -- > http://mail.pyth

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

2009-04-04 Thread Gabriel Genellina
En Sat, 04 Apr 2009 14:11:12 -0300, gert escribió: On Apr 4, 5:20 pm, Kushal Kumaran wrote: On Fri, 03 Apr 2009 22:10:36 +0200 Christian Heimes wrote: > gert wrote: > > I do understand, and I went looking into pySerial, but it is a long > > way from getting compatible with python3.x and i

Creating a session in windows to auth to remote machines

2009-04-04 Thread ericwoodworth
Hi, I'm trying to auth to remote machines so I can plunder WMI to get logs and settings and the like. My script works for most of my machines because they're all in the same domain and I run the script as somebody who has enough access to get at this stuff but for machines off the domain I'm

cProfile.py not found.

2009-04-04 Thread Rahul
I need to profile a slow-running code. The problem is I cannot seem to find cProfile.py. Where can I get it? Is it not included in the normal distro? I tried googling it up and theres tons of info on how to use it but no links for where to download it from. I am using Python 2.4.4 (#3, Feb 1

Re: Creating a session in windows to auth to remote machines

2009-04-04 Thread ericwoodworth
On Apr 4, 6:39 pm, [email protected] wrote: > Hi, >      I'm trying to auth to remote machines so I can plunder WMI to get > logs and settings and the like.  My script works for most of my > machines because they're all in the same domain and I run the script > as somebody who has enough acce

Re: cProfile.py not found.

2009-04-04 Thread Robert Kern
On 2009-04-04 17:46, Rahul wrote: I need to profile a slow-running code. The problem is I cannot seem to find cProfile.py. Where can I get it? Is it not included in the normal distro? I tried googling it up and theres tons of info on how to use it but no links for where to download it from. I a

Re: cProfile.py not found.

2009-04-04 Thread John Yeung
I believe cProfile was added in 2.5. Your best bet on 2.4 is probably the profile module. That is what the docs recommend. John -- http://mail.python.org/mailman/listinfo/python-list

Re: cProfile.py not found.

2009-04-04 Thread Rahul
Robert Kern wrote in news:[email protected]: > What system are you on? Some Linux distributions put it into a > separate package, like python-profile. The python.org Windows and Mac > binaries should have it, though. > > THanks Robert. I'm on RHEL. Tried

[RELEASED] Python 3.1 alpha 2

2009-04-04 Thread Benjamin Peterson
On behalf of the Python development team, I'm thrilled to announce the second alpha release of Python 3.1. Python 3.1 focuses on the stabilization and optimization of features and changes Python 3.0 introduced. For example, the new I/O system has been rewritten in C for speed. Other features inc

Re: cProfile.py not found.

2009-04-04 Thread Robert Kern
On 2009-04-04 18:08, John Yeung wrote: I believe cProfile was added in 2.5. Your best bet on 2.4 is probably the profile module. That is what the docs recommend. Oops, I missed that piece of information. Alternately, the OP can install lsprof, which was cProfile's third-party incarnation bef

Re: cProfile.py not found.

2009-04-04 Thread John Machin
On Apr 5, 8:46 am, Rahul wrote: > I need to profile a slow-running code. The problem is I cannot seem to find   > cProfile.py. > > Where can I get it? Is it not included in the normal distro? I tried > googling it up and theres tons of info on how to use it but no links for > where to download it

possible pairings in a set

2009-04-04 Thread Ross
I'm new to python and I'm trying to come up with a function that takes a given number of players in a game and returns all possible unique pairings. Here's the code I've come up with so far, but I'm not getting the output I'd like to: def all_pairings(players): cleanlist = [] for i

Re: what does "execfile" mean within profiler output and why does it not have a attached line number

2009-04-04 Thread John Machin
On Apr 5, 9:56 am, Rahul wrote: > "profile" tells me that most of my runtime was spent in just one part (1.28 > sec cumulatively out of 1.29 secs. But what is "execfile"? I don't see this > as a function call with my python code. Also what's the 0 in the snippet:   > ":0(execfile)"? Isn't there su

Re: possible pairings in a set

2009-04-04 Thread Benjamin Peterson
Ross gmail.com> writes: > Can you guys help me out? Do you have Python 2.6? If so, it's a solved problem. :) import itertools possible_pairings = list(itertools.combinations(players, 2)) -- http://mail.python.org/mailman/listinfo/python-list

Re: cProfile.py not found.

2009-04-04 Thread Rahul
John Machin wrote in news:0a8400dc-b14b-4bb9-a608- [email protected]: > Read the fantastic manual: > > http://docs.python.org/library/profile.html [snip] > cProfile is recommended for most users; it's a C extension with > reasonable overhead that makes it suitable

Re: cProfile.py not found.

2009-04-04 Thread John Machin
On Apr 5, 9:41 am, Rahul wrote: > John Machin wrote in news:0a8400dc-b14b-4bb9-a608- > [email protected]: > > > > > Read the fantastic manual: > > >http://docs.python.org/library/profile.html >  [snip] > >       cProfile is recommended for most users; it's a C extension wi

Re: cProfile.py not found.

2009-04-04 Thread Rahul
John Yeung wrote in news:c0752f32-b0cf-4fde- [email protected]: > I believe cProfile was added in 2.5. Your best bet on 2.4 is probably > the profile module. That is what the docs recommend. > Thanks John. That works. I'll use "profile" instead. -- Rahul -- http

what does "execfile" mean within profiler output and why does it not have a attached line number

2009-04-04 Thread Rahul
"profile" tells me that most of my runtime was spent in just one part (1.28 sec cumulatively out of 1.29 secs. But what is "execfile"? I don't see this as a function call with my python code. Also what's the 0 in the snippet: ":0(execfile)"? Isn't there supposed to be a line-number? Looking u

Re: cProfile.py not found.

2009-04-04 Thread Rahul
John Machin wrote in news:4c8ee09e-71e2-464a-a3c0- [email protected]: > Looks like our definitions of "read" differ :-) > Sorry. I ought to have said "skimmed" :) I guess I am one of those guilty lazy-bums that the manual refers to under <<>> -- Rahul -- http://mail

Re: what does "execfile" mean within profiler output and why does it not have a attached line number

2009-04-04 Thread Robert Kern
On 2009-04-04 18:56, Rahul wrote: "profile" tells me that most of my runtime was spent in just one part (1.28 sec cumulatively out of 1.29 secs. But what is "execfile"? I don't see this as a function call with my python code. Also what's the 0 in the snippet: ":0(execfile)"? Isn't there supposed

RE: possible pairings in a set

2009-04-04 Thread John Posner
>> Also, if my code is considered ugly or redundant by this community, >> can you make suggestions to clean it up? Python is pretty mature: if you have a simple, generic problem, the chances are that someone else has already solved it, packaging the solution in a library (or "module"). For your

Re: Python Goes Mercurial

2009-04-04 Thread Martin v. Löwis
>> 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 what you were trying to do, with the exact messages, and > we can walk

  1   2   >