Mike Meyer <[EMAIL PROTECTED]> writes:
> It sounds to me like your counter variable actually has meaning,
It depends how the code is written. In the example such as:
for meaningless_variable in xrange(number_of_attempts):
...
the loop variable really has no meaning. Rewriting this code on
Steve Brown wrote:
> I've got a series of modules which look like this:
>
> #
> #
> # Temperature Sense Test
> #
> #
> class Test3(ar_test.AR_TEST):
> """Temperature Sense Test"""
>
>
> I don't like the duplicated information: But the comment is attractive, and
> th
> Unfortunately, I don't *think* I can shut the
> warning for that line or function off, only for the entire file.
> Pylint gives you a rating of your quality of code which I think is
wrong :)
# pylint: disable-msg=X will only impact the current line!
$ cat -n dummy.py
1 for i in range(2):
On Jan 9, 9:47 pm, "Steve Brown" <[EMAIL PROTECTED]> wrote:
> I've got a series of modules which look like this:
>
> #
> #
> # Temperature Sense Test
> #
> #
> class Test3(ar_test.AR_TEST):
> """Temperature Sense Test"""
>
> I don't like the duplicated information: But t
On Wed, 9 Jan 2008 03:43:38 -0800 (PST), Tom La Bone
<[EMAIL PROTECTED]> wrote:
>
>Can someone suggest where to get a version of Gnuplot.py (for Windows) that
>has been updated to use numpy? Or, is there another interface available to
>use GnuPlot from Python?
>
>Thanks.
>
>Tom
Gnuplot 1.7 uses
[EMAIL PROTECTED] wrote:
>
>I'm just getting started with Python, and I want to do a bit of color
>tracking using VideoCapture. However, I've never worked with video or
>images, so I'm a little at a loss. How would I use VideoCapture to
>track a specified color, and its coordinates?
There's real
On Jan 9, 11:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Jan 9, 8:15 am, Paddy <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jan 9, 6:52 am, Paddy <[EMAIL PROTECTED]> wrote:
>
> > > On Jan 9, 2:19 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Greetings Pythoneers --
>
[EMAIL PROTECTED] wrote:
> Some of us over on edu-sig, one of the community actives,
> have been brainstorming around this Rich Data Structures
> idea, by which we mean Python data structures already
> populated with non-trivial data about various topics such
> as: periodic table (proton, neutron
John wrote:
> what i want to do is print a 'waiting' statement while a script is
> working-- the multithreading aspect isn't an issue, the printing on
> the same line is. i want to print something like:
>
> (1sec) working...
> (2sec) working
> (3sec) working.
>
>
> where the 'working' l
I've got a series of modules which look like this:
#
#
# Temperature Sense Test
#
#
class Test3(ar_test.AR_TEST):
"""Temperature Sense Test"""
I don't like the duplicated information: But the comment is attractive, and
the docstring self.__doc__ is already in use in
On Wed, 9 Jan 2008 18:49:36 -0800 (PST) erik gartz <[EMAIL PROTECTED]> wrote:
> The loop performs some actions with web services. The particular
> iteration I'm on isn't important to me. It is only important that I
> attempt the web services that number of times. If I succeed I
> obviously break ou
Ben Fisher wrote:
> I am trying to learn the best way to do intra-package references. My
> package looks like this:
...
> I had thought that "from PackageName.b import *" would work
In an attempt to hand oyu a net, rather than an answer:
Try using command line:
python -v whatever.py
You
Santiago Romero wrote:
>...
[I wrote]
>>def __init__( self, bw, bh, tiles ):
>> self.width, self.height = bw, bh
>> self.tilemap = array.array('b', [0]) * bw * bh
>> Gives a pure linearization (you do the math for lines).
> Do you mean : tilemap[(width*y)+x] ?
Yup, exac
erik gartz <[EMAIL PROTECTED]> writes:
> The loop performs some actions with web services. The particular
> iteration I'm on isn't important to me. It is only important that I
> attempt the web services that number of times. If I succeed I
> obviously break out of the loop and the containing funct
On Wed, 09 Jan 2008 18:10:03 -0800, PatrickMinnesota wrote:
> I know this isn't strictly a Python question, but I'm betting some here
> might be able to give me a hint.
>
> I have a few graphical programs doing some 2D data visualization using
> simple Pygame code for pseudo real-time animation.
On Wed, 09 Jan 2008 14:25:36 -0800, erik gartz wrote:
> Hi. I'd like to be able to write a loop such as: for i in range(10):
> pass
> but without the i variable. The reason for this is I'm using pylint and
> it complains about the unused variable i. I can achieve the above with
> more lines of
"Doug Morse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Hi Fredrik,
|
| I'm terribly confused. You want me to apologize for recommending that
someone
| buy your books? To apologize for noting that they are a quality
reference
| sources for Python?
As a past and future tech
PatrickMinnesota wrote:
> I know this isn't strictly a Python question, but I'm betting some
> here might be able to give me a hint.
>
> I have a few graphical programs doing some 2D data visualization using
> simple Pygame code for pseudo real-time animation. It's running
> under windows XP rig
On Jan 9, 9:49 pm, erik gartz <[EMAIL PROTECTED]> wrote:
> The loop performs some actions with web services. The particular
> iteration I'm on isn't important to me. It is only important that I
> attempt the web services that number of times. If I succeed I
> obviously break out of the loop and the
Hello all I did a Google search and found this site and was hoping someone
could help me with what I am sure is a simple question that I cannot figure
out. Here goes:
Given a simple straight through switch (SPST) with a supply of 14V,
and the need to simulate its intended load of 1
On Jan 1, 12:11 am, Scott David Daniels <[EMAIL PROTECTED]> wrote:
> Steven D'Aprano wrote:
> > On Mon, 31 Dec 2007 16:19:11 -0800, Scott David Daniels wrote:
>
> >> Steven D'Aprano wrote:
> >>> On Mon, 31 Dec 2007 08:03:22 -0800, Scott David Daniels wrote:
> Steven D'Aprano wrote: ...
> >
On Jan 9, 8:35 pm, Dan Sommers <[EMAIL PROTECTED]> wrote:
> On Wed, 09 Jan 2008 14:25:36 -0800, erik gartz wrote:
> > Hi. I'd like to be able to write a loop such as:
> > for i in range(10):
> > pass
> > but without the i variable. The reason for this is I'm using pylint and
> > it complains ab
Gordon C:
> This is very cool stuff but I suspect that the code is unreadable
> to many readers, including me. Just for fun here is a complete program,
> written in Turbo Pascal, circa 1982, that does the job. Readable
> n'est pas?
I think it's quite readable, especially if you indent it more
cor
On Jan 2, iu2 <[EMAIL PROTECTED]> wrote:
> I missed new style classes though... Now I know how to use them (not
> fully), but I must say it has been difficult. I'll appreciate some
> good documentation about them.
>
> Thanks
> iu2
This is a decent start:
http://www.python.org/doc/newstyle/
Cheers
> > > The OP was looking for presentation though. I know roundup has
> > > code for this if an independent library can't be found.
> >
> > Thanks for all the responses!
> > Indeed I was looking for presentation and not parsing, I'll take a
> > look at roundup.
>
> Yes, that's why I indicated that C
I know this isn't strictly a Python question, but I'm betting some
here might be able to give me a hint.
I have a few graphical programs doing some 2D data visualization using
simple Pygame code for pseudo real-time animation. It's running
under windows XP right now, but eventually it'll need to
On Wed, 09 Jan 2008 21:26:05 +0100, Bruno Desthuilliers wrote:
> hint: how can a compiler safely optimize anything in a language so
> dynamic that even the class of an object can be changed at runtime ?
Is that a trick question?
By finding things to optimize that *can't* change at runtime.
E.g.
On Jan 9, 11:17 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>
> > The underscore is used as "discarded" identifier. So maybe
>
> > for _ in xrange(10):
> > ...
>
> The problem with the '_' name is that it is already well-known and
> long-used exist
On Wed, 09 Jan 2008 14:25:36 -0800, erik gartz wrote:
> Hi. I'd like to be able to write a loop such as:
> for i in range(10):
> pass
> but without the i variable. The reason for this is I'm using pylint and
> it complains about the unused variable i ...
What does that loop do? (Not the loop
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> And the reference implementation of Python (CPython) is not
> interpreted, it's compiled to byte-code, which is then executed by a VM
> (just like Java).
Wow, this is pretty misleading.
Java is, indeed, compiled to bytecode; however, modern JVMs
This is very cool stuff but I suspect that the code is unreadable to many
readers, including me. Just for fun here is a complete program, written in
Turbo Pascal, circa 1982, that does the job. Readable n'est pas?
Program dash;
var str: string[80];
n: integer;
odd: boolean;
begin
On Wed, 9 Jan 2008 15:45:41 -0800 (PST) "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Okay I profiled the code and here is the output:
>
> http://heightened.files.wordpress.com/2008/01/output.txt
>
> It seems that the function it spends the longest on is the red_points
> function that he use
On Jan 10, 10:00 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> >> Hi. I'd like to be able to write a loop such as:
> >> for i in range(10):
> >> pass
> >> but without the i variable. The reason for this is I'm using pylint
> >> and it complains about the unused variable i.
>
> > if a computer tell
On Jan 9, 12:19 pm, Bruno Desthuilliers wrote:
> Andrew Savige a écrit :
> > and the -x hack above to
> > achieve a descending sort feels a bit odd to me, though I couldn't think
> > of a better way to do it.
>
> The "other" way would be to pass a custom comparison callback to sort,
> which would
On Jan 9, 12:19 pm, Bruno Desthuilliers wrote:
> Andrew Savige a écrit :
>
>
>
> > I'm learning Python by reading David Beazley's "Python Essential Reference"
> > book and writing a few toy programs. To get a feel for hashes and sorting,
> > I set myself this little problem today (not homework, BT
Okay I profiled the code and here is the output:
http://heightened.files.wordpress.com/2008/01/output.txt
It seems that the function it spends the longest on is the red_points
function that he uses to find the points.
--
http://mail.python.org/mailman/listinfo/python-list
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
> The underscore is used as "discarded" identifier. So maybe
>
> for _ in xrange(10):
> ...
The problem with the '_' name is that it is already well-known and
long-used existing convention for an entirely unrelated purpose: in
the 'gettext' i18n
On 10 jan, 00:02, "[EMAIL PROTECTED]" >
(sorry, hit the wrong key - time to bed I guess...)
> If none of the two above answers fits your needs, and no Python Guru
> comes with a better answer, then I'm afraid you'll have to go for a
> language with a faster implementation. Python is quite faster
This archival (yet recent) posting to an obscure physics list might
be of some interest to those taking a longer view. The work/study
projects described below come from an Oregon think tank working
in private-public partnerships on education policy. I'm one of the
principals.
Kirby
=
Dat
On Jan 9, 8:15 am, Paddy <[EMAIL PROTECTED]> wrote:
> On Jan 9, 6:52 am, Paddy <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jan 9, 2:19 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Greetings Pythoneers --
>
> > > Some of us over on edu-sig, one of the community actives,
> > > have been
erik gartz schrieb:
> Hi. I'd like to be able to write a loop such as:
> for i in range(10):
> pass
> but without the i variable. The reason for this is I'm using pylint
> and it complains about the unused variable i.
Pychecker won't complain if you rename 'i' to '_', IIRC:
for _ in range(10)
On 9 jan, 21:46, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Thanks for the clarification.
>
> Though I was hoping someone could give me a definitive answer.
Sorry - but I'm definitively not the right person on this...
> I was
> quite excited about this project initially, but seeing the act
>> Hi. I'd like to be able to write a loop such as:
>> for i in range(10):
>> pass
>> but without the i variable. The reason for this is I'm using pylint
>> and it complains about the unused variable i.
>
> if a computer tells you to do something stupid, it's often better to
> find a way to t
erik gartz schrieb:
> Hi. I'd like to be able to write a loop such as:
> for i in range(10):
> pass
> but without the i variable. The reason for this is I'm using pylint
> and it complains about the unused variable i. I can achieve the above
> with more lines of code like:
> i = 0
> while (i !=
On Jan 9, 3:52 pm, Waldemar Osuch <[EMAIL PROTECTED]> wrote:
> On Jan 9, 11:47 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote:
>
>
>
> > So sorry because I know I'm doing something wrong.
>
> > 574 > cat c2.py
> > #! /usr/local/bin/python2.4
>
> > def inc(jj):
> > def dummy():
> > jj =
"Daniel Fetchinson" <[EMAIL PROTECTED]> writes:
> > The OP was looking for presentation though. I know roundup has
> > code for this if an independent library can't be found.
>
> Thanks for all the responses!
> Indeed I was looking for presentation and not parsing, I'll take a
> look at roundup.
Christian Heimes <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] wrote:
> > [...] after running the code with the included sample input file,
> > it seems quite slow (1-2 seconds from start to finish to do the
> > 800 by 600 gif image).
>
> Have you profiled your application? Do you know the bott
On Jan 9, 11:47 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote:
> So sorry because I know I'm doing something wrong.
>
> 574 > cat c2.py
> #! /usr/local/bin/python2.4
>
> def inc(jj):
> def dummy():
> jj = jj + 1
> return jj
> return dummy
>
> h = inc(33)
> print 'h() = '
bsneddon wrote:
> This seemed to work for me if you are using 2.4 or greater and
> like list comprehension.
dict([ tuple(a.split("=")) for a in mylist[1:-1]])
> {'mike': 'manager', 'paul': 'employee', 'tom': 'boss'}
>
> should be faster than looping
That's what he's doing (well, a generator
On Dec 27 2007, 5:25 pm, Ian Clark <[EMAIL PROTECTED]> wrote:
> On 2007-12-27, SMALLp <[EMAIL PROTECTED]> wrote:
>
> > connectionString = {"host":"localhost", "user":"root",
> > "passwd":"pofuck", "db":"fileshare"}
> > dataTable = "files"
> > conn = mysql.connect(host=connectionString["host"],
> >
erik gartz wrote:
> Hi. I'd like to be able to write a loop such as:
> for i in range(10):
> pass
> but without the i variable. The reason for this is I'm using pylint
> and it complains about the unused variable i.
if a computer tells you to do something stupid, it's often better to
find a
Hi. I'd like to be able to write a loop such as:
for i in range(10):
pass
but without the i variable. The reason for this is I'm using pylint
and it complains about the unused variable i. I can achieve the above
with more lines of code like:
i = 0
while (i != 10):
i += 1
Is there a concise
On Jan 10, 7:34 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of John Machin
> > Sent: Wednesday, January 09, 2008 3:02 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: problem of converting a
On Jan 9, 9:39 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Paddy wrote:
> > To see how they act against 'corner cases' and
> > an exercise for me in trying to create corner cases. (I'm in to
> > functional testing at the mo').
>
> sounds more like "pulling requirements out of thin air". not sur
On Jan 9, 3:22 pm, Stef Mientki <[EMAIL PROTECTED]> wrote:
> hello,
>
> I'm trying to convert the links in html pages to absolute links,
> these pages can either be webpages or files on local harddisk (winXP).
> Now I've struggling for a while, and this code works a lilttle:
>
> i = line.find
On Jan 9, 9:29 pm, Paddy <[EMAIL PROTECTED]> wrote:
> On Jan 9, 8:56 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>
> > Donald 'Paddy' McCarthy wrote:
> > > I created some more test strings and ran posters solutions against them.
>
> > the point being?
>
> >
>
> To see how they act against 'corner
Paddy wrote:
> To see how they act against 'corner cases' and
> an exercise for me in trying to create corner cases. (I'm in to
> functional testing at the mo').
sounds more like "pulling requirements out of thin air". not sure that
helps the OP get a better understanding of Python, really.
hello,
I'm trying to convert the links in html pages to absolute links,
these pages can either be webpages or files on local harddisk (winXP).
Now I've struggling for a while, and this code works a lilttle:
i = line.find ( 'href=' )
if i < 0 :
i = line.find ( ' src='
On Jan 9, 8:56 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Donald 'Paddy' McCarthy wrote:
> > I created some more test strings and ran posters solutions against them.
>
> the point being?
>
>
To see how they act against 'corner cases' and
an exercise for me in trying to create corner cases. (I
On Jan 9, 8:47 pm, [EMAIL PROTECTED] wrote:
> Donald 'Paddy' McCarthy:
>
> [... lots and lots and lots of tests...]
>
> C'mon Paddy, where are the timings too? Are you becoming lazy
> lately? ;-)
>
> Bear bugs,
> bearophile
Get it right before you get it fast. But what is 'right'.
--
http://mail.
Doug Morse wrote:
> I'm terribly confused. You want me to apologize for recommending that someone
> buy your books? To apologize for noting that they are a quality reference
> sources for Python?
for implying that the material in them is copied from the python.org
handbooks. at least that's w
[EMAIL PROTECTED] wrote:
> I'm pretty new to Python, and even newer to Image/Video processing,
> and trying to get started on a project similar to GRL Vienna's laser
> marker. I found some sample code here
> http://janto.blogspot.com/2006/01/motion-capture-in-python.html,
> but after running the c
Hi Fredrik,
I'm terribly confused. You want me to apologize for recommending that someone
buy your books? To apologize for noting that they are a quality reference
sources for Python?
Doug
On Wed, 09 Jan 2008 21:59:34 +0100, Fredrik Lundh <[EMAIL PROTECTED]>
wrote:
> Doug Morse wrote:
>
> >
> For PARSING see http://code-bear.com/code/parsedatetime/
>
> The OP was looking for presentation though. I know roundup has code for
> this if an independent library can't be found.
Thanks for all the responses!
Indeed I was looking for presentation and not parsing, I'll take a
look at roundup
On Wed, 9 Jan 2008 14:34:26 -0600 "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of John Machin
> > Sent: Wednesday, January 09, 2008 3:02 PM
> > To: python-list@python.org
> > Subject: Re: pro
Donald 'Paddy' McCarthy wrote:
> I created some more test strings and ran posters solutions against them.
the point being?
--
http://mail.python.org/mailman/listinfo/python-list
Doug Morse wrote:
> Several of the O'Reilly & Assoc. books -- such as Python in a Nutshell, The
> Python Standard Library, etc -- are in large part reproductions of the
> official docs and references.
if you're using "reproduction" to mean "copy", I think you owe both me
and Alex a big apology.
[Ben Fisher]
> I am trying to learn the best way to do intra-package references.
IMO, the email package is a stellar example of best practices using
packages.
> I have layered the dependencies so that a depends on b,
>b depends on c, and c depends on d.
For the most part, I think packages tend
Ben Fisher wrote:
> One way to get this to work is:
>
> def inc(jj):
> def dummy(jj = jj):
> jj = jj + 1
> return jj
> return dummy
>
> h = inc(33)
> print h()
>
> It's not very pretty though, especially when you have many variables
> you want to have in
On Jan 9, 8:24 pm, Mike Meyer <[EMAIL PROTECTED]> wrote:
> On Wed, 9 Jan 2008 13:47:30 -0500 (EST) "Steven W. Orr" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > So sorry because I know I'm doing something wrong.
>
> > 574 > cat c2.py
> > #! /usr/local/bin/python2.4
>
> > def inc(jj):
> > def dummy()
Several of the O'Reilly & Assoc. books -- such as Python in a Nutshell, The
Python Standard Library, etc -- are in large part reproductions of the
official docs and references. So, while not exactly what you asked for, the
ORA books might be a viable alternative if what you want isn't available.
Donald 'Paddy' McCarthy:
[... lots and lots and lots of tests...]
C'mon Paddy, where are the timings too? Are you becoming lazy
lately? ;-)
Bear bugs,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the clarification.
Though I was hoping someone could give me a definitive answer. I was
quite excited about this project initially, but seeing the actual
execute times was a big downer. Seeing that the original laser marker
by GRL Vienna is done in Processing which from what I know is
Howdy kynnjo,
> Is it possible to buy the official Python docs in book form? If
> so, I'd very much appreciate the name(s) and author(s) of the
> book(s).
I haven't seen them in print form, but you can download PDF's from
here:
http://docs.python.org/download.html
--gordy
--
http://mail.pytho
One way to get this to work is:
def inc(jj):
def dummy(jj = jj):
jj = jj + 1
return jj
return dummy
h = inc(33)
print h()
It's not very pretty though, especially when you have many variables
you want to have in the inner scope.
-Ben
On 1/9/08, Mi
On Wed, 9 Jan 2008 15:07:16 -0500, Ben Fisher <[EMAIL PROTECTED]> wrote:
>I am trying to learn the best way to do intra-package references. My
>package looks like this:
>
>PackageName
>__init__.py
>/a
>__init__.py
> a.py
>...
>/b
>__init__.py
>...
>
On Jan 9, 7:41 am, "Neil Cerutti" <[EMAIL PROTECTED]> wrote:
> On Jan 9, 2008 5:34 AM, cesco <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > say I have a string like the following:
> > s1 = 'hi_cat_bye_dog'
> > and I want to replace the even '_' with ':' and the odd '_' with ','
> > so that I get a new
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of John Machin
> Sent: Wednesday, January 09, 2008 3:02 PM
> To: python-list@python.org
> Subject: Re: problem of converting a list to dict
>
> On Jan 10, 6:52 am, "Reedick, Andrew" <[EMAIL PROTECT
On Wed, 9 Jan 2008 13:47:30 -0500 (EST) "Steven W. Orr" <[EMAIL PROTECTED]>
wrote:
> So sorry because I know I'm doing something wrong.
>
> 574 > cat c2.py
> #! /usr/local/bin/python2.4
>
> def inc(jj):
> def dummy():
> jj = jj + 1
> return jj
> return dummy
>
> h =
On Jan 9, 3:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > mylist=['','tom=boss','mike=manager','paul=employee','meaningless']
>
> > I'd like to remove the first and the last item as they are irrevalent,
> > and convert it to the dict:
> > {'tom':'boss','mike':'manager','paul':'employee'}
>
> > I
cesco wrote:
I created some more test strings and ran posters solutions against them.
results attached.
- Paddy.
# alternating_replacements.py
tests = " 1 2_ 3_4 5_6_ 7_8_9 10_11_12_ 13_14_15_16 17_18_19_20_" \
" _ _21 _22_ _23_24 _25_26_ _27_28_29 _30_31_32_ _33_34_35_36" \
" __ _
On Jan 10, 7:12 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> > mylist=['','tom=boss','mike=manager','paul=employee','meaningless']
>
> > I'd like to remove the first and the last item as they are irrevalent,
> > and convert it to the dict:
> > {'tom':'boss','mike':'manager','paul':'employee'}
>
> > I
[EMAIL PROTECTED] a écrit :
> I'm pretty new to Python, and even newer to Image/Video processing,
> and trying to get started on a project similar to GRL Vienna's laser
> marker. I found some sample code here
> http://janto.blogspot.com/2006/01/motion-capture-in-python.html,
> but after running th
On Jan 9, 5:56 am, Svenn Are Bjerkem <[EMAIL PROTECTED]>
wrote:
>I have been looking for a way to execute this command
> as a part of a script, but it seems that the changes are only valid in
> the context of the script and when the script exits, the current shell
> still have the original "users"
> mylist=['','tom=boss','mike=manager','paul=employee','meaningless']
>
> I'd like to remove the first and the last item as they are irrevalent,
> and convert it to the dict:
> {'tom':'boss','mike':'manager','paul':'employee'}
>
> I tried this but it didn't work:
>
> mydict={}
> for i in mylist[
Sion Arrowsmith wrote:
> Robert Latest <[EMAIL PROTECTED]> wrote:
>> BTW, where can I find all methods of the built-in types?
>>Section 3.6 only talks about strings and mentions the list append() method
>>only in an example. Am I too stupid to read the manual, or is this an
>>omission?
>
> 3.6
I am trying to learn the best way to do intra-package references. My
package looks like this:
PackageName
__init__.py
/a
__init__.py
a.py
...
/b
__init__.py
...
/c
__init__.py
...
/d
__init__.py
...
I have l
John Machin wrote:
> When mixing unicode strings with byte strings, Python attempts to
> decode the str object to unicode, not encode the unicode object to
> str.
Thanks for the explanation. Of course I didn't want to mix Unicode and Latin
in one string, my snippet just tried to illustrate the p
On Jan 10, 6:52 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of Fredrik Lundh
> > Sent: Wednesday, January 09, 2008 2:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: problem of converting
oops, it seems there are other 'meaningless' item, which actually
caused the problem
Thanks for helps
--
http://mail.python.org/mailman/listinfo/python-list
Is it possible to buy the official Python docs in book form? If
so, I'd very much appreciate the name(s) and author(s) of the
book(s).
TIA!
kynnjo
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
ht
Santiago Romero:
> - Speed Performance: Do you think that changing from list to Array()
> would improve speed? I'm going to do lots of tilemap[y][x] checks (I
> mean, player jumping around the screen, checking if it's falling over
> a non-zero tile, and so).
First of all: if you have enough memory
On Jan 10, 6:30 am, John <[EMAIL PROTECTED]> wrote:
> On Jan 9, 12:14 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
>
>
>
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:python-
> > > [EMAIL PROTECTED] On Behalf Of Martin Marcher
> > > Sent: Wednesday, January 09, 2008 11:
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Fredrik Lundh
> Sent: Wednesday, January 09, 2008 2:39 PM
> To: python-list@python.org
> Subject: Re: problem of converting a list to dict
>
> [EMAIL PROTECTED] wrote:
>
> >> to see what's goin
On Jan 10, 5:56 am, [EMAIL PROTECTED] wrote:
> Hi pals
>
> I have a list like this
>
> mylist=['','tom=boss','mike=manager','paul=employee','meaningless']
>
> I'd like to remove the first and the last item as they are irrevalent,
> and convert it to the dict:
> {'tom':'boss','mike':'manager','paul'
[EMAIL PROTECTED] wrote:
>> to see what's going on on your machine, try printing "a" after the
>> split, but before you use it to populate the dictionary.
>
> 'print a' works
so what does it tell you?
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 9, 12:14 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of Martin Marcher
> > Sent: Wednesday, January 09, 2008 11:57 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: printing dots in si
On Jan 9, 3:05 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I have a list like this
>
> > mylist=['','tom=boss','mike=manager','paul=employee','meaningless']
>
> > I'd like to remove the first and the last item as they are irrevalent,
> > and convert it to the dict:
>
that's very strange...
the list I give here is almost same as the real list, except for the
length.
Thanks Marc, I'll go check what's wrong elsewhere
--
http://mail.python.org/mailman/listinfo/python-list
I'm pretty new to Python, and even newer to Image/Video processing,
and trying to get started on a project similar to GRL Vienna's laser
marker. I found some sample code here
http://janto.blogspot.com/2006/01/motion-capture-in-python.html,
but after running the code with the included sample input
1 - 100 of 213 matches
Mail list logo