[Tutor] 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

Re: [Tutor] Standardizing on Unicode and utf8

2009-02-25 Thread Thorsten Kampe
* Dinesh B Vadhia (Fri, 20 Feb 2009 02:52:27 -0800) We want to standardize on unicode and utf8 Very good idea. and would like to clarify and verify their use to minimize encode ()/decode()'ing: 1. Python source files Use the header: # -*- coding: utf8 -*- Good idea (although only valid

Re: [Tutor] Standardizing on Unicode and utf8

2009-02-25 Thread Thorsten Kampe
* spir (Fri, 20 Feb 2009 13:02:59 +0100) Le Fri, 20 Feb 2009 02:52:27 -0800, Dinesh B Vadhia dineshbvad...@hotmail.com s'exprima ainsi: We want to standardize on unicode and utf8 and would like to clarify and verify their use to minimize encode()/decode()'ing: 1. Python source files

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-25 Thread Thorsten Kampe
* Eric Dorsey (Thu, 19 Feb 2009 12:24:07 -0700) Still doesnt work.. I just get this when I hit the up arrow: ^[[A Bah. It works in the 2.5 version that came packaged with it. Thanks for trying :) There's a log for the ./configure. See if the configure script can find readline. Thorsten

Re: [Tutor] how to make python program as executable

2008-01-30 Thread Thorsten Kampe
* Luke Paireepinart (Wed, 30 Jan 2008 03:59:59 -0600) I think he meant i want to make the application [into an] executable I.E. he wants an .exe file on Windows. In this case, you can use py2exe, and there's another alternative I can't remember. The better alternative is Pyinstaller...

Re: [Tutor] Python Versions

2007-12-15 Thread Thorsten Kampe
* Tiger12506 (Fri, 14 Dec 2007 16:23:00 -0500) Despite what your english teacher might have tried to make you believe, they were wrong about the lack of a neutral in english. Just like ending sentences with prepositions has always been done and always will be done, the use of they to refer

Re: [Tutor] ipython / readline problem

2007-12-14 Thread Thorsten Kampe
* Tiago Saboga (Thu, 13 Dec 2007 17:05:55 -0200) On Thu, Dec 13, 2007 at 07:41:08AM -0500, Kent Johnson wrote: Tiago Saboga wrote: type 'exceptions.UnicodeEncodeError': 'ascii' codec can't encode character u'\xe7' in position 2: ordinal not in range(128)

[Tutor] Installing modules via setuptools in a script

2007-11-18 Thread Thorsten Kampe
Hi, can anyone give me a short code snippet how to install a missing module via setuptools (assuming setuptools is already installed)?! Something like this: try: import missing_module except import_error import setuptools setuptools.whatever.install(missing_module) Thorsten

Re: [Tutor] repeated times

2007-11-04 Thread Thorsten Kampe
* linda.s (Sun, 4 Nov 2007 01:39:46 -0800) On Nov 2, 2007 1:03 AM, ALAN GAULD [EMAIL PROTECTED] wrote: I want to run an .exe file and get the output many times. Given that I know that you know about loops I have to ask what you see as the problem? I want to run it many times and

Re: [Tutor] New to Python and Linux

2007-09-28 Thread Thorsten Kampe
* Armand Nell (Wed, 26 Sep 2007 08:07:12 +0200) I am new to python programming and also the linux enviroment most of my skills are windows based and programming skills is visual basics. I decided that it would be a great start and new direction for me to learn python and at the same time

Re: [Tutor] New to Python and Linux

2007-09-28 Thread Thorsten Kampe
* Thorsten Kampe (Fri, 28 Sep 2007 14:09:24 +0100) It's exactly the same as with with Visual Basic [...] Guess I mixed that up with VBScript... ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] executing file properly

2007-08-07 Thread Thorsten Kampe
* Vivian Tini (Tue, 7 Aug 2007 12:20:29 +0200) The TestCases executable works properly when I run it from the shell prompt. Then I try to run it from the Python command prompt by the following script: import os os.system(home/.../.../.../TestCases) I used ... to type it short. Then

Re: [Tutor] os.path.exists(path) returns false when the pathactually exists!

2007-07-28 Thread Thorsten Kampe
* Tiger12506 (Sat, 28 Jul 2007 10:33:36 -0500) So the better question is, does is this file a broken symbolic link or can os.stat() be executed on it? How do I find if it is a broken symbolic link in Windows 2000 ? os.stat(path) returns an OSError saying that there is no such file or

Re: [Tutor] Shelve del not reducing file size

2007-07-28 Thread Thorsten Kampe
* Kent Johnson (Fri, 27 Jul 2007 08:06:33 -0400) Barton David wrote: *sigh* I'm really going off Python. In what way is it Python's fault that the dbm database doesn't reclaim disk space? It's actually how most databases work. Even a simple Outlook pst file (which is a database, too)

Re: [Tutor] how long?

2007-07-03 Thread Thorsten Kampe
* Ben Waldin (Tue, 3 Jul 2007 19:46:42 +1200) How long will it take until I successfully create my own working program that is useful? I have crated the address book ones in the tutors and just want to know how long it takes before I start to create my own thought up programs that will be

Re: [Tutor] Power Shells [WAS:] optimization: faster than for

2007-07-02 Thread Thorsten Kampe
* elis aeris (Sun, 1 Jul 2007 22:27:11 -0700) uh, can i ask about something very quickly? Don't hijack a completely unreleated thread. how do i write a function to do a pop up window with designated window name, type (ok, cancel, those) and message? Okay, a very quick answer: EasyGUI

Re: [Tutor] pop up window

2007-07-02 Thread Thorsten Kampe
* elis aeris (Mon, 2 Jul 2007 02:32:07 -0700) i won't do that again, i am a 2 day newbie (hello) uh, how about a less quick one that's built-in in python ? Are you replying to me? Please quote the parts you are referring to. Anyway, Python does not come with built-in pop-up support.

Re: [Tutor] #!/usr/bin/env python vs #!/usr/local/bin/python

2007-06-14 Thread Thorsten Kampe
* (Thu, 14 Jun 2007 13:14:13 +0300) how to choose between #!/usr/bin/env python and #!/usr/local/bin/python in the beginning of the script ? Just choose. Say I want to the script. Say I want '#!/usr/bin/env python' ___ Tutor maillist -

Re: [Tutor] easygui question, again

2007-06-11 Thread Thorsten Kampe
* Rafael Bejarano (Sun, 10 Jun 2007 20:49:40 -0500) As I understand it from the description of this list, that is exactly its purpose--to help people who no relatively little python. That's correct. But your problem (or the solution to your problem) is more related to _Operating System_

Re: [Tutor] easygui question, again

2007-06-10 Thread Thorsten Kampe
* Rafael Bejarano (Sun, 10 Jun 2007 02:24:56 -0500) On Jun 9, 2007, at 5:26 AM, Kent Johnson wrote: You could try running the easygui demo - just type python easygui.py on the command line from the directory containing easygui. At your convenience, please explain the above statement. I

Re: [Tutor] easygui question, again

2007-06-10 Thread Thorsten Kampe
* Rafael Bejarano (Sun, 10 Jun 2007 19:35:32 -0500) On Jun 10, 2007, at 5:00 PM, Thorsten Kampe wrote: It would really make sense if you learn a bit of the basics before you start doing the advanced stuff like (Python) programming... What do you mean by a bit of the basics? Well, like

Re: [Tutor] Multi-line comments?

2007-06-07 Thread Thorsten Kampe
* Brad Tompkins (Wed, 6 Jun 2007 16:41:31 -0700) Is there a way to make use of multi-line comments when programming using python? Having to stick a # in front of every line gets pretty tedious when I want to make a comment more detailed than I normally would. If there isn't a way, can

Re: [Tutor] lists - append - unique and sorted

2007-06-06 Thread Thorsten Kampe
* roberto (Wed, 6 Jun 2007 17:17:05 +0200) can i append a item to a list using criterias: - UNIQUE - if there already exist don't append test whether it's already in the with in or use sets and/or - SORTED - INSERT in the correct place using some criteria? insert and then sort again by

Re: [Tutor] installing maya/python on linux

2007-06-04 Thread Thorsten Kampe
* Preecha Bundrikwong (Mon, 4 Jun 2007 16:07:49 +0700) Can anybody please give me an easy instruction on installing maya/python (pysource/sourcepy etc.) on a Linux machine. http://cgkit.sourceforge.net/mayadoc/install.html I've already downloaded it but never succeeded installing. Aha. Why?

Re: [Tutor] SSH using python

2007-06-04 Thread Thorsten Kampe
* Chandrashekar (Mon, 4 Jun 2007 01:45:57 -0700 (PDT)) Can anyone tell me how to do ssh to a machine using python and execute programs on the remote machine? Thanks in advance. Paramiko ___ Tutor maillist - Tutor@python.org

Re: [Tutor] installing maya/python on linux

2007-06-04 Thread Thorsten Kampe
* Preecha Bundrikwong (Mon, 4 Jun 2007 17:30:03 +0700) Thanks, but sorry again; how do you 'compile' the downloaded package? I'm new to Linux :-( ./configure make make install ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Creating a closed source application in Python?

2007-05-28 Thread Thorsten Kampe
* Sophie Marston (Mon, 28 May 2007 09:56:45 +0100) Is it possible to create a closed source project in Python? Like in C++ or something, where they can't view your code? Google for Python code obfuscation (web and comp.lang.python) Thorsten ___

Re: [Tutor] trouble with if

2007-05-28 Thread Thorsten Kampe
* Rikard Bosnjakovic (Mon, 28 May 2007 17:55:42 +0200) On 5/28/07, Thorsten Kampe [EMAIL PROTECTED] wrote: Do you really think someone can or will read what you wrote? I've never seen something so horribly formatted like you emails - and I've seen lots of awful formatted emails... Looks

Re: [Tutor] html links

2007-05-25 Thread Thorsten Kampe
* max . (Mon, 14 May 2007 20:27:15 -0600) does anyone know of a tutorial for finding links in a web site with python. import formatter, \ htmllib, \ urllib url = 'http://python.org' htmlp = htmllib.HTMLParser(formatter.NullFormatter()) htmlp.feed(urllib.urlopen(url).read())