Re: Generic dictionary

2016-11-20 Thread Thorsten Kampe
* Chris Angelico (Sun, 20 Nov 2016 23:35:52 +1100) > I see. So you want to be able to have something that looks and > feels > like a dictionary, but uses a different way of looking things up. > Makes reasonable sense, on the surface. > > Before you go down that route, I strongly recommend reading

Re: Generic dictionary

2016-11-20 Thread Thorsten Kampe
* Steve D'Aprano (Sun, 20 Nov 2016 22:40:19 +1100) > > Further thoughts come to mind, after looking more closely at your code. > > On Sun, 20 Nov 2016 08:27 pm, Thorsten Kampe wrote: > > > def values(inst): > > if isinstance(inst._generic, di

Re: Generic dictionary

2016-11-20 Thread Thorsten Kampe
* Steve D'Aprano (Sun, 20 Nov 2016 21:10:08 +1100) > > On Sun, 20 Nov 2016 08:27 pm, Thorsten Kampe wrote: > > > I'd like to extend the dictionary class by creating a class that acts > > like a dictionary if the class is instantiated with a dictionary and >

Re: Generic dictionary

2016-11-20 Thread Thorsten Kampe
* Anny Mous (Sun, 20 Nov 2016 21:46:25 +1100) > > On Sun, 20 Nov 2016 08:43 pm, Peter Otten wrote: > > > Thorsten Kampe wrote: > > > >> [Crossposted to tutor and general mailing list] > >> > >> Hi, > >> > >> I'd like t

Re: Generic dictionary

2016-11-20 Thread Thorsten Kampe
* Peter Otten (Sun, 20 Nov 2016 10:43:01 +0100) > > Thorsten Kampe wrote: > > > > I'd like to extend the dictionary class by creating a class that acts > > like a dictionary if the class is instantiated with a dictionary and > > acts like a "dictitem&quo

Generic dictionary

2016-11-20 Thread Thorsten Kampe
[Crossposted to tutor and general mailing list] Hi, I'd like to extend the dictionary class by creating a class that acts like a dictionary if the class is instantiated with a dictionary and acts like a "dictitem" ([(key1, value1), (key2, value2), ...]) if instantiated with a list (that is dic

Re: How to test for type or instance of dict_values?

2016-11-17 Thread Thorsten Kampe
* Peter Otten (Thu, 17 Nov 2016 13:38:26 +0100) > > Thorsten Kampe wrote: > > > How can I test for type or instance of dictviews like dict_values? > > Why do you want to? Thanks, for the `collections.abc.ValuesView` tip. The code in question is part of an attempt to

How to test for type or instance of dict_values?

2016-11-17 Thread Thorsten Kampe
How can I test for type or instance of dictviews like dict_values? `isinstance({}.values, dict_values)` gives `NameError: name 'dict_values' is not defined` """ >>> type({}.values()) """ Thorsten -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows: subprocess won't run different Python interpreter

2016-11-11 Thread Thorsten Kampe
* eryk sun (Fri, 11 Nov 2016 09:55:23 +) > > If it works like cmd.exe, then it does its own search using %Path% > and %PathExt%. For example: > > C:\>cmd /c "set "PATH=" & cmd" > 'cmd' is not recognized as an internal or external command, > operable program or batch file. > > Bu

Re: Windows: subprocess won't run different Python interpreter

2016-11-11 Thread Thorsten Kampe
* eryk sun (Fri, 11 Nov 2016 06:23:50 +) > > That's the application directory, which is the first place > CreateProcess looks (via the SearchPath call), as both of my examples > shows. In my case python.exe is located in the standard 3.5 system > installation path, "C:\Program Files\Python35".

Re: Windows: subprocess won't run different Python interpreter

2016-11-10 Thread Thorsten Kampe
* Thomas Nyberg (Thu, 10 Nov 2016 17:46:06 -0500) > > On 11/10/2016 05:32 PM, Thorsten Kampe wrote: > > Yes. That works. But it's not like subprocess should work. > > > > It certainly is odd. I can at least confirm that when I try to run your > code I get the er

Re: Windows: subprocess won't run different Python interpreter

2016-11-10 Thread Thorsten Kampe
* eryk sun (Thu, 10 Nov 2016 23:04:02 +) > > On Thu, Nov 10, 2016 at 9:58 PM, Thorsten Kampe > wrote: > > > > I'm trying to run a script with a different Python version by > > extending the path variable and executing "python.exe". It looks like

Re: Windows: subprocess won't run different Python interpreter

2016-11-10 Thread Thorsten Kampe
* Thomas Nyberg (Thu, 10 Nov 2016 17:07:35 -0500) > > On 11/10/2016 04:58 PM, Thorsten Kampe wrote: > > Hi, > > > > I'm trying to run a script with a different Python version by > > extending the path variable and executing "python.exe". It looks li

