Re: [Tutor] t = (1, *(2, 3))

2009-05-14 Thread Larry Riedel
> > >>> x = (2, 3) > > >>> y = (1, *x) > > File "", line 1 > > SyntaxError: can use starred expression only as assignment target > > But you can already do that without needing to extend * notation > to work like that To me the "*" notation already /appears/ to work like that: (Python 3.x) >>

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread Larry Riedel
> I'm not sure citing anything Java does is a good rationale in Python! I find the languages/platforms complementary, so I appreciate when they are not arbitrarily inconsistent with each other. Larry ___ Tutor maillist - Tutor@python.org http://mail.

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread Larry Riedel
It may not be a good reason, but I like that "open" is preferred, because in Java a "File" object is not a stream for the content in the file, just its directory entry, and simply creating a File object does not open the file at all. Larry ___ Tutor mai

Re: [Tutor] Can you help me with subprocess module ?.

2009-02-03 Thread Larry Riedel
> I have a problem with the subprocess module. In fact I wish > that when I run the command with subprocess I can retrieve the > data immediately without waiting for the end of the command. > > import subprocess, os, sys > # Commande FFmpeg > com_1 = 'ffmpeg -i /home/user/path/in.avi -s 160x120 -ac

Re: [Tutor] unordered and ordered defaultdict(set)

2008-10-30 Thread Larry Riedel
> Unless my eyes are squiffy the 2nd dictionary of sets > appears ordered. I've run it with other numbers > 25 > and continue to get ordered sets but anything < 25 > results in unordered sets. A feature or a bug? No, not a feature or a bug... it would be a bug to assume the elements will be in o