Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Andrew Berg
On 2011.06.14 07:18 PM, Chris Angelico wrote: > There are many different designs of laptop keyboard. Tiny netbooks > seem to have the very worst, leaving it nearly impossible to get any > decent work done (there may be exceptions to that, but I've seen a lot > of bad netbook keyboards). My current

Re: Function within class and in modules

2011-06-16 Thread Andrew Berg
On 2011.06.15 08:57 AM, Zach Dziura wrote: > Just repeat this to yourself: Python ISN'T Java. class MainClass: def public static void main(*args): print('Am I doin' it right?') :P Or something like that. I've forgotten almost everything I learned about Java. -- http://mail.python.org

Re: How do you copy files from one location to another?

2011-06-16 Thread Andrew Berg
On 2011.06.17 12:06 AM, John Salerno wrote: > "On Windows, if dst already exists, OSError will be raised even if it > is a file.." If you try to create a file or directory that already exists on Windows, you'll get a WindowsError with error code 183: >>> os.mkdir('C:\\common\\games') Traceback (mos

Re: what happens inside?

2011-06-22 Thread Andrew Berg
On 2011.06.22 10:45 AM, Chetan Harjani wrote: > why tuples are immutable whereas list are mutable? Tuples are more efficient and more appropriate for a list of items that doesn't need to change. > why when we do x=y where y is a list and then change a element in x, y > changes too( but the same is

Re: compile 32bit application in python for use on 64bit win machine

2011-06-23 Thread Andrew Berg
On 2011.06.23 06:24 PM, miamia wrote: > Hello, > I am using 32bit win xp pro and compiling my python scripts as exe > with py2exe. Everything works ok on 32bit windows platforms. But how > can I compile my program for use on 64bit Windows? > > On 64bit windows this error occures in event log: > Act

Re: how to write to registry without admin rights on win vista/7

2011-06-24 Thread Andrew Berg
On 2011.06.24 03:48 AM, Duncan Booth wrote: > http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script Heh. On Windows 7, using 'runas' for the operation in os.startfile() gives me a normal UAC prompt. Is there any way to ask for elevation from a subprocess.Popen

Re: how to write to registry without admin rights on win vista/7

2011-06-24 Thread Andrew Berg
On 2011.06.24 03:48 AM, Duncan Booth wrote: > http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script Heh. On Windows 7, using 'runas' for the operation in os.startfile() gives me a normal UAC prompt. Is there any way to ask for elevation from a subprocess.Popen

Re: Python basic program problem

2011-06-27 Thread Andrew Berg
On 2011.06.27 02:05 AM, Amaninder Singh wrote: > Hi, > I am fairly new to python, I am trying to write simple code and It is > giving me syntax error. I am reading a book and following the > directions as it says in the book but I am not sure why it is not > working. Looks like the book you're read

Re: windows 7 create directory with read write execute permission for everybody