Windows: subprocess won't run different Python interpreter

2016-11-10 Thread Thorsten Kampe
Hi, I'm trying to run a script with a different Python version by extending the path variable and executing "python.exe". It looks like subprocess will always run the current executing Python. The following snippet demonstrates the problem: """ import os, subprocess os.environ['PATH'] = '' prin

Re: ConfigParser: use newline in INI file

2016-10-02 Thread Thorsten Kampe
* Ned Batchelder (Sat, 1 Oct 2016 17:41:28 -0700 (PDT)) > > On Saturday, October 1, 2016 at 6:25:16 PM UTC-4, Thorsten Kampe wrote: > > * Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100) > > > > > > Thorsten Kampe writes: > > > > > > &

Re: ConfigParser: use newline in INI file

2016-10-01 Thread Thorsten Kampe
* Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100) > > Thorsten Kampe writes: > > > ConfigParser escapes `\n` in ini values as `\\n`. Indenting solves the problem. I'd rather keep it one line per value but it solves the problem. Thorsten -- https://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser: use newline in INI file

2016-10-01 Thread Thorsten Kampe
* Terry Reedy (Sat, 1 Oct 2016 15:44:39 -0400) > > On 10/1/2016 10:56 AM, Thorsten Kampe wrote: > > > ConfigParser escapes `\n` in ini values as `\\n`. Is there a way to > > signal to ConfigParser that there is a line break? > > Without an example or two, I don'

ConfigParser: use newline in INI file

2016-10-01 Thread Thorsten Kampe
Hi, ConfigParser escapes `\n` in ini values as `\\n`. Is there a way to signal to ConfigParser that there is a line break? Thorsten -- https://mail.python.org/mailman/listinfo/python-list

Re: How to convert 'ö' to 'oe' or 'o' (or other si =?utf-8?Q?milar_things)_in_a_string??=

2016-09-18 Thread Thorsten Kampe
* Terry Reedy (Sun, 18 Sep 2016 03:51:40 -0400) > > On 9/18/2016 2:45 AM, Steven D'Aprano wrote: > > > It doesn't matter whether you call them "accent" like most people do, or > > "diacritics" as linguists do. > > I am a native born American and I have never before heard or seen > non-accent di

Re: How to convert 'ö' to 'oe' or 'o' (or other si =?utf-8?Q?milar_things)_in_a_string??=

2016-09-17 Thread Thorsten Kampe
* Martin Schöön (17 Sep 2016 20:20:12 GMT) > > Den 2016-09-17 skrev Kouli : > > Hello, try the Unidecode module - https://pypi.python.org/pypi/Unidecode. > > > > Kouli > > > > On Sat, Sep 17, 2016 at 6:12 PM, Peng Yu wrote: > >> Hi, I want to convert strings in which the characters with accents >

Re: Is there something similar to `set -v` of bash in python

2016-09-17 Thread Thorsten Kampe
* Thorsten Kampe (Sat, 17 Sep 2016 12:25:05 +0200) > > * Peng Yu (Fri, 16 Sep 2016 21:31:37 -0500) > > > > Hi, `set -v` in bash allows the print of the command before print the > > output of the command. > > > > I want to do the similar thing --- print a p

Re: Is there something similar to `set -v` of bash in python

2016-09-17 Thread Thorsten Kampe
* Peng Yu (Fri, 16 Sep 2016 21:31:37 -0500) > > Hi, `set -v` in bash allows the print of the command before print the > output of the command. > > I want to do the similar thing --- print a python command and then > print the output of the command. Is it possible with python? Rather easily. I've

Re: extending PATH on Windows?

2016-02-16 Thread Thorsten Kampe
* Ulli Horlacher (Tue, 16 Feb 2016 12:38:44 + (UTC)) By the way: there is a script called `win_add2path.py` in your Python distribution which "is a simple script to add Python to the Windows search path. It modifies the current user (HKCU) tree of the registry.". That should do most of what

Re: extending PATH on Windows?

2016-02-16 Thread Thorsten Kampe
* Ulli Horlacher (Tue, 16 Feb 2016 12:38:44 + (UTC)) > > Thorsten Kampe wrote: > > * Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC)) > > > I need to extend the PATH environment variable on Windows. > > > > 1. Add the path component yourself into HKE

Re: extending PATH on Windows?

2016-02-16 Thread Thorsten Kampe
* Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC)) > I need to extend the PATH environment variable on Windows. > > So far, I use: > >system('setx PATH "%PATH%;'+bindir+'"') > > The problem: In a new process (cmd.exe) PATH contains a lot of double > elements. As far as I have understoo

