I'm questioning my reason for why the follwoing code doesn't behave as I
thought it would upon first coding a project.
m = 8
n = 10
cb = [[[0, None]] * (n + 1)] * (m + 1)
cb[3][2][0] = 10
This last statement causes the every first element in the list to update. Is
this becuase this metho
On 2009 Aug 18, at 7:57 PM, Jramak wrote:
Hello
We have developed three custom applications in Python. Each one of
these applications needs a different PYTHONPATH, in addition to
different environment variables to work. Instead of manually setting
the environment variables for each application, w
On Tue, Aug 18, 2009 at 7:57 PM, Jramak wrote:
> Hello
> We have developed three custom applications in Python. Each one of
> these applications needs a different PYTHONPATH, in addition to
> different environment variables to work. Instead of manually setting
> the environment variables for each a
Hello
We have developed three custom applications in Python. Each one of
these applications needs a different PYTHONPATH, in addition to
different environment variables to work. Instead of manually setting
the environment variables for each application, what would be the best
way to set PYTHONPATH
Serdar Tumgoren wrote:
Thanks to you both for the suggestions. I think I'll try the approach
below. But just one follow-up: should I be setting "self.tablename",
or is a static attribute ("tablename") the correct approach?
A nice way to do this is with a class attribute. For example:
class C
> ..The atttribute is created in the class definition
> (not in any method) as just "tablename". This creates an attribute of
> the class, rather than of the instance. It is accessed as
> "self.tablename". The attribute lookup rules will look first in the
> instance, fail to find 'tablename', then
On Tue, Aug 18, 2009 at 3:16 PM, Serdar Tumgoren wrote:
> On Tue, Aug 18, 2009 at 2:51 PM, Serdar Tumgoren wrote:
>> Thanks to you both for the suggestions. I think I'll try the approach
>> below. But just one follow-up: should I be setting "self.tablename",
>> or is a static attribute ("tablename"
On Tue, Aug 18, 2009 at 2:51 PM, Serdar Tumgoren wrote:
> Thanks to you both for the suggestions. I think I'll try the approach
> below. But just one follow-up: should I be setting "self.tablename",
> or is a static attribute ("tablename") the correct approach?
>
Looks like it's the former (i.e. "s
Thanks to you both for the suggestions. I think I'll try the approach
below. But just one follow-up: should I be setting "self.tablename",
or is a static attribute ("tablename") the correct approach?
> A nice way to do this is with a class attribute. For example:
> class Committee(object):
>
> d
On Tue, Aug 18, 2009 at 1:47 PM, Serdar Tumgoren wrote:
> Hi all,
>
> I've hit another gray area for an application I'm working on.
> Specifically, I have a campaign Committee object, and then subclasses
> called CandidateCommittee and PresidentialCommittee. Depending on the
> type of committee, I
Hi all,
I've hit another gray area for an application I'm working on.
Specifically, I have a campaign Committee object, and then subclasses
called CandidateCommittee and PresidentialCommittee. Depending on the
type of committee, I have to execute a series of SQL statements to
pull data (used to po
On Tue, Aug 18, 2009 at 5:59 AM, Kent Johnson wrote:
> On Tue, Aug 18, 2009 at 12:18 AM, Mal Wanstall wrote:
>> On Tue, Aug 18, 2009 at 9:00 AM, Eduardo Vieira
>> wrote:
>
>>> Here is the Error output:
>>> utf-8
>>> Traceback (most recent call last):
>>> File "C:\myscripts\encondingproblem.py", l
> Setting sys.setdefaultencoding() affects all scripts you run and will
> make scripts that you write non-portable. A better solution is to
> properly encode the output, for example
> for company in companies[:4]: # assuming companies is a list
> print company.encode('cp437')
>
Kent's suggestion a
On Tue, Aug 18, 2009 at 12:18 AM, Mal Wanstall wrote:
> On Tue, Aug 18, 2009 at 9:00 AM, Eduardo Vieira
> wrote:
>> Here is the Error output:
>> utf-8
>> Traceback (most recent call last):
>> File "C:\myscripts\encondingproblem.py", line 13, in
>> print companies[:4]
>> UnicodeEncodeError: '
14 matches
Mail list logo