2011-06-27 Thread Andrew Berg
On 2011.06.26 03:57 PM, Gelonida wrote: > The reason I am asking is, that I'd like to create a directory structure > where multiple users should be allowed to read / write / create files > and directories. This may not require pywin32 - by default there's a public directory at os.environ['public'

Trying to chain processes together on a pipeline

2011-06-27 Thread Andrew Berg
I'm working on an audio/video converter script (moving from bash to Python for some extra functionality), and part of it is chaining the audio decoder (FFmpeg) either into SoX to change the volume and then to the Nero AAC encoder or directly into the Nero encoder. This is the chunk of code from my

Re: Trying to chain processes together on a pipeline

2011-06-27 Thread Andrew Berg
On 2011.06.28 01:32 AM, Peter Otten wrote: > >>> subprocess.call(["ls"], stdout=open(os.devnull, "w")) > 0 D'oh! Not sure why I was thinking os.devnull was a file object. :-[ > Start with factoring out common code into a good old function. For some reason I was thinking I would have problems doing

Re: Trying to chain processes together on a pipeline

2011-06-28 Thread Andrew Berg
On 2011.06.28 02:44 AM, Thomas Rachel wrote: > The way you work with the exception is not the very best - instead of > parsing the stringified exception, you better would trigger on > exc.winerror (it is an integer with the error number). > > Or, even better, just pas the error information contai

Is the Usenet to mailing list gateway borked?

2011-06-29 Thread Andrew Berg
I didn't get at least two messages from the "call a function every 10 seconds thread", and possibly some other messages, and I access the group via the mailing list. I use the latest stable Thunderbird, if that matters. I've only noticed this recently, and I'm still getting other messages. In fact,

Re: Is the Usenet to mailing list gateway borked?

2011-06-29 Thread Andrew Berg
On 2011.06.29 03:53 PM, Noah Hall wrote: > I think the more likely answer is that it was sent without being also > sent to python-list. Possible, but they were two messages from two different people and happened within a few hours of each other, so it could be that the two messages didn't go throug

Re: Is the Usenet to mailing list gateway borked?

2011-06-29 Thread Andrew Berg
I forgot to mention I don't have Usenet access, and Google Groups' archives don't have messages from the last couple of days, so I can't check the Usenet side. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to chain processes together on a pipeline

2011-06-30 Thread Andrew Berg
Okay, so I've refactored those except WindowsError blocks into calls to a function and fixed the os.devnull bug, but I still can't get the triple chain working. I added calls to ffmpeg_proc.stdout.close() and sox_proc.stdout.close(), but I really am not sure where to put them. The following code wo

Re: Trying to chain processes together on a pipeline

2011-07-01 Thread Andrew Berg
On 2011.07.01 02:26 AM, Peter Otten wrote: > I can't reproduce your setup, but I'd try using communicate() instead of > wait() and close(). I don't really know what communicate() does. The docs don't give much info or any examples (that explain communicate() anyway), and don't say when communicate

Re: Trying to chain processes together on a pipeline

2011-07-02 Thread Andrew Berg
This code is working: > try: > ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd, > stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')) > except WindowsError as exc: > log_windows_error(exc, queue[position].ffmpeg_cmd, 'critical') > break > if queue[pos

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Andrew Berg
On 2011.07.05 01:14 PM, sal migondis wrote: > How could a belief be wrong? Beliefs aren't subjective. One's taste in music, for example, is largely subjective and can't be right or wrong, but a belief (which has to do with facts) certainly can be. > > > What do you think will be the eventual outco

Re: embedding: how do I redirect print output?

2011-07-05 Thread Andrew Berg
On 2011.07.05 10:20 AM, Chris Angelico wrote: > You, sir, have a warped and twisted mind. > > And I love it!! > > Now to secretly put code into some module somewhere and wait for > people to start tearing their hair out wait, did I say that out > loud? from pytroll import print -- http://mail.

Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT)

2011-07-05 Thread Andrew Berg
On 2011.07.05 09:31 PM, Chris Angelico wrote: > I've said for a while that Microsoft could do far worse than to turn > Windows into a GUI that sits on top of a Unix-derived kernel. They > won't do it, though, because it would be tantamount to admitting both > that Unix is superior to Windows, AND t

Re: Microsoft GUIs

2011-07-05 Thread Andrew Berg
On 2011.07.05 11:25 PM, Chris Angelico wrote: > Suppose I gave you a computer that had GNOME ported to Windows, and > used the purplish palette that Ubuntu 10.10 uses, and had a Windows > port of bash as its most convenient terminal. Members of this list > will doubtless have no problem duck-typing

Re: Microsoft GUIs

2011-07-05 Thread Andrew Berg
On 2011.07.06 12:03 AM, Dan Stromberg wrote: > I disagree. The stuff endusers tend to use is polished to some > extent, but the backend is verging on hideous. If a developer > complains about the ugly internal structure "yeah, but you say that > just because you're a computer person / geek." Admi

Re: The end to all language wars and the great unity API to come!

2011-07-05 Thread Andrew Berg
On 2011.07.06 12:26 AM, Dennis Lee Bieber wrote: > On Tue, 05 Jul 2011 16:01:57 -0500, Andrew Berg > declaimed the following in > gmane.comp.python.general: > > > On 2011.07.05 01:14 PM, sal migondis wrote: > > > How could a belief be wrong? > > Beliefs aren&#x

Re: Implicit initialization is EVIL!

2011-07-06 Thread Andrew Berg
On 2011.07.06 11:11 AM, Steven D'Aprano wrote: > The Dead Window Sketch > == As much as I hate it when people feed trolls, that was pretty funny. -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit initialization is EVIL!