Re: Run two processes in parallel

2015-03-29 Thread Thorsten Kampe
* Ian Kelly (Sun, 29 Mar 2015 03:13:31 -0600) > > On Sun, Mar 29, 2015 at 2:11 AM, Thorsten Kampe > wrote: > > > > I'd like to run two processes concurrently (either through a builtin > > module or a third-party). One is a "background" task and the othe

Run two processes in parallel

2015-03-29 Thread Thorsten Kampe
Hi, I'd like to run two processes concurrently (either through a builtin module or a third-party). One is a "background" task and the other is displaying a spinner (for which I already found good packages). The two processes do not have to communicate with each other; only the second should be

Re: Usefulness of the "not in" operator

2011-10-08 Thread Thorsten Kampe
* candide (Sat, 08 Oct 2011 16:41:11 +0200) > After browsing source code, I realize that parenthesis are not > necessary ("not" has higher precedence than "in"). Lower precedence. Thorsten -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonw.exe

2011-08-14 Thread Thorsten Kampe
* Chris Angelico (Sun, 14 Aug 2011 16:52:05 +0100) > On Sun, Aug 14, 2011 at 3:30 PM, Nobody wrote: > > BTW, unless you're using Windows 95/98/ME, you don't have a "DOS > > Prompt". The command prompt in Windows NT/2000/XP/Vista/7 isn't DOS. > > I don't see this as any sloppier than referring to

Re: Dialog boxes in curses

2011-08-13 Thread Thorsten Kampe
* f...@slick.airforce-one.org (13 Aug 2011 15:21:01 GMT) > I want to have dialog boxes (a message with Yes/No/Cancel options, > possibly with keyboard accels) in python + curses. Use Python Dialog[1] which is basically a wrapper for dialog boxes around ncurses. Thorsten [1] http://pythondialog.s

Re: Inconsistencies with tab/space indentation between Cygwin/Win32?

2011-08-03 Thread Thorsten Kampe
* Christian Gelinek (Thu, 4 Aug 2011 13:55:37 +0930) > Any ideas on how to get the thing to run under (real) Windows, > hopefully without having to edit existing sources of people who left > our company ages ago? python -t "Issue a warning when a source file mixes tabs and spaces for indentation i

Re: [ANN] IPython 0.11 is officially out

2011-08-01 Thread Thorsten Kampe
* Fernando Perez (Sun, 31 Jul 2011 17:26:50 + (UTC)) > on behalf of the IPython development team, I'm thrilled to announce, > after more than two years of development work, the official release of > IPython 0.11. > > This release brings a long list of improvements and new features > (along wit

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

