Hello,
I am currently doing an assignment for school using python and im at the stage of make it look good and i need more colours. So if anyone has URL with a list of colours, or even a list established by yourself. Anything of the sort would be appreciated.
P.S I dont know if this has any effect
Hello,
I was wondering if anyone knows how to insert graphic images, such as JPEG and BMP, into a simple Tk GUI and use them as the background. Any help will be appreciated.
Cheers.Crowded House Time on Earth catch them live in the USA! Enter here.
__
mode, less data than what was requested
may be returned, even if no size parameter was given.
IPython is at: http://ipython.scipy.org/moin/
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
hat DrPython is finding a different module random from
that which Idle finds.
I was tripped by a similar error. Idle and IPython both have my
bin directory on sys.path (I'm on Linux), while standard Python
does not. IPython was finding one of my modules in the bin
directory, whereas standard
ur life." haha
It is not that you should "try not to worry". It's that you
are doing things the way you are intended to. And, you are
probably in sync with the cosmos, too.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
fter the "%"
character. The mapping key selects the value to be formatted from
the mapping. For example:
>>> print '%(language)s has %(#)03d quote types.' % \
{'language': "Python", "#": 2}
Pytho
rs, please give me a
link.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Fri, Jul 13, 2007 at 12:39:40PM +1200, John Fouhy wrote:
> On 13/07/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote:
> > And, I have a question -- If you look at the example of the
> > iterative (non-recursive) generator (the Doubler class), you will
> > see that it walks
listed? If not, you will need to
find your script.
3. If your script is not in the current directory, either (1)
change to the directory containing the script with the "cd"
command or (2) use the full path to the script, as in:
python c:\some\path\to\myscript.py
Hope
ib/re-syntax.html
http://docs.python.org/lib/node46.html
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
gle window.
For more on screen, do "man screen" and look here:
http://en.wikipedia.org/wiki/GNU_Screen
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Mon, Jul 16, 2007 at 06:13:35PM -0400, Kent Johnson wrote:
Kent -
Rather than try to reply in detail to your suggestions, I've tried
to ammend my document to reflect your comments.
Thanks again for the help.
Dave
[good suggestions and corrections from Kent, snipped]
--
Dave Kuhlman
On Thu, Jul 26, 2007 at 01:48:44PM -0600, Eric Brunson wrote:
>
> Do other interpreters work?
>
> Try:
>
> #!/usr/bin/perl
> print "Perl Sucks!!!\n";
>
> or:
Or, try:
#!/usr/bin/env python
Dave
--
Dave
B(object):
pass
By the way, this is an important and fundamental subject about
Python. When I teach classes on Python, I always need to explain
Python's execution model, and I always struggle with it. So,
anything you can tell me that would
r__(self, name):
if name in self.vardict:
return self.vardict[name]
else:
raise AttributeError, 'Bunch has no attribute: %s' % name
def test():
d = {'aaa': 111, 'bbb': 222, }
b = Bunch(d)
print b.aaa
and
enables them to afford to offer more titles.
(Sorry for off-topic post. I'm a library "true believer".)
Dave
> --
> Your friend,
> Scott
>
> Sent to you from a Linux computer using Ubuntu Version 7.04 (Feisty Fawn)
> __
ns well and has built-in
debugging support.
http://www.die-offenbachs.de/eric/index.html
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
on in the book.
And, as a bonus, the discussion section will help to understand how
the solution works and why it's a good way to solve the problem.
There is also an on-line version, which is definitely worth looking
at, but does not have the problem-solution-discussion format:
http://aspn.a
stdout and stderr.
tarfile will enable you to stuff that captured output into a tar.gz
file.
Also, see the zipfile module if you want to save into a zip file.
With tarfile, you may have to write data to a temp file and then
archive that. With zipfile, you can write content directly
8
inte = 11
agl = 14
# etc
##
# outside1.py
import globals
def whatever():
x = globals.stre
# etc
##
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
('*.txt')
for name in names:
infile = open(name, 'r')
etc. etc
infile.close()
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
gt;>> for idx, item in enumerate(array):
array[idx] = item * 2
>>> array
[2, 4, 6, 8, 10]
>>> array2
[2, 4, 6, 8, 10]
Basically, this modifies the list "in place", rather than making a
new list from the old one.
Dave
--
Dave Kuhlman
as
to create the values when asked for them) except when a very
large range is used on a memory-starved machine or when all of
the range's elements are never used (such as when the loop is
usually terminated with break).
http://docs.python.org/lib/built-in-funcs.html#l2h-80
: 'peaches, nectarines, cantaloupe'
Note that we append each food to a list, then do string.join().
That's faster than doing multiple string concatenations. In this
case there are not enough strings to make a difference. But, it's
a good hab
a class does
not create an enclosing scope.
Actually, the particular edition of Alan's book that I have is old
enough so that it does not discuss the Enclosing namespace, which
came later to Python. The enclosing namespace not make a
difference in your example, but does in mine.
Dave
--
s to those requests, but it does not (directly) generate or
parse XML. SOAPpy does that for you.
You have most likely already looked at those examples. So, maybe
there is something that I don't understand about your question?
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
nk you.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Can anyone tell me where the documentation for pythons xf86misc module
is, ie what methods are avalible ?
Many thanks
Dave
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
k at the "exec" command (http://docs.python.org/ref/exec.html).
But, that's a dangerous way to code.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ex is a Python-like language for writing Python C
extensions in a Python-like language. Pyrex/Cython gets you much
closer to C code than Python.
Question: Someday will all the Python built-ins be implemented in
Cython/Pyrex.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
d = c[2,5,6,8]
print 'd:', d
e = c[2]
print 'e:', e
test()
Which prints out:
d: [10, 25, 30, 40]
e: 10
Was that what you wanted?
Notice that "c[2,5,6,8]" results in passing a tuple to __getitem__,
because it is the comm
for. However, as
your mother might say: That's what's good for you.
Also, remember, in Python, global variables are just entries in the
dictionary returned by globals(), anyway.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
for example:
lst.insert(0, obj)
and:
obj = lst.pop()
Also, this is probably a good place to mention deque
(http://docs.python.org/lib/deque-objects.html), which attempts to
reduce those costs.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
__
like me, is it sort of like
saying that the costs are averaged out over a sequence of appends?
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
port types
if type(n) is types.IntType
Or, is this a frivolous question that makes no difference?
Dave
>
> Alan G.
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
--
D
ttp://wiki.python.org/moin/IntegratedDevelopmentEnvironments
Two that I've looked at:
- Geany -- http://geany.uvena.de/
- Eric -- http://www.die-offenbachs.de/eric/index.html -- Eric was
easy to install on Debian GNU/Linux, but may be more of a
Is there a way for a Python script to intercept a HUP signal sent to it ?
Cheers
Dave
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
___
Tutor maillist - Tutor@python.org
http
ntains no messages and no error
messages are generated.
Anybody any ideas as to what I am doing wrong ?
Cheers
Dave
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
OTICE")
logger.log("TESTING", "ALERT")
ALERT is above NOTICE & should log I am suspicious of
'(self.case[priority] | syslog.LOG_USER)' although it looks right and
have tried LOG_LOCAL6 etc but still no joy
syslog.closelog()
Still stuck
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
s:
http://www.prescod.net/python/pulldom.html
http://www.ibm.com/developerworks/xml/library/x-tipulldom.html
http://www.idealliance.org/papers/dx_xml03/papers/06-02-03/06-02-03.html
http://www.idealliance.org/papers/dx_xml03/papers/06-02-03/06-02-03.html#pull
Hope this helps.
Dave
--
.. thought it would continue its infinate loop. Any idea anyone ?
Cheers
Dave
import os, sys, time, signal, ConfigParser, kmotion_logger
class Kmotion_Hkd2:
def __init__(self):
self.snap_init = [ 0 for i in xrange(16) ]
self.snap_count = [ 0 for i in
ot notation). See:
http://docs.python.org/ref/import.html (and search for __init__)
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
//zope.org/
And, I do not know anything about this one, but it looks
interesting -- Skeletonz: http://orangoo.com/skeletonz/
You might also find helpful info at: http://www.cmsreview.com/
If you have success with one, please report back here with your
experience, suggestions, etc.
Dave
--
Dave Kuhlman
ht
ode distribution. In particular, these may be of
interest: reindent.py and tabify.py. And, for those who feel that
they must have some marker at the end of a block (in addition to an
"out-dent"), look at Tools/scripts/pindent.py.
Dave
--
thing that looks a bit
like an enum. If so, here is a Python idiom for enums:
Mode_none, Mode_moving, Mode_inserting, Mode_jumping = range(4)
action = Mode_moving
if action == Mode_jumping:
o
o
o
- Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
;s problem, you could also try map() and
a lambda:
', '.join(map(lambda x,y: '%s:%s' % (x, y, ), X, Y))
Or, maybe unrolling it makes it more readable:
In [31]: fn = lambda x,y: '%s:%s' % (x, y, )
In [32]: ', '.join(map(fn, a, b))
Out[32]: '
Hi all,
I need to write a newline at the end of a string I am appending to a
file. I tried ...
journal.write('%s#%s\n' % (jpeg[:-4], self.snap_init[feed]))
The text is all there but no new line at the end any idea what I
am doing wrong ? ... thought \n would do it.
Ch
perator" (parentheses).
Here is a trivial example:
def f1(x):
print 'f1: %s' % x
def f2(x):
print 'f2: %s' % x
def use_them(funcs):
for func in funcs:
func('abcd')
def test():
funcs = [f1, f2]
60
http://sourceforge.net/projects/pys60/
There is an emulator, so you can test some of your code without
even loading it onto a cell phone device.
This sounds like exciting stuff. Please keep us informed about
your progress.
- Dave
--
Dave
, in contrast with content management might mean
something slightly different to you.
- Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
le /etc/motion/motion.2.conf
[1] Thread is from /etc/motion/motion.1.conf
[2] Thread is from /etc/motion/motion.2.conf
[1] Thread started
[2] Thread started
[1] File of type 2 saved to: /var/lib/motion/20080203/01/tmp/175253.jpg
...etc ...
I just can't work out why this is happenin
0
I thought Python had a shorthand version of something like
self.snap_init[i] =
(items.has_keys('snapshot_interval'))?items['snapshot_interval']:0
Googled but no luck ... or is it my poor overloaded brain getting confused ?
Cheers
Dave
On Sat, Feb 09, 2008 at 09:21:41AM +, dave selby wrote:
> Hi all,
>
> Returning to python after a brief affair with C++, I have the following code
> ...
>
> if (items.has_keys('snapshot_interval')):
> self.snap_ini
racted from:
http://dirtsimple.org/2004/12/python-is-not-java.html
Maybe I'm "old school", but I still use getters and setters for
access from outside the class and direct access from within methods
in the class.
- Dave
[some good arguments snipped]
--
Dave Kuhlman
I have created a list of class instances, works a treat. I need to be
able to re __init__ the instances on a SIGHUP so I guess the best way
is to destroy them & re make them.
err ... how do I destroy an instance ?
Cheers
Dave
--
Please avoid sending me Word or PowerPoint attachments.
On Sun, Feb 24, 2008 at 04:14:02PM +, dave selby wrote:
> I have created a list of class instances, works a treat. I need to be
> able to re __init__ the instances on a SIGHUP so I guess the best way
> is to destroy them & re make them.
>
> err ... how do I destroy an in
On 24/02/2008, Dave Kuhlman <[EMAIL PROTECTED]> wrote:
> On Sun, Feb 24, 2008 at 04:14:02PM +0000, dave selby wrote:
> > I have created a list of class instances, works a treat. I need to be
> > able to re __init__ the instances on a SIGHUP so I guess the best way
> &
a clue but the Microsoft
Knowledge Base article it refers to does not appear to exist (any more ?).
Then again, it may be nothing to do with my actual IDLE problem.
http://www.python.org/doc/faq/windows.html#id15
I look forward to receiving any help
Cheers.
Dave Sh
= '[EMAIL PROTECTED]'
def email_test():
for trys in xrange(10):
try:
mail_server = SMTP(email_SMTP)
mail_server.login('', '')
subject = 'Test Email'
On Tuesday 06 December 2005 21:13, Liam Clarke-Hutchinson wrote:
> Hi Dave,
>
> IIRC The first argument to sendmail() is the name of the account that's
> sending... So when you include your subject there, it seems your ISP is
> somewhat forgiving.
>
> Liam Clarke-Hutchins
gt;
> Regards,
>
> Liam Clarke-Hutchinson
>
Thanks for that I 'pydoc smtplib' but got somewhat confused :)
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
;
> Liam
>
But its all worth it, problem now solved & work gets my emails :)
Cheers
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
sourceforge but
could not work out how to filter for Python.
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Friday 14 April 2006 11:07, Kent Johnson wrote:
> Dave S wrote:
> > Hi all,
> >
> > I have been playing around with Python for a while now and am looking
> > for open source KDE projects written in Python that I can help with /
> > learn from.
> >
>
elegant. It also
gives us the ability to write clearer and more maintainable code, for example,
separating the producer and consumer parts of our code. But, it does so only
if
we can work out a clear and unconfused way to explain and teach it. Thanks f
cation
imports the package or something in it.
Dave
[snip]
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
; > question clearly.
1. That's why we write and ask questions: to make things clear to
ourselves.
2. And the reason we teach (Python etc) is so that students ask us
questions and we are forced to explain ourselves, which enables
us to understand what we are talking about.
Dave
&
n scroll
down and look for "Templating Engines":
http://wiki.python.org/moin/WebProgramming
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
(after the command runs), read
from that pipe to get the results of your command (i.e. the text
that the command wrote to stdout).
Here is a simple example that uses popen2::
import os
def test():
instream, outstream = os.popen2('grep dave')
instream.write(
.org/, *and* check into the mailing lists there.
That's not just for your benefit; if there are problems with
SciPy, the people at that list will want to know about them.
[snip]
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
http://ipython.scipy.org/
Embedding IPython:
http://ipython.scipy.org/doc/manual/node9.html
Using the Python debugger (pdb) (with IPython):
http://ipython.scipy.org/doc/manual/node10.html
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
T
rder for this to work, I believe you will need:
my_zope_install/lib/python
on your PYTHONPATH.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ry reference, etc) are
reference docs, they do not replace tutorial books like "Learning
Python" or "Learn to Program Using Python" (by Alan Gauld, who
also posts on this list). Still I've found so much of what I need
in those documents, that I have a hard time complaining.
find these notes here:
http://www.rexx.com/~dkuhlman/python_comments.html#interfaces
I'll welcome any comments.
And, thanks for the interesting and helpful discussion on
interfaces, and other topics, on this list.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dku
There is also a NumPy page. But, I believe that NumPy is built
into SciPy. See:
- http://www.scipy.org/more_about_SciPy
- http://numpy.org/
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.p
python.org/lib/module-zipfile.html
- http://docs.python.org/lib/module-zlib.html
- http://docs.python.org/lib/module-gzip.html
- http://docs.python.org/lib/module-bz2.html
Dave
>
> -mtw
>
> On Wed, Jun 28, 2006 at 12:19:19AM +0200, Magnus Wirström ([EMAIL PROTECTED])
> wrote:
>
> a.count('ATTTA')
> 2
>
And, if you need to search for a more complicated pattern,
consider using the regular expression module (re):
>>> import re
>>> a = 'TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACATTTA'
>>> pat = re.compile('A
]:~/my_files/my_gg/gg1.4/get_data$ ./live_datad.py
Traceback (most recent call last):
File "./live_datad.py", line 15, in ?
from logger import log
ImportError: No module named logger
OK that's my problem
[EMAIL PROTECTED]:~/my_files/my_gg/gg1.4/get_data$ echo $PYTHONPATH
/hom
On Sunday 02 July 2006 11:29, Kent Johnson wrote:
> Dave S wrote:
> > > [EMAIL PROTECTED]:~/my_files/my_gg/gg1.4/get_data$ ./live_datad.py
> >
> > Traceback (most recent call last):
> > File "./live_datad.py", line 15, in ?
> > from logger impo
On Sun, Jul 02, 2006 at 11:55:24AM +0100, Dave S wrote:
[snip]
>
> Thanks for replying :)
>
> The app is fairly big and distributed around the gg1.4 directory. I get the
> feeling that 'from logger import log' is the first of a lot of import
> problems, this scrip
On Sunday 02 July 2006 17:02, Dave Kuhlman wrote:
> On Sun, Jul 02, 2006 at 11:55:24AM +0100, Dave S wrote:
>
> [snip]
>
> > Thanks for replying :)
> >
> > The app is fairly big and distributed around the gg1.4 directory. I get
> > the feeling that 'from lo
Here goes ...
I have two files test1 and test2 ...
[EMAIL PROTECTED]:~$ ls -l
total 37620
drwx-- 8 dave dave 4096 2006-06-30 23:26 Desktop
drwxr-xr-x 9 dave dave 4096 2006-06-15 22:48 google-earth
drwxr-xr-x 13 dave dave 4096 2006-05-27 09:51 my_files
drwxr-xr-x 2 dave dave
On Sun, Jul 02, 2006 at 10:32:51AM -0700, Danny Yoo wrote:
> > PYTHONPATH=/home/dave/my_files/my_gg/gg1.4/configs:/home/dave/my_files/my_gg/gg1.4/logs:/home/dave/my_files/my_gg/gg1.4/get_data:/home/dave/my_files/my_gg/gg1.4/gg_utils:/home/dave/my_files/my_gg/gg1.4/ipc:/home/dave/my_files
ed you could do that. It sound like a good
solution and a lot less messy than the way I have created my own modules &
scripts.
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Sunday 02 July 2006 18:32, Danny Yoo wrote:
> > PYTHONPATH=/home/dave/my_files/my_gg/gg1.4/configs:/home/dave/my_files/my
> >_gg/gg1.4/logs:/home/dave/my_files/my_gg/gg1.4/get_data:/home/dave/my_file
> >s/my_gg/gg1.4/gg_utils:/home/dave/my_files/my_gg/gg1.4/ipc:/home/dave/
On Sunday 02 July 2006 18:48, Dave Kuhlman wrote:
> On Sun, Jul 02, 2006 at 10:32:51AM -0700, Danny Yoo wrote:
> > > PYTHONPATH=/home/dave/my_files/my_gg/gg1.4/configs:/home/dave/my_files/
> > >my_gg/gg1.4/logs:/home/dave/my_files/my_gg/gg1.4/get_data:/home/dave/my_
> >
same problem.
Also I am struggling with "QObject.connect(self.tickerevent,
PYSIGNAL("ticker"), self.hello)" I am unsure of what the source of the
connect is - I suspect my guess of self.tickerevent is wrong. The source of
the event should be PYSIGNAL("ticker"
On Friday 14 July 2006 19:21, Dave S wrote:
> Hi all,
>
> I am trying to get to grips with QT, putting a friendly face on some of my
> apps :) Its early days and my first attempt but I expected the following to
> print 'hi it works' every second.
>
> There problem
key = 'k%d' % idx
...: d1[key] = idx * 10
...:
...:
In [3]: d1
Out[3]:
{'k0': 0,
'k1': 10,
'k2': 20,
'k3': 30,
'k4': 40,
'k5': 50,
'k6': 60,
'
On Friday 14 July 2006 23:21, Dave S wrote:
> On Friday 14 July 2006 19:21, Dave S wrote:
> > Hi all,
> >
> > I am trying to get to grips with QT, putting a friendly face on some of
> > my apps :) Its early days and my first attempt but I expected the
> > follo
And, for
example, add code to set a few temporary variables:
tmp1 = args[0]
tmp2 = tmp1[:0]
Then, in the debugger, inspect tmp1 and tmp2.
Or, just add a few print statements.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
of the object model and execution model of
Python. And, that's why compile-time (static) type checking in
Python is either impossible or would require type inference.
And, also, that's why the following statements all have exactly
the same effect:
total = 5
locals()['total'] = 5
exec('total = 5')
But, again, as Lloyd said, don't do that. (1) Use a dictionary of
your own and do a look up. Or, (2) implement a class that does a
lookup. Or, (3) use one of the other suggestion made on this
list.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
vironment variable PYTHONPATH. How you do
that depends on your platform (Linux, MS Windows, ...).
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Sat, Jul 22, 2006 at 01:41:17PM -0400, Kent Johnson wrote:
> Dave Kuhlman wrote:
[snip]
> > And, also, that's why the following statements all have exactly
> > the same effect:
> >
> > total = 5
> > locals()['total'] = 5
> > ex
Good morning,
I am having a problem with file open, read & write. The example shows my
problem. I would have expected it to print a sequence 1,2,3,4 incrementing
every time it is run.
#!/usr/bin/env python
import os, shutil, time
basher_dir = '/home/dave/PodCasts'
bit_bucke
On Thursday 27 July 2006 09:08, Andre Engels wrote:
> 2006/7/27, Dave S <[EMAIL PROTECTED]>:
> > It appears to be a problem with me opening the file as 'rw' although I
> > have googled and opening as 'rw' appears legal. Can you only open a file
> >
a few days ago.
I'm hoping that my notes show that I learned from that thread.
Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Thu, Jul 27, 2006 at 05:34:13PM +0100, Alan Gauld wrote:
> Hi Dave,
>
> You are causing yourself some confusion by still treating variables
> as something other than a name. Your first paragraph says:
>
> (Actually, functions and classes are just variables that hold
> r
On Thu, Jul 27, 2006 at 12:46:44PM -0400, Kent Johnson wrote:
> Dave Kuhlman wrote:
> > I've written up a few notes on Python namespaces and scopes. If
> > anyone has corrections, comments, or suggestions, I'd appreciate
> > them. You can find my comments here:
501 - 600 of 2089 matches
Mail list logo