2011-07-06 Thread Andrew Berg
On 2011.07.06 01:19 PM, rantingrick wrote: > ## > The Roman Stawman Sketch > ## Nice try, but you have to use a Monty Python sketch (and you have to spell correctly :-P ). -- http://mail.python.org/mailman/listinfo/python-list

Re: Does hashlib support a file mode?

2011-07-06 Thread Andrew Berg
On 2011.07.06 12:38 PM, Phlip wrote: > Python sucks. m = md5() looks like an initial assignment, not a > special magic storage mode. Principle of least surprise fail, and > principle of most helpful default behavior fail. func() = whatever the function returns func = the function object itself (in

Re: Does hashlib support a file mode?

2011-07-06 Thread Andrew Berg
On 2011.07.06 02:07 PM, Phlip wrote: > If I call m = md5() twice, I expect two objects. You get two objects because you make the function run again. Of course, the first one is garbage collected if it doesn't have another reference. >>> m1 = hashlib.md5() >>> m2 = hashlib.md5() >>> m1 is m2 False

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.06 06:16 PM, Steven D'Aprano wrote: > Phlip wrote: > > > Note the fix also avoids comparing to None, which, as usual, is also > > icky and less typesafe! > > "Typesafe"? Are you trying to make a joke? Maybe he has a duck phobia. Maybe he denies the existence of ducks. Maybe he doesn't li

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.07 08:11 AM, Phlip wrote: > No, I was pointing out that passing a type is more ... typesafe. None is a type. >>> None.__class__ -- http://mail.python.org/mailman/listinfo/python-list

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.07 08:39 AM, Phlip wrote: > On Jul 7, 6:24 am, Andrew Berg wrote: > > On 2011.07.07 08:11 AM, Phlip wrote:> No, I was pointing out that passing a > > type is more ... typesafe. > > > > None is a type. > > I never said it wasn't. You

Re: Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread Andrew Berg
On 2011.07.07 10:21 AM, António Rocha wrote: > I'm running Python (32b) in Windows7 (at 64bits) and I would like to > know how can I check if my machine is a 32b or 64b in Python. Is it > possible? I saw a few examples (like platform) but they only provide > information about Python not the machine

Re: Programming tips :-)

2011-07-07 Thread Andrew Berg
On 2011.07.07 12:22 PM, Martin Schöön wrote: > I just found the following url in my archives at work and > thought you might enjoy it: > http://thc.org/root/phun/unmaintain.html That's awesome. > If a maintenance programmer can't quote entire Monty Python movies > from memory, he or she has *no* b

Re: Does hashlib support a file mode?

2011-07-07 Thread Andrew Berg
On 2011.07.07 08:46 PM, Steven D'Aprano wrote: > None is not a type, it is an instance. > > >>> isinstance(None, type) # is None a type? > False > >>> isinstance(None, type(None)) # is None an instance of None's type? > True > > So None is not itself a type, although it *has* a type: > > >>> type

Re: Implicit initialization is EVIL!

2011-07-08 Thread Andrew Berg
On 2011.07.07 12:29 PM, rantingrick wrote: > So you prefer to close a gazillion windows one by one? If so, why not > just code the GUI correctly from the start; by creating separate > transactions? Thereby reducing the number of windows a user must > juggle? FYI: You know the user complexity of a G

String concatenation vs. string formatting

2011-07-08 Thread Andrew Berg
Is it bad practice to use this > logger.error(self.preset_file + ' could not be stored - ' + > sys.exc_info()[1]) Instead of this? > logger.error('{file} could not be stored - > {error}'.format(file=self.preset_file, error=sys.exc_info()[1])) Other than the case where a variable isn't a string (f

Re: String concatenation vs. string formatting

2011-07-08 Thread Andrew Berg
On 2011.07.08 05:59 PM, Ben Finney wrote: > With the caveat that the formatting of that line should be using PEP 8 > indentation for clarity: PEP 8 isn't bad, but I don't agree with everything in it. Certain lines look good in chunks, some don't, at least to me. It's quite likely I'm going to be wr

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
On 2011.07.09 06:06 AM, Vinay Sajip wrote: > In a logging context at least, using the form like > > logger.debug("formatting message with %s", "arguments") > > rather than > > logger.debug("formatting message with %s" % "arguments") How would I do that with the newer formatting? I've tried: > logge

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Andrew Berg
On 2011.07.09 07:26 PM, John Salerno wrote: > I have a script that does some stuff that I want to run every day for > maybe a week, or a month. So far I've been good about running it every > night, but is there some way (using Python, of course) that I can make > it automatically run at a set time