2011-07-31 Thread Thorsten Kampe
* Andrew Berg (Sun, 31 Jul 2011 13:36:43 -0500) > On 2011.07.31 02:41 AM, Thorsten Kampe wrote: > > Another approach would be named tuples instead of dictionaries or > > flat SQL tables. > What would the advantage of that be? QueueItem.x264['avs']['f

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

2011-07-31 Thread Thorsten Kampe
* Andrew Berg (Sat, 30 Jul 2011 22:10:43 -0500) > I'm looking for pointers on design. I'm inexperienced but cautious and > am mostly wondering if there's an easier way to "format" this data or > if this approach will lead to problems. The "QueueItem.x264['avs']['filter']['fft3d']['ffte'])" example

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

2011-07-18 Thread Thorsten Kampe
* Anssi Saari (Mon, 18 Jul 2011 19:28:49 +0300) > > Thorsten Kampe writes: > > > The "perfect programming font" is just the one that looks so good that > > you would also use it for writing email. Dejavu Sans Mono is pretty > > good. Consolas looks a

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

2011-07-17 Thread Thorsten Kampe
* Dotan Cohen (Sun, 17 Jul 2011 22:20:15 +0300) > > On Sun, Jul 17, 2011 at 14:51, Thorsten Kampe > wrote: > > * Dotan Cohen (Sun, 17 Jul 2011 14:11:40 +0300) > >> So long as the indentation lines up (which it does, with tabs or > >> spaces) then I do not se

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

2011-07-17 Thread Thorsten Kampe
* rantingrick (Sun, 17 Jul 2011 10:57:10 -0700 (PDT)) > Choose to follow it or die of exceptions; your choice. One of the best things I've read for a long time :-). > The past is bickering over selfish personal freedoms, the future of is > unity. And a tab is *exactly* four spaces. Not three. No

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

2011-07-17 Thread Thorsten Kampe
* gene heskett (Sun, 17 Jul 2011 10:29:03 -0400) > On Sunday, July 17, 2011 10:28:16 AM Dotan Cohen did opine: > > I'm still looking for the perfect programming font. Suggestions > > welcomed. > > When you find it Dotan, let me know, I've been looking since the later > '70's. The "perfect program

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

2011-07-17 Thread Thorsten Kampe
* Thomas 'PointedEars' Lahn (Sun, 17 Jul 2011 14:35:15 +0200) > Thorsten Kampe wrote: > > * Andrew Berg (Sun, 17 Jul 2011 05:02:22 -0500) > >> I still don't understand. Whitespace to the left of an assignment > >> to signify an indent and whitespace a

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

2011-07-17 Thread Thorsten Kampe
* Dotan Cohen (Sun, 17 Jul 2011 14:11:40 +0300) > So long as the indentation lines up (which it does, with tabs or > spaces) then I do not see any problem with variable-width. > What are the counter-arguments? Alignment doesn't line up. Thorsten -- http://mail.python.org/mailman/listinfo/python

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

2011-07-17 Thread Thorsten Kampe
* Andrew Berg (Sun, 17 Jul 2011 05:02:22 -0500) > > And if we work on a project together, we have to agree on formatting > > anyway, the indent size being the least important one. > How is indent size unimportant with regard to formatting? Take some code or yours and format it with three and with

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

2011-07-17 Thread Thorsten Kampe
* Andrew Berg (Sun, 17 Jul 2011 03:36:31 -0500) > Not everyone agrees on how many spaces an indent should be (whether an > indent is a tab or a space-tab), which is a good reason to use tabs. Not everyone who doesn't agree on indent size actually cares enough about indent size - especially in som

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

2011-07-17 Thread Thorsten Kampe
* Andrew Berg (Sat, 16 Jul 2011 19:29:30 -0500) > Of everything I've read on tabs vs. spaces, this is what makes the > most sense to me: > http://www.iovene.com/61/ Interesting one, especially the - from the coder's point of view - artificial distinction between indentation and alignment. What i

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

2011-07-17 Thread Thorsten Kampe
* rantingrick (Sat, 16 Jul 2011 09:51:02 -0700 (PDT)) > 3) Tabs create freedom in the form of user controlled indention. > > Indention width should be a choice of the reader NOT the author. We > should never "code in" indention width; but that is EXACTLY what we > are doing with spaces! No, the re

Re: An interesting beginner question: why we need colon at all in the python language?

2011-07-13 Thread Thorsten Kampe
* Grant Edwards (Wed, 13 Jul 2011 13:03:22 + (UTC)) > On 2011-07-13, Thorsten Kampe wrote: > > >> and that that block is to be considered in relation to what was just > >> said, before the colon. > > > > The indentation makes it abundantly clear to the

Re: An interesting beginner question: why we need colon at all in the python language?

2011-07-13 Thread Thorsten Kampe
* Steven D'Aprano (Wed, 13 Jul 2011 21:07:17 +1000) > Thorsten Kampe wrote: > > * Thomas Jollans (Mon, 11 Jul 2011 16:16:17 +0200) > >> Basically, it looks better, and is more readable. > > > > People tend to overlook the colon for the same reason they tend to

Re: An interesting beginner question: why we need colon at all in the python language?

2011-07-13 Thread Thorsten Kampe
* Thomas Jollans (Mon, 11 Jul 2011 16:16:17 +0200) > Basically, it looks better, and is more readable. People tend to overlook the colon for the same reason they tend to forget to set the colon in the first place: a) it's a very weak marker in comparison to indentation and b) it looks like doubl

Re: An interesting beginner question: why we need colon at all in the python language?

2011-07-13 Thread Thorsten Kampe
* Dave Angel (Mon, 11 Jul 2011 10:36:48 -0400) > On 01/-10/-28163 02:59 PM, Anthony Kong wrote: > > My immediate response is: it allows us to fit statements into one > > line. e.g. > > if a == 1: print a > > > You're confusing the colon with the semi-colon. If you want two > statements on the same

Re: Please Help with vertical histogram

2011-07-11 Thread Thorsten Kampe
* Cathy James (Mon, 11 Jul 2011 19:42:10 -0500) > Please kindly help- i have a project where I need to plot dict results > as a histogram. I just can't get the y- axis to print right. May > someone please help? I have pulled my hair for the past two weeks, I > am a few steps ahead, but stuck for no

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

2011-07-11 Thread Thorsten Kampe
* sturlamolden (Mon, 11 Jul 2011 07:21:37 -0700 (PDT)) > On 11 Jul, 16:10, Thorsten Kampe wrote: > > And as soon as developers start developing for Unix customers (say > > Komodo, for instance), they start following the "Windows model" - as > > you call it. >

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

