[ANN] Athens Python User Group - Meeting September 9, 2009, 19:00.

2009-09-05 Thread Orestis Markou
== Announcing the 1st meeting of the Athens Python User Group == If you live near Athens, Greece and are interested in meeting fellow Python programmers, meet us for a friendly chat at the Eleftheroudakis Bookstore café, on Wednesday 9 September, 7:00pm. If you plan to attend, please add a

PyCon 2010 - Call for Tutorials

2009-09-05 Thread Greg Lindstrom
The Tutorial Committee for PyCon 2010 in Atlanta is now accepting proposals for classes. This year will feature 2 days of classes prior to the official conference. These classes are 3-hour long sessions concentrating on specific Python packages or techniques and are taught by some of the

Re: print() a list

2009-09-05 Thread Mark Tolonen
DarkBlue pict...@gmail.com wrote in message news:b9c0c4ac-5f8f-4133-b928-9e55ab4b2...@x5g2000prf.googlegroups.com... I am trying to get used to the new print() syntax prior to installing python 3.1: test=[[VG, Virgin Islands, British],[VI, Virgin Islands, U.S.], [WF, Wallis and Futuna],[EH,

Re: print() a list

2009-09-05 Thread Mark Tolonen
DarkBlue pict...@gmail.com wrote in message news:b9c0c4ac-5f8f-4133-b928-9e55ab4b2...@x5g2000prf.googlegroups.com... I am trying to get used to the new print() syntax prior to installing python 3.1: test=[[VG, Virgin Islands, British],[VI, Virgin Islands, U.S.], [WF, Wallis and Futuna],[EH,

Re: File Handling Problem

2009-09-05 Thread SUBHABRATA BANERJEE
Dear Sir, Thank you for your kind reply. I would surely check your code. Meanwhile, I solved it using readlines() but not in your way. I will definitely have a look in your code. My solution came so smart that I felt I should not have posted this question. But I would like to know about, i)

Re: File Handling Problem

2009-09-05 Thread Chris Rebert
On Fri, Sep 4, 2009 at 11:39 PM, SUBHABRATA BANERJEEsubhakolkata1...@gmail.com wrote: snip And one small question does Python has any increment operator like ++ in C. No. We do x += 1 instead. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: The future of Python immutability

2009-09-05 Thread Steven D'Aprano
On Fri, 04 Sep 2009 22:30:44 -0700, sturlamolden wrote: On 5 Sep, 07:04, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: How does Matlab speed compare to Python in general? Speed-wise Matlab is slower, but it is not the interpreter limiting the speed here. How do you know?

Re: print() a list

2009-09-05 Thread Dero
On Sep 5, 2:35 pm, Mark Tolonen metolone+gm...@gmail.com wrote: DarkBlue pict...@gmail.com wrote in message news:b9c0c4ac-5f8f-4133-b928-9e55ab4b2...@x5g2000prf.googlegroups.com... I am trying to get used to the new print() syntax prior to installing python 3.1: test=[[VG, Virgin

Re: print syntax

2009-09-05 Thread Bernie
On Thu, 03 Sep 2009 12:22:14 -0400, doug wrote: I am new to python, working by way through 'Core Python Programming'. I can find no description of using print with the built-in type for formatting. I think I have got some [most?] of it from Chun, google, and python.org. My comment is - it

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-05 Thread The Music Guy
On Fri, Sep 4, 2009 at 11:23 AM, Scott David Danielsscott.dani...@acm.org wrote: The Music Guy wrote: I have a peculiar problem that involves multiple inheritance and method calling. I have a bunch of classes, one of which is called MyMixin and doesn't inherit from anything. MyMixin expects

Re: recursive decorator

2009-09-05 Thread Michele Simionato
def enable_recur(f):     print f.func_code.co_names     if 'recur' not in f.func_code.co_names:         return f # do nothing on non-recursive functions     c = Code.from_code(f.func_code)     c.code[1:1] = [(LOAD_GLOBAL, f.__name__), (STORE_FAST, 'recur')]     for i, (opcode, value) in

Re: print() a list

2009-09-05 Thread AggieDan04
On Sep 5, 1:51 am, Dero pict...@gmail.com wrote: On Sep 5, 2:35 pm, Mark Tolonen metolone+gm...@gmail.com wrote: DarkBlue pict...@gmail.com wrote in message news:b9c0c4ac-5f8f-4133-b928-9e55ab4b2...@x5g2000prf.googlegroups.com... I am trying to get used to the new print() syntax prior to

Re: possible attribute-oriented class

2009-09-05 Thread Steven D'Aprano
On Fri, 04 Sep 2009 22:51:39 -0700, Ken Newton wrote: On Fri, Sep 4, 2009 at 9:49 PM, Steven D'Apranost...@remove-this-cybersource.com.au wrote: ... The old discussion, the above link points to, shows that such a dot-accessible dict-like class is something that many people need and

Turn-based game - experimental economics

2009-09-05 Thread Paolo Crosetto
Dear all, I am writing an application in Python for an experiment in Experimental Economics. For those who do not know what this is: experimental economics uses controlled, computerised lab experiments with real subjects, putting the subject in a game mimicking the situation of interest and

Formatted input function

2009-09-05 Thread candide
I have a text file and the first line provides the best score of a game. This line has the following format : Best score : 42 In order to update the score, I try to retrieve the score value. In C, we would manage this with the following statement : fscanf(foo_file, Best score : %d, score);

Re: Formatted input function

2009-09-05 Thread Chris Rebert
On Sat, Sep 5, 2009 at 3:13 AM, candidecand...@free.invalid wrote: I have a text file and the first line provides the best score of a game. This line has  the following format : Best score : 42 In order to update the score, I try to retrieve the score value. In C, we would manage this with

Re: Turn-based game - experimental economics

2009-09-05 Thread bouncy...@gmail.com
As I Understand it I Would just use a simple shared variable or perhaps data wrote to a file to indicate busy or waiting and then use some kind of wait function or no-op to simulate' then recheck -- Sent via Cricket Mobile Email --Original Message-- From: Paolo Crosetto

Query

2009-09-05 Thread Hassan Baig
We are developing a turn-based strategy game in Python 2.6. One of the features of this game is that several battles can be concurrently in progress which each one having a *user-defined* turn-length. So the problem here is coming up with a robust method of turn processing which ensures all

Re: The future of Python immutability

2009-09-05 Thread sturlamolden
On 5 Sep, 08:47, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: How do you know? After more than 10 years experience with scientific programming I just do. When it comes to numerics I have a gut feeling for what is fast and what is slow. It's not difficult actually. You just have

Re: The future of Python immutability

2009-09-05 Thread Adam Skutt
On Sep 5, 12:06 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 04 Sep 2009 06:36:59 -0700, Adam Skutt wrote: Nope, preventing mutation of the objects themselves is not enough. You also have to forbid variables from being rebound (pointed at another object).  

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
Alan G Isaac wrote: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. class MyError(Exception): ... def __init__(self, message): ... Exception.__init__(self) ... self.message = message ... e =

PyCon 2010 - Call for Tutorials

2009-09-05 Thread Greg Lindstrom
The Tutorial Committee for PyCon 2010 in Atlanta is now accepting proposals for classes. This year will feature 2 days of classes prior to the official conference. These classes are 3-hour long sessions concentrating on specific Python packages or techniques and are taught by some of the

Re: incorrect DeprecationWarning?

2009-09-05 Thread exarkun
On 12:20 pm, alan.is...@gmail.com wrote: Alan G Isaac wrote: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. class MyError(Exception): ... def __init__(self, message): ...

Re: Application-global switches?

2009-09-05 Thread kj
In mailman.996.1252128183.2854.python-l...@python.org Ethan Furman et...@stoneleaf.us writes: I've seen a couple cool recipes implementing WORM* attributes if you wanted to ensure that your settings were not re-set. Steven D'Aprano wrote one with a class name of ConstantNamespace, you can

ANNOUNCE: Leo 4.6.3 released

2009-09-05 Thread Edward K Ream
Leo 4.6.3 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html Leo 4.6.3 fixes a significant caching bug in Leo 4.6.2. Leo

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
On 9/5/2009 9:07 AM, exar...@twistedmatrix.com wrote: You are using the deprecated practice. Clearly not, or it would fail in Python 3, which it does not. Attributes are not scoped to a particular class. There is only one message attribute on your MyError instance. It does not belong just to

Re: IMGCrush (New Python image optimizing tool)

2009-09-05 Thread Aahz
In article a66eaf23-ef2f-49bd-9a5a-d7e35e3b0...@l13g2000yqb.googlegroups.com, kiithsa...@gmail.com kiithsa...@gmail.com wrote: Requires ImageMagick and Python (coded in python 2.x, I'm running 2.6 but it might run on older python as well) Why are you using ImageMagick instead of PIL? -- Aahz

Re: Math Notations, Computer Languages, and the “F orm” in Formalism

2009-09-05 Thread slawekk
Theorem provers such as OCaml (HOL, Coq), Mizar does math formalism as a foundation, also function as a generic computer language, but lacks abilities as a computer algebra system or math notation representation. Isabelle's presentation layer is well integrated with LaTeX and you can use

Re: incorrect DeprecationWarning?

2009-09-05 Thread Terry Reedy
exar...@twistedmatrix.com wrote: On 12:20 pm, alan.is...@gmail.com wrote: I think you are missing my point. I understand it is just a DeprecationWarning. But **why** should I receive a deprecation warning when I am **not** using the deprecated practice? Since I am **not** using the deprecated

Re: How to access ODBC databases ?

2009-09-05 Thread Timothy Madden
Martin P. Hellwig wrote: Timothy Madden wrote: Martin P. Hellwig wrote: Timothy Madden wrote: cut conn = pyodbc.connect('DRIVER={PostgreSQL Unicode};Servername=127.0.0.1;UID=pikantBlue;Database=pikantBlue') Traceback (most recent call last): File stdin, line 1, in module pyodbc.Error:

Re: Formatted input function

2009-09-05 Thread Terry Reedy
Chris Rebert wrote: On Sat, Sep 5, 2009 at 3:13 AM, candidecand...@free.invalid wrote: I have a text file and the first line provides the best score of a game. This line has the following format : Best score : 42 In order to update the score, I try to retrieve the score value. In C, we

Re: Turn-based game - experimental economics

2009-09-05 Thread Terry Reedy
Paolo Crosetto wrote: Dear all, I am writing an application in Python for an experiment in Experimental Economics. For those who do not know what this is: experimental economics uses controlled, computerised lab experiments with real subjects, putting the subject in a game mimicking the

Re: incorrect DeprecationWarning?

2009-09-05 Thread exarkun
On 02:28 pm, alan.is...@gmail.com wrote: I am not sure how best to deprecate dependence on the Python 2.5 mistake, but this is not it. And I know at least one important library that is affected. I'll agree that it's not great. I certainly would have preferred it not to have been done. It

Re: The future of Python immutability

2009-09-05 Thread Terry Reedy
Adam Skutt wrote: \ This is a side-effect of writing code that relies on global variables. Global variables are generally a bad idea. Global constants are fine. Nope, the variables don't have to be global to have this problem, they just have to be shared: a = 3 b = lambda x: x + a

Re: Turn-based game - experimental economics

2009-09-05 Thread Paolo Crosetto
Dear Terry, thanks. As I understand your description, the server and each client will be a separate process on a separate machine (once deployed), so threads do not seem applicable. (For development, you can use separate processes on one machine communicating through sockets just as if

Re: Support for Windows 7 ?

2009-09-05 Thread Pascale Mourier
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 this new student was really agressive, and I assumed he was right! Here's his mistake:

Re: Turn-based game - experimental economics

2009-09-05 Thread Hendrik van Rooyen
On Saturday 05 September 2009 12:07:59 Paolo Crosetto wrote: 8--- The problem I now face is to organise turns. Players, as in Scrabble, will play in turns. So far I have developed the server and ONE client, and cannot get my head round to - nor find

Q on explicitly calling file.close

2009-09-05 Thread kj
There's something wonderfully clear about code like this: # (1) def spam(filename): for line in file(filename): do_something_with(line) It is indeed pseudo-codely beautiful. But I gather that it is not correct to do this, and that instead one should do something

Re: possible attribute-oriented class

2009-09-05 Thread Jan Kaliszewski
05-09-2009 Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 04 Sep 2009 22:37:15 +0200, Jan Kaliszewski wrote: Named tuples (which indeed are really very nice) are read-only, but the approach they represent could (and IMHO should) be extended to some kind of mutable

Re: Support for Windows 7 ?

2009-09-05 Thread MRAB
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 this new student was really agressive, and I assumed he was right!

Re: Q on explicitly calling file.close

2009-09-05 Thread MRAB
kj wrote: There's something wonderfully clear about code like this: # (1) def spam(filename): for line in file(filename): do_something_with(line) It is indeed pseudo-codely beautiful. But I gather that it is not correct to do this, and that instead one should do

Re: Formatted input function

2009-09-05 Thread Günther Dietrich
candide cand...@free.invalid wrote: In C, we would manage this with the following statement : fscanf(foo_file, Best score : %d, score); Does Python provide an equivalent ? RTFM! :) In the python 2.5 manual: Chapter 4.2.6 (search pattern 'scanf' on the index tab of python25.chm) There are

Re: Q on explicitly calling file.close

2009-09-05 Thread Dave Angel
kj wrote: There's something wonderfully clear about code like this: # (1) def spam(filename): for line in file(filename): do_something_with(line) It is indeed pseudo-codely beautiful. But I gather that it is not correct to do this, and that instead one should do

Re: Formatted input function

2009-09-05 Thread Chris Rebert
On Sat, Sep 5, 2009 at 8:00 AM, Terry Reedytjre...@udel.edu wrote: Chris Rebert wrote: On Sat, Sep 5, 2009 at 3:13 AM, candidecand...@free.invalid wrote: I have a text file and the first line provides the best score of a game. This line has  the following format : Best score : 42 In

Re: Q on explicitly calling file.close

2009-09-05 Thread r
On Sep 5, 1:17 pm, Dave Angel da...@ieee.org wrote: kj wrote: There's something wonderfully clear about code like this:     # (1)     def spam(filename):         for line in file(filename):             do_something_with(line) It is indeed pseudo-codely beautiful.  But I gather that

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 this new

Pythonwin.exe Error?!?

2009-09-05 Thread kennyken747
HELP! So apparently after installing EPD 5.0 (a python 2.5 dist) aside my main Python installation (2.6) I started getting this error. -Pure virtual function call Whenever I open up ActiveState Python, it gets this runtime error under pythonwin.exe Already uninstalled EPD but am still getting

Re: Q on explicitly calling file.close

2009-09-05 Thread Tim Chase
CPython uses reference counting, so an object is garbage collected as soon as there are no references to it, but that's just an implementation detail. Other implementations, such as Jython and IronPython, don't use reference counting, so you don't know when an object will be garbage collected,

pysqlite throwing exception?

2009-09-05 Thread william tanksley
I'm trying to modify an app I wrote a few months ago, but now it dies on startup (it worked before). The app loads the SQLite Media Monkey database, and crashes on its first query (when I try to get the number of podcasts). At the end of this post is a reduced version of the problem (which

Re: Formatted input function

2009-09-05 Thread candide
Günther Dietrich a écrit : RTFM! :) In the python 2.5 manual: Chapter 4.2.6 (search pattern 'scanf' on the index tab of python25.chm) Correct !! For once ;) the Manual gives an inambiguous answer : -- Simulating scanf() .-- Python does not currently have an

Re: Support for Windows 7 ?

2009-09-05 Thread Tim Roberts
Pascale Mourier pascale.mour...@ecp.fr wrote: YES IT IS! Sorry for the inconvenience. I usually start from this assumption. Yesterday this new student was really agressive, and I assumed he was right! Here's his mistake: with Windows the name of the directory rooted at a drive name (say C:)

Re: The future of Python immutability

2009-09-05 Thread Adam Skutt
On Sep 5, 11:29 am, Terry Reedy tjre...@udel.edu wrote: This is a pointless replacement for 'def b(x): return x+a' And? That has nothing to do with anything I was saying whatsoever. Point is: any mutable shared state is bad, and making objects immutable isn't enough to remove all shared state,

Re: pysqlite throwing exception?

2009-09-05 Thread MRAB
william tanksley wrote: I'm trying to modify an app I wrote a few months ago, but now it dies on startup (it worked before). The app loads the SQLite Media Monkey database, and crashes on its first query (when I try to get the number of podcasts). At the end of this post is a reduced version of

Re: pysqlite throwing exception?

2009-09-05 Thread william tanksley
william tanksley wtanksle...@gmail.com wrote: Oh, this is Python 2.5 on Windows. New result: this works on Python 2.6. Obviously the SQLite format changed between the two runs. I'll call this problem solved; my app appears to run now. -Wm -- http://mail.python.org/mailman/listinfo/python-list

Re: pysqlite throwing exception?

2009-09-05 Thread william tanksley
MRAB pyt...@mrabarnett.plus.com wrote: I wonder whether it's complaining about the as count part because count is the name of a function, although you do say that the same query works elsewhere. Hey, good catch. Thanks; I'll change that. (It wasn't the problem, but no doubt someday it could

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
I've filed a bug report: http://bugs.python.org/issue6844 Sadly the Twisted developers apparently did not file a bug report when they were bitten by this ... Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Q on explicitly calling file.close

2009-09-05 Thread r
On Sep 5, 2:47 pm, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: (snip) Finally, I was under the impression that Python closed filehandles automatically when they were garbage-collected.  (In fact (3) suggests as much, since it does not include an implicit call to fh.close.) If so, the

efficiently splitting up strings based on substrings

2009-09-05 Thread per
I'm trying to efficiently split strings based on what substrings they are made up of. i have a set of strings that are comprised of known substrings. For example, a, b, and c are substrings that are not identical to each other, e.g.: a = 0 * 5 b = 1 * 5 c = 2 * 5 Then my_string might be:

run-time inclusion of files

2009-09-05 Thread travis+ml-python
Hello, I was wondering if there was something like Perl's require that allows you to import a file whose name is specified at run-time. So far I've only seen imports of modules that are put in the standard module include path. I'm interested in three seperate problems: 1) being able to import

Re: Usage of main()

2009-09-05 Thread r
On Sep 4, 5:56 am, Jan Kaliszewski z...@chopin.edu.pl wrote: 04-09-2009 o 08:37:43 r rt8...@gmail.com wrote: Why use a nested function when you already *in* main? I understand you name global scope as 'main'. But (independently of using the __main__ idiom and so on) it is still good idea

Re: run-time inclusion of files

2009-09-05 Thread Chris Rebert
On Sat, Sep 5, 2009 at 3:23 PM, travis+ml-pyt...@subspacefield.org wrote: Hello, I was wondering if there was something like Perl's require that allows you to import a file whose name is specified at run-time.  So far I've only seen imports of modules that are put in the standard module

Re: efficiently splitting up strings based on substrings

2009-09-05 Thread Rhodri James
On Sat, 05 Sep 2009 22:54:41 +0100, per perfr...@gmail.com wrote: I'm trying to efficiently split strings based on what substrings they are made up of. i have a set of strings that are comprised of known substrings. For example, a, b, and c are substrings that are not identical to each other,

Re: efficiently splitting up strings based on substrings

2009-09-05 Thread per
On Sep 5, 6:42 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sat, 05 Sep 2009 22:54:41 +0100, per perfr...@gmail.com wrote: I'm trying to efficiently split strings based on what substrings they are made up of. i have a set of strings that are comprised of known substrings. For

Re: efficiently splitting up strings based on substrings

2009-09-05 Thread Rhodri James
On Sat, 05 Sep 2009 23:54:08 +0100, per perfr...@gmail.com wrote: On Sep 5, 6:42 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sat, 05 Sep 2009 22:54:41 +0100, per perfr...@gmail.com wrote: I'm trying to efficiently split strings based on what substrings they are made up of. i have

Re: run-time inclusion of files

2009-09-05 Thread Stephen Fairchild
travis+ml-pyt...@subspacefield.org wrote: I'm interested in three seperate problems: 1) being able to import a file that isn't in the standard module include path sys.path.insert(0, /path/to/module module = __import__(module) del sys.path[0] Ideally this goes into a function, possibly with

Re: efficiently splitting up strings based on substrings

2009-09-05 Thread per
On Sep 5, 7:07 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sat, 05 Sep 2009 23:54:08 +0100, per perfr...@gmail.com wrote: On Sep 5, 6:42 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Sat, 05 Sep 2009 22:54:41 +0100, per perfr...@gmail.com wrote: I'm trying to

Re: The future of Python immutability

2009-09-05 Thread Steven D'Aprano
On Sat, 05 Sep 2009 14:09:57 -0700, Adam Skutt wrote: Python does not have lambda objects. It has lambda expressions that produce function objects identical except for .__name__ to the equivalent def statement output. Sure sounds like python has lambda objects to me then... the fact they're

Re: Q on explicitly calling file.close

2009-09-05 Thread Steven D'Aprano
On Sat, 05 Sep 2009 16:14:02 +, kj wrote: Finally, I was under the impression that Python closed filehandles automatically when they were garbage-collected. (In fact (3) suggests as much, since it does not include an implicit call to fh.close.) If so, the difference between (1) and (3)

Re: The future of Python immutability

2009-09-05 Thread Steven D'Aprano
On Sat, 05 Sep 2009 04:57:21 -0700, Adam Skutt wrote: so the fact Foo and Bar are immutable isn't enough to solve the problem. This is a side-effect of writing code that relies on global variables. Global variables are generally a bad idea. Global constants are fine. Nope, the variables

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-05 Thread ryles
On Sep 4, 6:01 am, The Music Guy music...@alphaios.net wrote: I have a peculiar problem that involves multiple inheritance and method calling. I have a bunch of classes, one of which is called MyMixin and doesn't inherit from anything. MyMixin expects that it will be inherited along with

Re: efficiently splitting up strings based on substrings

2009-09-05 Thread Rhodri James
On Sun, 06 Sep 2009 00:29:14 +0100, per perfr...@gmail.com wrote: it's exactly the same problem, except there are no constraints on the strings. so the problem is, like you say, matching the substrings against the string x. in other words, finding out where x aligns to the ordered substrings

python smtp gmail authentication error (sending email through gmail smtp server)

2009-09-05 Thread online
Hi all, I have the following code import smtplib from email.mime.text import MIMEText smtpserver = 'smtp.gmail.com' AUTHREQUIRED = 1 # if you need to use SMTP AUTH set to 1 smtpuser = 'ad...@myhost.com' # for SMTP AUTH, set SMTP username here smtppass = '123456' #

[ANN] pyKook 0.0.4 - a smart build tool similar to Make, Rake, or Ant

2009-09-05 Thread kwatch
Hi, I have released pyKook 0.0.4. http://pypi.python.org/pypi/Kook/0.0.4 http://www.kuwata-lab.com/kook/ http://www.kuwata-lab.com/kook/pykook-users-guide.html In this release, recipe syntax is changed (see below). Overview pyKook is a smart build tool similar to Make, Rake, Ant, or

How to refer to data files without hardcoding paths?

2009-09-05 Thread Matthew Wilson
When a python package includes data files like templates or images, what is the orthodox way of referring to these in code? I'm working on an application installable through the Python package index. Most of the app is just python code, but I use a few jinja2 templates. Today I realized that

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-05 Thread Carl Banks
On Sep 4, 3:01 am, The Music Guy music...@alphaios.net wrote: I have a peculiar problem that involves multiple inheritance and method calling. I have a bunch of classes, one of which is called MyMixin and doesn't inherit from anything. MyMixin expects that it will be inherited along with

Re: How to refer to data files without hardcoding paths?

2009-09-05 Thread Ben Finney
Matthew Wilson m...@tplus1.com writes: Today I realized that I'm hardcoding paths in my app. They are relative paths based on os.getcwd(), but at some point, I'll be running scripts that use this code, these open(...) calls will fail. The conventional solution to this is: * Read

Re: Q on explicitly calling file.close

2009-09-05 Thread kj
In 02b2e6ca$0$17565$c3e8...@news.astraweb.com Steven D'Aprano st...@remove-this-cybersource.com.au writes: (3) For quick and dirty scripts, or programs that only use one or two files, relying on the VM to close the file is sufficient (although lazy in my opinion *wink*) It's not a matter of

Re: How to refer to data files without hardcoding paths?

2009-09-05 Thread Dave Angel
Ben Finney wrote: Matthew Wilson m...@tplus1.com writes: Today I realized that I'm hardcoding paths in my app. They are relative paths based on os.getcwd(), but at some point, I'll be running scripts that use this code, these open(...) calls will fail. The conventional solution to

Re: The future of Python immutability

2009-09-05 Thread Terry Reedy
Adam Skutt wrote: On Sep 5, 11:29 am, Terry Reedy tjre...@udel.edu wrote: This is a pointless replacement for 'def b(x): return x+a' And? That has nothing to do with anything I was saying whatsoever. Agreed. However, posts are read by newbies. Posts that promote bad habits are fair game

Re: Support for Windows 7 ?

2009-09-05 Thread Grant Edwards
On 2009-09-05, Pascale Mourier pascale.mour...@ecp.fr wrote: Well, os.listdir('C:') instead of raising an exception, for some reason behaves like os.listdir('.'). Windows (and DOS) have worked like that for decades. A lone drive letter always refers to the current directory on that drive.

Re: Pythonwin.exe Error?!?

2009-09-05 Thread kennyken747
On Sep 5, 2:37 pm, kennyken747 kennyken...@gmail.com wrote: HELP! So apparently after installing EPD 5.0 (a python 2.5 dist) aside my main Python installation (2.6) I started getting this error. -Pure virtual function call Whenever I open up ActiveState Python, it gets this runtime error

Re: subprocess + python-daemon - bug/problem?

2009-09-05 Thread Sewar
I got the same bug. Traceback (most recent call last): File ./script1.py, line 30, in module call([python, script2.py, arg1], stdout=sys.stdout, stderr=STDOUT) File /usr/lib/python2.6/subprocess.py, line 444, in call return Popen(*popenargs, **kwargs).wait() File

Re: subprocess + python-daemon - bug/problem?

2009-09-05 Thread Sewar
I got the same bug. Traceback (most recent call last): File ./script1.py, line 30, in module call([python, script2.py, arg1], stdout=sys.stdout, stderr=STDOUT) File /usr/lib/python2.6/subprocess.py, line 444, in call return Popen(*popenargs, **kwargs).wait() File

Re: Q on explicitly calling file.close

2009-09-05 Thread Steven D'Aprano
On Sun, 06 Sep 2009 01:51:50 +, kj wrote: In 02b2e6ca$0$17565$c3e8...@news.astraweb.com Steven D'Aprano st...@remove-this-cybersource.com.au writes: (3) For quick and dirty scripts, or programs that only use one or two files, relying on the VM to close the file is sufficient (although

midi file toolkit

2009-09-05 Thread Sean McIlroy
## python 2.6.2 from tkFileDialog import askopenfilename, askdirectory def nowindow(function): def windowless(): from Tkinter import Tk Tk().withdraw() return function() return windowless getfilename = nowindow(askopenfilename) getdirectoryname =

Re: Problems with hex-conversion functions

2009-09-05 Thread Steven D'Aprano
On Fri, 04 Sep 2009 15:28:10 -0700, Arnon Yaari wrote: Hello everyone. Perhaps I'm missing something, but I see several problems with the two hex-conversion function pairs that Python offers: 1. binascii.hexlify and binascii.unhexlify 2. bytes.fromhex and bytes.hex Problem #1: bytes.hex

Re: Q on explicitly calling file.close

2009-09-05 Thread Stephen Hansen
On Sat, Sep 5, 2009 at 6:51 PM, kj no.em...@please.post wrote: In 02b2e6ca$0$17565$c3e8...@news.astraweb.com Steven D'Aprano st...@remove-this-cybersource.com.au writes: (3) For quick and dirty scripts, or programs that only use one or two files, relying on the VM to close the file is

Re: The future of Python immutability

2009-09-05 Thread John Nagle
Steven D'Aprano wrote: On Fri, 04 Sep 2009 06:36:59 -0700, Adam Skutt wrote: Nope, preventing mutation of the objects themselves is not enough. You also have to forbid variables from being rebound (pointed at another object). Right. What's needed for safe concurrency without global

[issue6841] A typo in Doc/library/stdtypes.rst

2009-09-05 Thread Cheese Lee
New submission from Cheese Lee cheese...@126.com: See the patch. This typo is found in all branches. -- assignee: georg.brandl components: Documentation files: stdtypes-rst-cheese.patch keywords: patch messages: 92273 nosy: cheeselee, georg.brandl severity: normal status: open title: A

[issue6841] A typo in Doc/library/stdtypes.rst

2009-09-05 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Thanks, fixed in r74666, will be merged to other branches soon. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6841

[issue6842] program run in interpreter, fails at command line

2009-09-05 Thread John Van Praag
New submission from John Van Praag j...@jvp247.com: My platform: Win XP. Program fibo.py from the tutorial runs correctly in the interpreter. When I run it from the command line I get the following error: file fibo.py line 6 print(b, end=' ') ^ -- components: Windows

[issue6842] program run in interpreter, fails at command line

2009-09-05 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: You're probably trying to run it under Python 2.5 or Python 2.6 instead of Python 3.1. The line you show only makes sense for Python 3.x. You code runs fine for me (using python3.1, on OS X 10.5). -- nosy: +marketdickinson

[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-09-05 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: I've made two subsequent patches. I found after reading the symlink documentation that I had gotten the parameters mixed up. This patch, tagged r4274, addresses that issue. -- Added file:

[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-09-05 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: This second patch adds the documentation to os.rst to formally define the behavior of the symlink function in Windows. Only changes needed to be made to the lstat and symlink functions. readlink remains Unix-only. We may consider implementing

[issue5329] os.popen2 and os.popen3 in python 2.6 incompatible with os.popen* in python 2.5

2009-09-05 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone exar...@divmod.com: Added file: http://bugs.python.org/file14839/subprocess-conversion-doc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5329 ___

[issue5329] os.popen2 and os.popen3 in python 2.6 incompatible with os.popen* in python 2.5

2009-09-05 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: Ah, thanks for the clarification, Philip. I've attached another patch updating those docs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5329

[issue6843] No documentation for the module argument to warnings.filterwarnings

2009-09-05 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone exar...@divmod.com: None of the documentation seems to cover this parameter. The test suite doesn't even seem to exercise it, either. What does it do? What kind of values are expected to be passed for it? -- assignee: georg.brandl components:

[issue6844] BaseException DeprecationError raises inappropriately

2009-09-05 Thread Alan Isaac
New submission from Alan Isaac alan.is...@gmail.com: In Python 2.6 if I subclass Exception and intialize my instances with a `message` attribute, I get a DeprecationError via BaseException. Of course there is no problem in Py3, because adding a `message` attribute to instances of a subclass is

[issue6843] No documentation for the module argument to warnings.filterwarnings

2009-09-05 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: The values for a filter entry are documented under the The Warnings Filter heading. I've added a link to it from filterwarnings in r74671. -- resolution: - fixed status: open - closed ___ Python

[issue6837] Mark the compiler package as deprecated

2009-09-05 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: The compiler package is surprisingly often used; we already had complaints when (I think) 2.6 began emitting lots of new DeprecationWarnings, but for modules/APIs whose replacements was straightforward. Replacing usage of the compiler package is

  1   2   >