Re: Newbie help - Programming the Semantic Web with Python

2011-07-09 Thread Andrew Berg
On 2011.07.09 08:32 PM, Bruce Whealton wrote: > Hello, > So, I got this book on Programming the Semantic Web about > the same time I started learning Python. The code seems to be > developed for python 2.7 and not 3, I believe. If you're going to learn Python 3, I suggest learning from

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.09 09:54 PM, Dennis Lee Bieber wrote: > "file" is a built-in (related to "open"). It is? What is it? >>> type(file) Traceback (most recent call last): File "", line 1, in NameError: name 'file' is not defined I don't see it in

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.09 09:54 PM, Dennis Lee Bieber wrote: > "file" is a built-in (related to "open"). Also: > Traceback (most recent call last): File > "C:\Users\Bahamut\workspace\Disillusion\disillusion.py", line 178, in > save_preset() File > "C:\Users\

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.09 11:04 PM, Andrew Berg wrote: > > Is barf built-in as well? > That came off more hostile than I wanted, so I'll rephrase it: I doubt it has anything to do with built-ins, since it fails on a variable name that obvi

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 12:55 AM, Dennis Lee Bieber wrote: > Maybe it's been removed, but from the help file for my installation help(file) returns a NameError in 3.2. It shows up as a built-in function in the 2.7 docs, but not in the py3k docs. It's not me

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 How should I go about switching from concatenation to string formatting for this? avs.write(demux_filter + field_filter + fpsin_filter + i2pfilter + dn_filter + fpsout_filter + trim_filter + info_filter) I can think of a few ways, but none of th

Re: String concatenation vs. string formatting

2011-07-10 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 02:23 AM, Vinay Sajip wrote: > There are examples in the blog post I linked to earlier: It seems that would require logutils. I'm trying to keep dependencies to a minimum in my project, but I'll take a look at logutils and see if the

Re: String concatenation vs. string formatting

2011-07-10 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 04:47 AM, Vinay Sajip wrote: > You don't need logutils, just the BraceMessage class - which is > shown in the blog post (around 10 lines). Feel free to use it with > copy and paste :-) I didn't realize that was the actual class when

Re: Function docstring as a local variable

2011-07-10 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 12:41 PM, Tim Johnson wrote: > It possible for a function to print it's own docstring? >>> def test(): ... """Hi there.""" ... print(test.__doc__) ... >>> test() Hi there. - -- CPython 3.2 | Windows NT 6.1.7601.17592 | Thun

Re: Newbie help - Programming the Semantic Web with Python

2011-07-10 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 02:28 PM, Bruce Whealton wrote: > If you know of any good resources for finding python applications on > the web, this might be a good way to learn. I don't know if I > should look for Python applications, or if I'll have more luck

Re: A beginning programmer

2011-07-10 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 05:06 PM, Eric wrote: > But I just don't know what to do with it You and I are quite different. I don't enjoy programming much, but Python is a great tool to accomplish a few goals that I have. > I don't have any problems that need

Re: String concatenation vs. string formatting