2011-07-11 Thread Thorsten Kampe
* sturlamolden (Mon, 11 Jul 2011 06:44:22 -0700 (PDT)) > On 11 Jul, 14:39, Ben Finney wrote: > > The Unix model is: a collection of general-purpose, customisable > > tools, with clear standard interfaces that work together well, and > > are easily replaceable without losing the benefit of all the

Re: String concatenation vs. string formatting

2011-07-08 Thread Thorsten Kampe
* John Gordon (Fri, 8 Jul 2011 20:23:52 + (UTC)) > I prefer this usage: > > logger.error('%s could not be stored - %s' % \ > (self.preset_file, sys.exc_info()[1])) The syntax for formatting logging messages according to the documentation is: Logger.error(msg, *args) NOT Logger.erro

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

2011-06-27 Thread Thorsten Kampe
* Gelonida (Mon, 27 Jun 2011 11:32:45 +0200) > One thing, which I would still like to know (though I don't need it > for my current task) is what to do to to setup an ACE on a directory, > such, that all entries below will inherit the directory's access > settings. Such a thing does not exist. Th

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

2011-06-26 Thread Thorsten Kampe
* Gelonida (Sun, 26 Jun 2011 23:53:15 +0200) > On this machine I used os.mkdir() / os.makedirs() and I had permission > problems , but only on Windows7. Windows file permissions haven't changed since 1995. The only addition was dynamic inheritance support back in 2000. > I expect, that the win3

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

2011-06-26 Thread Thorsten Kampe
* Gelonida (Sun, 26 Jun 2011 22:57:57 +0200) > What do I have to do under python windows to create a directory with > all permissions, such, that new files / directories created below will > inherit the permissions. Exactly nothing (except creating the directory, of course). > The reason I am ask

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

2011-06-24 Thread Thorsten Kampe
* Andrew Berg (Fri, 24 Jun 2011 14:02:54 -0500) > 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. That

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

2011-06-24 Thread Thorsten Kampe
* miamia (Fri, 24 Jun 2011 01:08:55 -0700 (PDT)) > In my program I can set to run after system startup (it writes path to > Software\Microsoft\Windows\CurrentVersion\Run) Under HKLM oder HKCU? The path itself is of course irrelevant. > but when normal user is logged in my application crashes. Wi

Re: Python 2.7 and cmd on Windows 7 64 (files lost)

2011-06-23 Thread Thorsten Kampe
* Tim Golden (Thu, 23 Jun 2011 08:31:26 +0100) > > Certain commands, including "dir" and "copy" are not executables > in their own right, but merely subcommands of cmd.exe. Right, "internal commands". > You've got two options in Python: > >os.system (r"cmd /c dir c:\windows") os.system aut

Re: Python 2.7 and cmd on Windows 7 64 (files lost)

2011-06-23 Thread Thorsten Kampe
* Michel Claveau - MVP (Thu, 23 Jun 2011 08:33:20 +0200) > On Win 7 64 bits: > Command-Line > CD \Python27 > dir C:\Windows\System32\SoundRecorder.exe:==> OK > Python.exe > > >>> import os > >>> os.system("dir C:\\Windows\\System32\\SoundRecorder.exe") > > ==> Do not found the file

Re: how to avoid leading white spaces

2011-06-03 Thread Thorsten Kampe
* Roy Smith (Thu, 02 Jun 2011 21:57:16 -0400) > In article <94ph22frh...@mid.individual.net>, > Neil Cerutti wrote: > > On 2011-06-01, ru...@yahoo.com wrote: > > > For some odd reason (perhaps because they are used a lot in > > > Perl), this groups seems to have a great aversion to regular > > >

Re: Beginner needs advice

2011-05-27 Thread Thorsten Kampe
* Thorsten Kampe (Sat, 28 May 2011 08:38:54 +0200) > My experience is: unless the code is especially written with Python3 > compatability [...] Oops, I meant "unless the code is specifically written with Python3 compatability in mind [...]" Thorsten -- http://mail.python.org/

Re: Beginner needs advice

2011-05-27 Thread Thorsten Kampe
* Thomas Rachel (Sat, 28 May 2011 07:06:53 +0200) > Am 27.05.2011 17:52 schrieb Steven D'Aprano: > > On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote: > >> 3.x is completely incompatible with 2.x (some call it a dialect, > >> but that is a lie). > > > > "Completely incompatible"? A "lie"? > >

Re: changing current dir and executing a shell script

2011-05-27 Thread Thorsten Kampe
* suresh (Fri, 27 May 2011 14:25:52 -0700 (PDT)) > I want to execute the following command line stuff from inside python. > $cd directory > $./executable > > I tried the following but I get errors > import subprocess > subprocess.check_call('cd dir_name;./executable') > > Due to filename path is

sys.tracebacklimit not working in Python 3.2?

2011-05-27 Thread Thorsten Kampe
Hi, > type test.py import sys sys.tracebacklimit = 0 import doesnotexist > python test.py ImportError: No module named doesnotexist > python3 test.py Traceback (most recent call last): File "test.py", line 4, in import doesnotexist ImportError: No module named doesnotexist The 3.2 docum

Re: Why did Quora choose Python for its development?

2011-05-27 Thread Thorsten Kampe
* Steven D'Aprano (27 May 2011 03:07:30 GMT) > Okay, I've stayed silent while people criticize me long enough. What > exactly did I say that was impolite? Nothing. > John threw down a distinct challenge: > > if Python is really so much better than Python [sic] > readability wise, why

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* sal migondis (Thu, 26 May 2011 17:50:32 -0400) > On Thu, May 26, 2011 at 12:28 PM, sal migondis > wrote: > > From: Thorsten Kampe > > It's unnecessary bullshit buzzword bingo from nerds which adds or > > helps or explains nothing. It's just that simple

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Charles (Thu, 26 May 2011 20:58:35 +1000) > "Thorsten Kampe" wrote in message > news:mpg.284834d227e3acd1989...@news.individual.de... > > > > If someone has learned what a directory or folder is, you don't have > > to explain what "include sub-f

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Steven D'Aprano (26 May 2011 10:06:44 GMT) > > On Thu, 26 May 2011 10:48:07 +0200, Thorsten Kampe wrote: > > > But not to digress, the /real/ problem with commands or idioms like "rm > > -r" is /not/ their choice of option names but that they explain these

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Steven D'Aprano (25 May 2011 22:58:21 GMT) > > On Wed, 25 May 2011 00:06:06 +0200, Rikishi42 wrote: > > > What I mean is: I'm certain that over the years I've had more than one > > person come to me and ask what 'Do you wish to delete this directory > > recursively?' meant. BAut never have I b

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Steven D'Aprano (25 May 2011 21:59:58 GMT) > On Wed, 25 May 2011 09:26:11 +0200, Thorsten Kampe wrote: > > > Naming something in the terms of its implementation details (in this > > case recursion) is a classical WTF. > > *If* that's true, it certainly d

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Thorsten Kampe
* John Bokma (Wed, 25 May 2011 07:01:07 -0500) > Thorsten Kampe writes: > > * Chris Angelico (Wed, 25 May 2011 08:01:38 +1000) > >> > >> On Wed, May 25, 2011 at 3:39 AM, D'Arcy J.M. Cain wrote: > >> > One of my favorite quotes (not sure if it was ab

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Thorsten Kampe
* Chris Angelico (Wed, 25 May 2011 08:01:38 +1000) > > On Wed, May 25, 2011 at 3:39 AM, D'Arcy J.M. Cain wrote: > > One of my favorite quotes (not sure if it was about Perl or APL) is "I > > refuse to use a programming language where the proponents of it stick > > snippets under each other's nos

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Thorsten Kampe
* Rikishi42 (Wed, 25 May 2011 00:06:06 +0200) > > On 2011-05-24, Steven D'Aprano wrote: > >>> I think that is a patronizing remark that under-estimates the > >>> intelligence of lay people and over-estimates the difficulty of > >>> understanding recursion. > >> > >> Why would you presume this to

Re: Customize help output from optparse (or argparse)

2011-05-21 Thread Thorsten Kampe
* Thomas 'PointedEars' Lahn (Thu, 12 May 2011 22:22:20 +0200) > Thorsten Kampe wrote: > > I'm using optparse for a little Python script. > > > > 1. The output from "--help" is: > > """ > > Usage: script.py > > &

Customize help output from optparse (or argparse)

2011-05-12 Thread Thorsten Kampe
Hi, I'm using optparse for a little Python script. 1. The output from "--help" is: """ Usage: script.py script.py does something Options: -h, --help show this help message and exit """ I would prefer to have the description before the usage, like... """ script.py does something Usage: s

Re: How to capture all the environment variables from shell?

2010-08-02 Thread Thorsten Kampe
* Tim Chase (Mon, 26 Jul 2010 21:42:24 -0500) > On 07/26/10 21:26, Steven W. Orr wrote: > > Please! Never export anything from your .bashrc unless you > > really know what you're doing. Almost all exports should be > > done in your .bash_profile > > Could you elaborate on your reasoning why (or wh

Re: is there a "strawberry python"?

2009-09-13 Thread Thorsten Kampe
* Daniel Fetchinson (Sat, 12 Sep 2009 12:54:03 -0700) > > > the reason I like strawberry perl is that I don't need to have admin right > > to install it. i can just unzip it and start the game. > > i am wondering if there is something similar in python community. > > > > any insight will be apprec

Re: Support for Windows 7 ?

2009-09-05 Thread Thorsten Kampe
* MRAB (Sat, 05 Sep 2009 17:54:00 +0100) > Pascale Mourier wrote: > > Martin v. Löwis a écrit : > > > >> Without having seen any details, I refuse to guess. Most likely, it is > >> a user mistake. > > > > YES IT IS! Sorry for the inconvenience. I usually start from this > > assumption. Yesterday

Re: An assessment of the Unicode standard

2009-08-30 Thread Thorsten Kampe
* John Machin (Sat, 29 Aug 2009 17:20:47 -0700 (PDT)) > On Aug 30, 8:46 am, r wrote: > > > > Take for instance the Chinese language with it's thousands of > > characters and BS, it's more of an art than a language.  Why do we > > need such complicated languages in this day and time. Many languages

Re: An assessment of the Unicode standard

2009-08-30 Thread Thorsten Kampe
* Chris Jones (Sun, 30 Aug 2009 00:22:00 -0400) > On Sat, Aug 29, 2009 at 11:07:17PM EDT, Neil Hodgson wrote: > > Sanskrit is mostly written in Devanagari these days which is also > > useful for selling things to people who speak Hindi and other Indian > > languages. > > Is the implication that th

Re: An assessment of the Unicode standard

2009-08-30 Thread Thorsten Kampe
* Neil Hodgson (Sun, 30 Aug 2009 06:17:14 GMT) > Chris Jones: > > > I am not from these climes but all the same, I do find you tone of > > voice rather offensive, considering that you are referring to a > > culture that's about 3000 years older and 3000 richer than ours and > > certainly deserves

Re: An assessment of the Unicode standard

2009-08-30 Thread Thorsten Kampe
* r (Sat, 29 Aug 2009 18:30:34 -0700 (PDT)) > We don't support a Python group in Chinese or French, so why this? "We" do - you don't (or to be more realistic, you simply didn't know it). > Makes no sense to me really. Like probably 99.9% of all things you hear, read, see and encounter duri

Re: Colors on IDLE

2009-08-29 Thread Thorsten Kampe
* vsoler (Sat, 29 Aug 2009 04:01:46 -0700 (PDT)) > On Aug 29, 1:27 am, r wrote: > > Have you tried saving the files as MYScriptName.py? notice the py > > extension, very important ;) > > That was it!!! > > I see the colors again. Thank you. I suggest you start using familiar technical terms. Li

Re: (Simple?) Unicode Question

2009-08-29 Thread Thorsten Kampe
* Rami Chowdhury (Thu, 27 Aug 2009 09:44:41 -0700) > > Further, does anything, except a printing device need to know the > > encoding of a piece of "text"? Python needs to know if you are processing the text. > I may be wrong, but I believe that's part of the idea between separation > of strin

Re: Scraping Wikipedia with Python

2009-08-12 Thread Thorsten Kampe
* Dotan Cohen (Tue, 11 Aug 2009 21:29:40 +0300) > >    Wikipedia has an API for computer access.  See > > > >        http://www.mediawiki.org/wiki/API > > > > Yes, I am aware of this as well. Does anyone know of a python class > for easily interacting with it, or do I need to roll my own. http://

Re: unicode() vs. s.decode()

2009-08-08 Thread Thorsten Kampe
* Michael Ströder (Fri, 07 Aug 2009 03:25:03 +0200) > Thorsten Kampe wrote: > > * Michael Ströder (Thu, 06 Aug 2009 18:26:09 +0200) > >>>>> timeit.Timer("unicode('äöüÄÖÜß','utf-8')").timeit(1000) > >> 17.2364449501037

Re: unicode() vs. s.decode()

2009-08-08 Thread Thorsten Kampe
* alex23 (Fri, 7 Aug 2009 06:53:22 -0700 (PDT)) > Thorsten Kampe wrote: > > Bollocks. No one will even notice whether a code sequence runs 2.7 or > > 5.7 seconds. That's completely artificial benchmarking. > > But that's not what you first claimed: > >

Re: unicode() vs. s.decode()

2009-08-08 Thread Thorsten Kampe
* Michael Ströder (Sat, 08 Aug 2009 15:09:23 +0200) > Thorsten Kampe wrote: > > * Steven D'Aprano (08 Aug 2009 03:29:43 GMT) > >> But why assume that the program takes 8 minutes to run? Perhaps it takes > >> 8 seconds to run, and 6 seconds of that is the decoding.

Re: unicode() vs. s.decode()

2009-08-08 Thread Thorsten Kampe
* garabik-news-2005...@kassiopeia.juls.savba.sk (Fri, 7 Aug 2009 17:41:38 + (UTC)) > Thorsten Kampe wrote: > > If you increase the number of loops to one million or one billion or > > whatever even the slightest completely negligible difference will > > occur. The same

Re: unicode() vs. s.decode()

2009-08-08 Thread Thorsten Kampe
* alex23 (Fri, 7 Aug 2009 10:45:29 -0700 (PDT)) > garabik-news-2005...@kassiopeia.juls.savba.sk wrote: > > I am not sure I understood that. Must be my English :-) > > I just parsed it as "blah blah blah I won't admit I'm wrong" and > didn't miss anything substantive. Alex, there are still a numbe

