On 08/02/2011 09:25 PM, Steven D'Aprano wrote:
brandon w wrote:
I have two questions:
1) When should I use "def __init__(self):" when I create a class?
Whenever you need something to happen when you create an instance.
2) Would these two classes have the same effect?
Technically, no, b
On 08/02/2011 09:09 PM, Brett Ritter wrote:
On Tue, Aug 2, 2011 at 8:47 PM, brandon w wrote:
1) When should I use "def __init__(self):" when I create a class?
When you have any initialization to do. (in other words, when you
want class instantiation to do more than simply give you
On 4 August 2011 01:16, David wrote:
> I got an error message that surprises me. I know how to solve the
> problem (couple of parentheses will do), but I would expect Python to
> run as the code is presented below.
> After all, my_weight is a number that can be multiplied by a float.
> I would exp
On 04/08/11 00:16, David wrote:
After all, my_weight is a number that can be multiplied by a float.
I would expect Python to evaluate the expression after the (final)
operator and then having it inserted into the string.
But it doesn't because the % format operator has a higher precedence.
So
Hello everybody,
I got an error message that surprises me. I know how to solve the
problem (couple of parentheses will do), but I would expect Python to
run as the code is presented below.
After all, my_weight is a number that can be multiplied by a float.
I would expect Python to evaluate the exp
Hi Bob- thanks for the reply again. I apologize about not "replying all"
last time- still getting in the habit of doing this.
I am using Python version 3.1. As far as tuples are concerned, I don't NEED
to use them, but I am trying to get some practice with them. This is because
I am following an i
Thanks Peter- I tried the replacement method where the entire tuple is
replaced with a new one and that worked. Changing the "attribute_index" (or
"selection" variable, as I called it) to an integer removed the int/str
errors.
-Alex
On Wed, Aug 3, 2011 at 12:12 AM, Peter Otten <__pete...@web.de>
On Wed, Aug 3, 2011 at 12:10, Peter Otten <__pete...@web.de> wrote:
> Richard D. Moores wrote:
>
>> On Wed, Aug 3, 2011 at 10:11, Peter Otten <__pete...@web.de> wrote:
>>> Richard D. Moores wrote:
>>>
I wrote before that I had pasted the function (convertPath()) from my
initial post into
On Wed, Aug 3, 2011 at 12:16, Steven D'Aprano wrote:
> Richard D. Moores wrote:
>>
>> I wrote before that I had pasted the function (convertPath()) from my
>> initial post into mycalc.py because I had accidentally deleted it from
>> mycalc.py. And that there was no problem importing it from mycalc
Richard D. Moores wrote:
I wrote before that I had pasted the function (convertPath()) from my
initial post into mycalc.py because I had accidentally deleted it from
mycalc.py. And that there was no problem importing it from mycalc.
Well, I was mistaken (for a reason too tedious to go into). Ther
Richard D. Moores wrote:
> On Wed, Aug 3, 2011 at 10:11, Peter Otten <__pete...@web.de> wrote:
>> Richard D. Moores wrote:
>>
>>> I wrote before that I had pasted the function (convertPath()) from my
>>> initial post into mycalc.py because I had accidentally deleted it from
>>> mycalc.py. And that
On 08/03/2011 01:48 PM, Richard D. Moores wrote:
On Wed, Aug 3, 2011 at 10:11, Peter Otten<__pete...@web.de> wrote:
Dave was close, but Steven hit the nail: the string r"C:\Users\Dick\..." is
fine, but when you put it into the docstring it is not a raw string within
another string, it becomes
On Wed, Aug 3, 2011 at 10:11, Peter Otten <__pete...@web.de> wrote:
> Richard D. Moores wrote:
>
>> I wrote before that I had pasted the function (convertPath()) from my
>> initial post into mycalc.py because I had accidentally deleted it from
>> mycalc.py. And that there was no problem importing i
Richard D. Moores wrote:
> I wrote before that I had pasted the function (convertPath()) from my
> initial post into mycalc.py because I had accidentally deleted it from
> mycalc.py. And that there was no problem importing it from mycalc.
> Well, I was mistaken (for a reason too tedious to go into
I wrote before that I had pasted the function (convertPath()) from my
initial post into mycalc.py because I had accidentally deleted it from
mycalc.py. And that there was no problem importing it from mycalc.
Well, I was mistaken (for a reason too tedious to go into). There WAS
a problem, the same o
On 8/2/2011 11:39 PM, Alexander Quest wrote:
Hey Bob- thanks for the reply. Here is a more complete part of that
code section (the ellipses are parts where I've deleted code because I
don't think it's important for this question):
Please always reply-all so a copy goes to the list.
Thanks for
+1 to Alan on this.
Also, you may want to try stackoverflow.com for this question.
Thanks and Regards,
Sumod
On Wed, Aug 3, 2011 at 1:41 PM, Alan Gauld wrote:
> On 03/08/11 07:52, mrinal...@edss.co.in wrote:
>
>> Hi,
>>
>> I am trying to embed python into my MFC application. I have done this
>>
Otherwise I can do translation system. But it will be in its own way
with dictionaries and shelve. But it will be difficult if someone
decides to translate.
po has its own editor.
В 19:22 +1000 на 03.08.2011 (ср), Steven D'Aprano написа:
> Григор Колев wrote:
> > Hi.
> > Some one help me.
> > Ha
I do not understand
I have bg.po file
And try the following.
import gettext
instance = gettext.GNUTranslations(open('bg.po'))
IOError: [Errno 0] Bad magic number: 'bg.po'
and this
instance = gettext.Catalog('bg.po')
IOError: [Errno 2] No translation file found for domain: 'bg.po'
В 14:48 +05
Григор Колев wrote:
Hi.
Some one help me.
Haw can I use .po translation file for my program.
This is not a standard part of Python. Is this a django thing? You
should ask on a django forum.
--
Steven
___
Tutor maillist - Tutor@python.org
To
Richard D. Moores wrote:
But here's a try using the regular command line:
C:\Windows\System32>python
Python 3.2.1 (default, Jul 10 2011, 20:02:51) [MSC v.1500 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
from mycalc import convertPath
Traceba
Ops!
I accidentally erased convertPath() from mycalc.py while trying out
various things. It was my only copy of convertPath that had the
docstring as posted, so I went to my initial post and copy-and-pasted
it into mycalc.py. Now no problem:
from Wing's shell:
Python 3.2.1 (default, Jul 10 2
2011/8/3 Григор Колев
> Hi.
> Some one help me.
> Haw can I use .po translation file for my program.
>
> cat = gettext.Catalog(domain, localedir)
> what should be domain
>
Domain is usually the name of po file it defaults to django and djangojs in
some cases.
>
>
Hi.
Some one help me.
Haw can I use .po translation file for my program.
cat = gettext.Catalog(domain, localedir)
what should be domain
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/ma
Steven D'Aprano wrote:
Richard D. Moores wrote:
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that pat
Richard D. Moores wrote:
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that path with forward slashes.
On 03/08/11 07:52, mrinal...@edss.co.in wrote:
Hi,
I am trying to embed python into my MFC application. I have done this
before by statically linking to the python lib. But I want to change
this now.
Hi, this mailing list is really for people trying to learn Python.
This question is way more a
Hi,
I am trying to embed python into my MFC application. I have done this
before by statically linking to the python lib. But I want to change
this now.
The idea is to take the information from the registry for the installed
version of python on the target machine. Then load python using
load
Sumod,
Thanks so much ... I was also looking for something like Inno.
Emeka
On Wed, Aug 3, 2011 at 8:04 AM, wrote:
> For a seamless application development experience, you may want to consider
> these steps.
> 1. Use Eclipse-pydev to write your scripts
> 2. Use py2exe to convert into executa
On 08/03/2011 02:07 AM, Richard D. Moores wrote:
On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote:
When I paste that from your email into a file and run Python 2.7 on it, it
behaves fine with no errors. That's in Linux.
I should have said that I'm using Wing IDE Professional 4.0.3-1 (rev
2472
Alexander Quest wrote:
> Hi guys- I'm having a problem with a list that has nested tuples:
>
> attributes = [("strength", 0), ("health ", 0), ("wisdom ", 0),
> ("dexterity", 0)]
>
> I've defined the list above with 4 items, each starting with a value of 0.
> The player
> enters how many points
For a seamless application development experience, you may want to consider
these steps.
1. Use Eclipse-pydev to write your scripts
2. Use py2exe to convert into executable programs
3. Use Inno setup to create installers
There is support for 2.6 and 2.7 with Python. Please see the news page -
http
32 matches
Mail list logo