2011-07-10 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 09:33 AM, Roy Smith wrote: > The canonical way to do that would be something like > > fields = [demux_filter, field_filter, fpsin_filter, i2pfilter, > dn_filter, fpsout_filter, trim_filter, info_filter] > avs.write(''.join(fields)

Re: Function docstring as a local variable

2011-07-10 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 06:06 PM, Corey Richardson wrote: > Python 2.7.1 (r271:86832, Jul 8 2011, 22:48:46) [GCC 4.4.5] on > linux2 Type "help", "copyright", "credits" or "license" for more > information. def foo(): > ... "Docstring" ... print

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.11 02:16 PM, Chris Angelico wrote: > You think Microsoft makes decisions and sticks with them? Look at > Office's last few versions. They can't decide on a file format, an > interface, a featureset... everything keeps changing. Of cou

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.12 05:24 AM, Steven D'Aprano wrote: > Rather than taking advantage of that convenience, commercial vendors > put barriers in the way and try to carve out little walled gardens. > Did they not learn anything from AOL? DRM and activation

Re: Set run vars with each call

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.12 12:32 PM, Gnarlodious wrote: > OK, that sets a value at init time. But is there a similar built-in > to run whenever the class instance is called? What do you mean by call an instance? Do you want to run certain code whenever any me

Code hosting services

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I know this isn't specific to Python, but it is somewhat on topic. Way back when I had a simple project, SourceForge was by far the most prominent place to host (and it still is, though to a lesser extent now). SourceForge is still an option for m

Re: Code hosting services

2011-07-13 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.13 05:05 AM, Thomas Jollans wrote: > There are a load of older sites, SourceForge, Savannah, Gna!, etc > etc etc, but they don't support VCS other than CVS/Svn for the most > part. Many do support Mercurial. In fact, I have a Mercurial

Re: Code hosting services

2011-07-13 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.13 05:34 AM, Thomas Jollans wrote: > Okay, fair enough. Question is, does it integrate with the bug > tracker? It does for Google Plus. In the olden days when Mercurial > was young, Savannah, IIRC, bolted on Mercurial hosting that didn'

Re: Print encoding problems in console

2011-07-15 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.15 07:02 PM, Pedro Abranches wrote: > Now, if you're using your python script in some shell script you > might have to store the output in some variable, like this: > > $ var=`python -c 'import sys; print sys.stdout.encoding; print > u

Re: Code hosting services

2011-07-16 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I found this on StackOverflow and it was very helpful: http://stackoverflow.com/questions/10490/best-open-source-project-hosting-site Now, I have it narrowed down to 3 choices - SF, Google Code and CodePlex. SF pros: Very popular and has tons of

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-16 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.16 11:51 AM, rantingrick wrote: > -- Evidence: Tabs ARE > superior! -- That may be the case (for indentation, NOT alignment), but you're sti

Re: Proposal to extend PEP 257 (New Documentation String Spec)

2011-07-16 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.16 10:32 AM, rantingrick wrote: > This method will preserve indention. However some might > blubber..."Yeah but then you have to remove the arrows, boo :( "... > well just watch and learn kiddo: > s = """ > def foo(): --->for x

Re: Proposal to extend PEP 257 (New Documentation String Spec)

2011-07-16 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.16 06:12 PM, Chris Angelico wrote: > He's on Steven's killfile, and he might get himself on mine. He's like a guy at a party who's had too much to drink. He'll start going on about conspiracy theories and philosophies based more on bloo

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-16 Thread Andrew Berg
] But it's still very readable. However, when alignment really matters, such as in a module's setup.py, spaces are the way to go: from distutils.core import setup setup( name = 'Elucidation', version = '0.0.1-WIP', py_modules = ['elucidatio

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-16 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.16 10:07 PM, Steven D'Aprano wrote: > Hilariously, in my newsreader, the first example (allegedly > unaligned) was lined up as straight as an arrow, It has consistent indentation, but the self.whatever references aren't aligned. > The

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.16 06:06 PM, Tim Roberts wrote: > That's not true. Python allows tabs and spaces to be used in the > same source file, and even in the same source line. You're right. TabError is only raised if the initial indentation is inconsistent.

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 02:32 AM, Ian Kelly wrote: > Of course, there is also another major problem with tabs that I have > not seen pointed out yet, which is that it's not possible to > strictly adhere to 80-column lines with tabs. I can write my code to

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 03:15 AM, Dotan Cohen wrote: > programing in a non-fixed width font is a real pleasure If you're masochistic, maybe. Do you find fixed-width fonts ugly? I really would like to know why anyone would use a non-fixed-width font for prog

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 02:56 AM, Thorsten Kampe wrote: > What is the difference between indentation and alignment? Well, > indentation works with tabs, alignment not. The use of spaces for indentation is as much of a hack as the use of tabs for alignment

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 04:33 AM, Thorsten Kampe wrote: > Not everyone who doesn't agree on indent size actually cares enough > about indent size - especially in someone else's code. I'd say it's > probably rather the majority making this whole debate art

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 03:12 PM, rantingrick wrote: > I can tell you one thing for sure. In MY version of Python everyone > will have a voice. That does not mean that EVERYONE will make the > final decision but EVERYONE's voice will be equally important.

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 11:46 AM, rantingrick wrote: > Why do you feel the need to layout your code in a "GUI-listview" > manner. Next you'll want column titles and column sorting... Jeez! > This is what you should have done... I was testing my psychic ab

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 06:29 PM, Roy Smith wrote: > We don't have that problem any more. It truly boggles my mind that > we're still churning out people with 80 column minds. I'm willing > to entertain arguments about readability of long lines, but the

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 07:28 PM, Roy Smith wrote: > Can you give me a more specific example? I assume there's nobody (at > least nobody sane) editing Python source code on iPhones. I haven't done it myself, but there are plenty of Python projects out the

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I should also mention that this mostly speculation on my part, and that I would love to hear from someone who develops for these devices. - -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/GPG Public Key ID: 0xF88E034060A78FCB

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.17 07:54 PM, Steven D'Aprano wrote: > Then in 2010, Rick promised that if the Python developers didn't bow > to his demands, he would folk Python, and the silent majority who > agreed with him but were too terrified to say so publicly w

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.18 01:51 PM, Dotan Cohen wrote: > Let me see if I understand: because there exists a possibility that > someone might want (not need) to edit code on a telephone to make a > quick edit to code being interpreted on that machine, _all_

Re: I am fed up with Python GUI toolkits...

2011-07-19 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 There's PyGUI, which, at a glance, fits whit what you want. Looks like it uses OpenGL and native GUI facilities. http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ It has quite a few external dependencies, though (different dependencies for

Re: I am fed up with Python GUI toolkits...

2011-07-20 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.20 02:28 AM, Steven D'Aprano wrote: > Isn't it optional though? No. http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why - -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/GPG Public Key ID: 0xF88E034060A7

PEP 8 and extraneous whitespace

2011-07-21 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I found a couple things that I think should be tweaked in PEP 8. I don't agree with everything in PEP 8, but I'm not going to debate /those/ points; rather I'm bringing up a couple examples that violate PEP 8, but don't apply to the reasons given

Re: PEP 8 and extraneous whitespace

2011-07-21 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.21 01:32 PM, Thomas Jollans wrote: > So, the PEP says: do not align operators. End of story. I'm pretty sure that colons, commas and equals signs are not operators. - -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/

Re: How can I make a program automatically run once per day?

2011-07-26 Thread Andrew Berg
On 2011.07.26 08:05 PM, John Salerno wrote: > Hmm, okay I'm finally trying Task Scheduler, but how do I set it to > run a Python script? It seems to not work, I suppose because it's > running the script but doesn't know how to find Python to run it > properly. Tell it to run the Python interpreter

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread Andrew Berg
On 2011.07.27 05:34 PM, rantingrick wrote: >> -- >> Use 4 spaces per indentation level. >> -- > > This should be the only acceptable indention level allowed by the > interpreter. All oth

Re: PyWart: PEP8: A cauldron of inconsistencies.

2011-07-27 Thread Andrew Berg
On 2011.07.27 08:34 PM, Cameron Simpson wrote: > I think when he releases Python4000 we'll all fall behind. That is, if he ever does release RickPy4000. ;) -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/GPG Public Key ID: 0xF88E034060A78FCB -- http://mail.python.org/mailman/l

Re: multilanguage application - step by step

2011-07-28 Thread Andrew Berg
On 2011.07.28 05:12 AM, Peter Irbizon wrote: > P.S. sorry for double posting but when I post my message on googlegroups I > can't see it in googlegroups (don't know why) Last time I looked at this newsgroup (which was not that long ago) on Google Groups, it was 2 days behind. -- CPython 3.2.1 | W

Re: How object's setattr differs from inherited?

2011-07-29 Thread Andrew Berg
On 2011.07.29 10:12 AM, Ciantic wrote: class MyObject(object): > ... pass > ... my = MyObject() my.myvar = 'value' # No error! obj = object() obj.myvar = 'value' # Causes error! > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'objec

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Andrew Berg
On 2011.07.29 12:22 PM, rantingrick wrote: > * New path module will ONLY support one path sep! There is NO reason > to support more than one. When we support more than one path sep we > help to propagate multiplicity.We should only support the slash and > NOT the backslash across ALL OS's since th

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Andrew Berg
On 2011.07.29 04:21 PM, Alister Ware wrote: > instead of all this negativity why don't you try being productive for a > change either make a suggestion for an addition (ie something that does > not yest exits) or better yet give us all the benefit of your supreme > coding talent & provide some c

Function "modes" vs. separate functions (was: PyWart: os.path needs immediate attention!)

2011-07-29 Thread Andrew Berg
On 2011.07.29 07:50 PM, Steven D'Aprano wrote: > Especially if the implementation looks like this: > > def get_thing(argument, flag): > if flag: > return one_thing(argument) > else: > return another_thing(argument) > Well, that would be annoying, but wouldn't it be even mo

Re: Function "modes" vs. separate functions

2011-07-29 Thread Andrew Berg
On 2011.07.29 08:57 PM, Ben Finney wrote: > If they share a lot of code, either it *is* separable to common > functions (in which case, implement it that way), or the “same thing” > code is sufficiently complex that it's better to show it explicitly. > > But this is all getting rather generic and

What's in a name?

2011-07-29 Thread Andrew Berg
I know I really shouldn't be spending too much time and effort on a name, but for some reason, it's really bothering me that I can't come up with good names for the projects I'm working on. The first (and main) project is a module that provides a class for holding information related to audio/vide

Re: PyWart: os.path needs immediate attention!

2011-07-30 Thread Andrew Berg
On 2011.07.30 10:33 AM, Grant Edwards wrote: > RR must think so, considering how much effort he seems to put into it. He hasn't replied to his last two troll threads, though. It does seem odd to write a wall of text and then not respond to replies. To be fair, though, most replies either mock him o

Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

2011-07-30 Thread Andrew Berg
As part of my muxer/encoder backend module, I need to store data in its main class. While each instance won't typically store a lot of data, but I really want it broken up into distinct categories so that a program using the module won't need to figure out what piece of data refers to what (e.g. is

Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

2011-07-30 Thread Andrew Berg
On 2011.07.30 09:43 PM, Rustom Mody wrote: > I use pyyaml for such. http://yaml.org/ > The builtin json support http://docs.python.org/library/json.html is a bit > weaker but has the advantage of no extra install I don't need a format to share or store the data. I'm perfectly content to pickle the

Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

2011-07-31 Thread Andrew Berg
On 2011.07.31 02:41 AM, Thorsten Kampe wrote: > The "QueueItem.x264['avs']['filter']['fft3d']['ffte'])" example does not > look right. Especially the mix of "." and "[]" references. Actually, > dictionaries in a dictionary don't look right to me either. QueueItem is the class; x264 is a dictionar

Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

2011-07-31 Thread Andrew Berg
On 2011.07.31 02:51 PM, Chris Rebert wrote: > Less punctuation noise: > QueueItem.x264.avs.filter.fft3d.ffte > vs. > QueueItem.x264['avs']['filter']['fft3d']['ffte'] > > It would also make clear that your sets of "keys" are static (unlike > typical dictionary usage). I see what Thorsten meant by "

Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

2011-07-31 Thread Andrew Berg
On 2011.07.31 03:53 PM, Philip Semanchuk wrote: > To the OP -- if you're looking to write this to disk, I recommend XML or > SQLite. I have a method that writes the data to disk, but at this point, I don't see any problems with just pickling the class instance. XML might be a good way to provide

Re: What's in a name?

2011-07-31 Thread Andrew Berg
I think I'll stick with Maven for the module, but the two others really need names, and I have nothing. -- CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0 PGP/GPG Public Key ID: 0xF88E034060A78FCB -- http://mail.python.org/mailman/listinfo/python-list

Re: What's in a name?

2011-07-31 Thread Andrew Berg
On 2011.07.31 09:15 PM, Ben Finney wrote: > Maven is already a well-established name for an existing free-software > work http://maven.apache.org/>. Well of course. All the good names are taken. :P I even came up with cavelib and it was taken ( http://www.mechdyne.com/cavelib.aspx ). Maybe I'll jus

Re: Question

2011-08-01 Thread Andrew Berg
On 2011.07.30 06:38 PM, Camilo Andres Roca Duarte wrote: > $ python myfunctions.py > SyntaxError: invalid syntax It helps to include the full traceback. If we don't know the code that caused the error, it's pretty hard to say what went wrong, especially with an exception as broad as SyntaxError. It

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