Re: unicode() vs. s.decode()

2009-08-08 Thread Thorsten Kampe
* Steven D'Aprano (08 Aug 2009 03:29:43 GMT) > On Fri, 07 Aug 2009 17:13:07 +0200, Thorsten Kampe wrote: > > One guy claims he has times between 2.7 and 5.7 seconds when > > benchmarking more or less randomly generated "one million different > > lines". That *

Re: Is python buffer overflow proof?

2009-08-07 Thread Thorsten Kampe
* Neil Hodgson (Tue, 04 Aug 2009 13:32:55 GMT) > Thorsten Kampe: > > You cannot create "your own" buffer overflow in Python as you can in C > > and C++ but your code could still be vulnerable if the underlying Python > > construct is written in C. > >

Re: unicode() vs. s.decode()

2009-08-07 Thread Thorsten Kampe
* Steven D'Aprano (06 Aug 2009 19:17:30 GMT) > On Thu, 06 Aug 2009 20:05:52 +0200, Thorsten Kampe wrote: > > > That is significant! So the winner is: > > > > > > unicode('äöüÄÖÜß','utf-8') > > > > Unless you are planning

Re: unicode() vs. s.decode()

2009-08-06 Thread Thorsten Kampe
* Michael Ströder (Thu, 06 Aug 2009 18:26:09 +0200) > Thorsten Kampe wrote: > > * Michael Ströder (Wed, 05 Aug 2009 16:43:09 +0200) > > I don't think any measurable speed increase will be noticeable > > between those two. > > Well, seems not to be true. Try yours

Re: unicode() vs. s.decode()

2009-08-06 Thread Thorsten Kampe
* Michael Ströder (Wed, 05 Aug 2009 16:43:09 +0200) > These both expressions are equivalent but which is faster or should be > used for any reason? > > u = unicode(s,'utf-8') > > u = s.decode('utf-8') # looks nicer "decode" was added in Python 2.2 for the sake of symmetry to encode(). It's esse

Re: Is python buffer overflow proof?

2009-08-04 Thread Thorsten Kampe
* Jizzai (Sun, 02 Aug 2009 13:50:14 GMT) > Is a _pure_ python program buffer overflow proof? You cannot create "your own" buffer overflow in Python as you can in C and C++ but your code could still be vulnerable if the underlying Python construct is written in C. See [1] for instance. Thorsten

Re: OTish: convince the team to drop VBScript

2009-03-01 Thread Thorsten Kampe
* Carl Banks (Sat, 28 Feb 2009 20:09:03 -0800 (PST)) > On Feb 28, 7:10 pm, Shane Geiger wrote: > > >> The company does use Python on rare occasions. It all comes down to > > >> the prejudices and habits of one of the programmers. His only argument > > >> I can't counter -because I don't see the pr

Re: Performance of Python 3

2009-03-01 Thread Thorsten Kampe
* Isaac Gouy (Sun, 1 Mar 2009 08:27:05 -0800 (PST)) > On Mar 1, 8:10 am, Stefan Behnel wrote: > > Paul Rubin wrote: > > > Steve Holden writes: > > >> I'm not sure what you think the speed of Ruby has to do with Python. > > > > > In the real world, people care about the relative speed of programs.

Re: How do I decode unicode characters in the subject using email.message_from_string()?

2009-02-25 Thread Thorsten Kampe
* Tim Golden (Wed, 25 Feb 2009 17:27:07 +) > Thorsten Kampe wrote: > > * Gabriel Genellina (Wed, 25 Feb 2009 14:00:16 -0200) > >> En Wed, 25 Feb 2009 13:40:31 -0200, Thorsten Kampe [...] > >>> And I wonder why you would think the header contains Unicode cha

Re: How do I decode unicode characters in the subject using email.message_from_string()?

2009-02-25 Thread Thorsten Kampe
* Gabriel Genellina (Wed, 25 Feb 2009 14:00:16 -0200) > En Wed, 25 Feb 2009 13:40:31 -0200, Thorsten Kampe > escribió: > > * Roy H. Han (Wed, 25 Feb 2009 10:17:22 -0500) > >> Thanks, RDM, for stating the right approach. > >> Thanks, Steve, for teaching by examp

  1   2   3   4   >