class as well. The text book for this class is Python for the
> Absolute Beginner or something similar to that name.
>
> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly th
book for this class is Python for the
>Absolute Beginner or something similar to that name.
>
>I was wondering if anyone had any opinions on what other titles I
>could look into since this one seems from a glance at reviews to be
>teaching mainly through game programming (a topic I'm
On 12 jan, 21:04, Landon <[EMAIL PROTECTED]> wrote:
> One thing I wonder about is the examples these books use to teach the
> concepts. I found myself really attached to K&R because the end of
> section projects were utilities that I would find be able to find
> useful in day to day work such as a
On Jan 12, 4:04 pm, Landon <[EMAIL PROTECTED]> wrote:
> One thing I wonder about is the examples these books use to teach the
> concepts. I found myself really attached to K&R because the end of
> section projects were utilities that I would find be able to find
> useful in day to day work such as
One thing I wonder about is the examples these books use to teach the
concepts. I found myself really attached to K&R because the end of
section projects were utilities that I would find be able to find
useful in day to day work such as a version of wc and a program that
would take collapse all con
> the class as well. The text book for this class is Python for the
> Absolute Beginner or something similar to that name.
>
> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainl
On Jan 12, 2:03 am, Landon <[EMAIL PROTECTED]> wrote:
> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly through game programming (a topic I'm not too
> interested in) or if this one is a quali
On Jan 12, 7:47 am, Ben Finney <[EMAIL PROTECTED]>
wrote:
> Landon <[EMAIL PROTECTED]> writes:
> > I was wondering if anyone had any opinions on what other titles I
> > could look into since this one seems from a glance at reviews to be
> > teaching mainly through game programming (a topic I'm not
class as well. The text book for this class is Python for the
> Absolute Beginner or something similar to that name.
>
> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly th
Landon <[EMAIL PROTECTED]> writes:
> I was wondering if anyone had any opinions on what other titles I
> could look into since this one seems from a glance at reviews to be
> teaching mainly through game programming (a topic I'm not too
> interested in) or if this one is a quality book by itself.
Look at
http://www.python.org/doc/
. The tutorial is quite good.
Jim
--
http://mail.python.org/mailman/listinfo/python-list
Hi, I'm a freshman in college and I'm going to be taking an intro to
programming course next semester which mainly uses Python, so I
thought it might be a good time to pick up Python beyond the scope of
the class as well. The text book for this class is Python for the
Absolute B
SMALLp a écrit :
(snip)
> One more question. How does my code looks like. I couldn't find any open
> source program written in python
You must be jocking ?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] a écrit :
> On Dec 21, 9:11 am, SMALLp <[EMAIL PROTECTED]> wrote:
>
(snip)
>>class insertData:
>>def insert(self, dataTable, data):
(snip)
>
> I think you need to post the real traceback or the real code since
> your error message doesn't look like it has anything to do
On Dec 21, 1:44 pm, SMALLp <[EMAIL PROTECTED]> wrote:
> Carsten Haese wrote:
> > On Fri, 2007-12-21 at 18:06 +0100, SMALLp wrote:
> sql ="INSERT INTO "+dataTable+" (user_name, file_name,
> file_size,
> file_path_local, file_path_FTP, curent_location, FTP_valid_time,
Carsten Haese wrote:
> On Fri, 2007-12-21 at 18:06 +0100, SMALLp wrote:
sql ="INSERT INTO "+dataTable+" (user_name, file_name,
file_size,
file_path_local, file_path_FTP, curent_location, FTP_valid_time,
uploaded, last_modified, last_verified, file_type, file_cat
On Fri, 2007-12-21 at 18:06 +0100, SMALLp wrote:
> >> sql ="INSERT INTO "+dataTable+" (user_name, file_name,
> >> file_size,
> >> file_path_local, file_path_FTP, curent_location, FTP_valid_time,
> >> uploaded, last_modified, last_verified, file_type, file_category) VLAUES
> >> "+da
[EMAIL PROTECTED] wrote:
>> Traceback (most recent call last):
>>File "/home/pofuk/MzMFIleShare/sharePanel.py", line 130, in share
>> self.scanDirsAndFiles(dirPath)
>>File "/home/pofuk/MzMFIleShare/sharePanel.py", line 158, in
>> scanDirsAndFiles
>> sql.insertData.insert("files",
> Traceback (most recent call last):
>File "/home/pofuk/MzMFIleShare/sharePanel.py", line 130, in share
> self.scanDirsAndFiles(dirPath)
>File "/home/pofuk/MzMFIleShare/sharePanel.py", line 158, in
> scanDirsAndFiles
> sql.insertData.insert("files", data)
> TypeError: unbound met
On Dec 21, 2007 9:11 AM, SMALLp <[EMAIL PROTECTED]> wrote:
> Hy! I have error something like this
>
> TypeError: unbound method insert() must be called with insertData
> instance as first argument (got str instance instead)
>
> CODE:
>
> File1.py
> sql.insertData.insert("files", data)
>
> sql.py
>
[EMAIL PROTECTED] wrote:
> On Dec 21, 9:11 am, SMALLp <[EMAIL PROTECTED]> wrote:
>> Hy! I have error something like this
>>
>> TypeError: unbound method insert() must be called with insertData
>> instance as first argument (got str instance instead)
>>
>> CODE:
>>
>> File1.py
>> sql.insertData.inse
On Dec 21, 9:11 am, SMALLp <[EMAIL PROTECTED]> wrote:
> Hy! I have error something like this
>
> TypeError: unbound method insert() must be called with insertData
> instance as first argument (got str instance instead)
>
> CODE:
>
> File1.py
> sql.insertData.insert("files", data)
>
> sql.py
>
> cla
Hy! I have error something like this
TypeError: unbound method insert() must be called with insertData
instance as first argument (got str instance instead)
CODE:
File1.py
sql.insertData.insert("files", data)
sql.py
class insertData:
def insert(self, dataTable, data):
Thank you for your help, it is really appreciated. I'll post back if
there are any more problems.
--
http://mail.python.org/mailman/listinfo/python-list
Ionis a écrit :
> Hey guys, hope you can help me here. I've been playing with python for
> about a week or two and I've been reading "A Byte Of Python" to get me
> on my feet. I've decided to write a program which will list all ID3
> information in a directory of .mp3 files into a .html file.
>
>
On Dec 5, 2:04 pm, Ionis <[EMAIL PROTECTED]> wrote:
> On Dec 5, 11:59 am, Chris <[EMAIL PROTECTED]> wrote:
>
> > Ok, just noticed you linked the id3reader. I tested my code and it
> > worked fine.
>
> Thanks alot Chris. Could you comment your code so I can see what each
> line is doing? I hope tha
On Dec 5, 11:59 am, Chris <[EMAIL PROTECTED]> wrote:
> Ok, just noticed you linked the id3reader. I tested my code and it
> worked fine.
Thanks alot Chris. Could you comment your code so I can see what each
line is doing? I hope that isn't a problem. Still pretty new to python.
--
http://mail.py
Ok, just noticed you linked the id3reader. I tested my code and it
worked fine.
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 5, 1:43 pm, Ionis <[EMAIL PROTECTED]> wrote:
> Hey guys, hope you can help me here. I've been playing with python for
> about a week or two and I've been reading "A Byte Of Python" to get me
> on my feet. I've decided to write a program which will list all ID3
> information in a directory of
Hey guys, hope you can help me here. I've been playing with python for
about a week or two and I've been reading "A Byte Of Python" to get me
on my feet. I've decided to write a program which will list all ID3
information in a directory of .mp3 files into a .html file.
The python script I'm using
On Nov 17, 12:41 am, Wildemar Wildenburger
<[EMAIL PROTECTED]> wrote:
> It is true that I could have been way more polite.
I don't see how. You said "please" read it. You didn't make fun of
the poor spelling and said nothing rude.
I can't agree that the response "reeks of arrogance." I've seen
>> You know, I've always wanted ask; if plans are afoot, what are hands?
> The answer, seeing as it's late, is that whisky is at hand.
Ha. Brilliant answer! It also explains decorators :D
/d
--
http://mail.python.org/mailman/listinfo/python-list
"Donn Ingle" wrote:
> > plans are afoot
> You know, I've always wanted ask; if plans are afoot, what are hands?
>
> :D
>
> Sorry, it's late.
The answer, seeing as it's late, is that whisky is at hand.
- Hendrik
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> On Nov 15, 2:38 pm, "SMALLp" <[EMAIL PROTECTED]> wrote:
>> Could someone please paste some program in wxPython that uses inharitance. I
>> would be very thankfull.
>
> Most examples of wxPython use inheritance. I would recommend going to
> their website and downloading t
On 11/16/07, Shawn Milochik <[EMAIL PROTECTED]> wrote:
> I completely support Wildemar. Lazy questions like that deserve absolutely
> nothing.
>
> I agree that cushioning the reply with a brief explanation of why that
> question sucks would have helped the original poster, but he doesn't deserve
>
Dave WB3DWE wrote:
> Have given up Java. Want to switch to Python. But _which_ ?
> There is ver :
> 2.5 out now
> 2.6 in beta , final expected Apr 2008
> 3.0 ? in alpha or beta
> 3.0 final expected Sep 2008 ?
> Will the real python please stand up.
> Thanks, Dave WB3DW
On Nov 17, 4:20 pm, Dave WB3DWE wrote:
> Have given up Java. Want to switch to Python. But _which_ ?
> There is ver :
> 2.5 out now
> 2.6 in beta , final expected Apr 2008
> 3.0 ? in alpha or beta
> 3.0 final expected Sep 2008 ?
> Will the real python please stand up.
> T
> plans are afoot
You know, I've always wanted ask; if plans are afoot, what are hands?
:D
Sorry, it's late.
/d
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 17, 2007 6:20 PM, <[EMAIL PROTECTED]> wrote:
> Have given up Java. Want to switch to Python.
Welcome!
> But _which_ ?
> There is ver :
> 2.5 out now
> 2.6 in beta , final expected Apr 2008
You should go for 2.5.1 unless you have a reason to stick to an older
version. (Such re
On 11/17/07, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
>Have given up Java. Want to switch to Python. But _which_ ?
>There is ver :
> 2.5 out now
> 2.6 in beta , final expected Apr 2008
> 3.0 ? in alpha or beta
> 3.0 final expected Sep 2008 ?
>Will the real python please s
On Nov 17, 12:20 pm, Dave WB3DWE wrote:
> Have given up Java. Want to switch to Python. But _which_ ?
> There is ver :
> 2.5 out now
> 2.6 in beta , final expected Apr 2008
> 3.0 ? in alpha or beta
> 3.0 final expected Sep 2008 ?
This is not for us to decide, but rather fo
Have given up Java. Want to switch to Python. But _which_ ?
There is ver :
2.5 out now
2.6 in beta , final expected Apr 2008
3.0 ? in alpha or beta
3.0 final expected Sep 2008 ?
Will the real python please stand up.
Thanks, Dave WB3DWE [EMAIL PROTECTED]
--
http://
I completely support Wildemar. Lazy questions like that deserve absolutely
nothing.
I agree that cushioning the reply with a brief explanation of why that
question sucks would have helped the original poster, but he doesn't deserve
any effort from any of us until he has shown evidence of his own e
Tony wrote:
> On Nov 15, 8:57 pm, Wildemar Wildenburger
> Give me back the old comp.lang.python, where anyone could ask anything
> and be sure of a range of replies, instead of this sort of
> pedanticism. Sorry, nothing personal, maybe Python users have become
> too professional and geeky to rememb
On Nov 15, 2:38 pm, "SMALLp" <[EMAIL PROTECTED]> wrote:
> Could someone please paste some program in wxPython that uses inharitance. I
> would be very thankfull.
Most examples of wxPython use inheritance. I would recommend going to
their website and downloading the demo as it has lots of code to l
On Nov 15, 8:38 pm, "SMALLp" <[EMAIL PROTECTED]> wrote:
> Could someone please paste some program in wxPython that uses inharitance. I
> would be very thankfull.
HI SMALLp: welcome to Python!
Here is a link that shows some basics of inheritance in Wx, try other
searches on Google:)
http://www.ib
On Nov 15, 8:57 pm, Wildemar Wildenburger
<[EMAIL PROTECTED]> wrote:
>
> Please read this:
> http://www.catb.org/~esr/faqs/smart-questions.html>
>
> Then ask again.
>
> /W
Give me back the old comp.lang.python, where anyone could ask anything
and be sure of a range of replies, instead of this sort
SMALLp wrote:
> Could someone please paste some program in wxPython that uses inharitance. I
> would be very thankfull.
>
Please read this:
http://www.catb.org/~esr/faqs/smart-questions.html>
Then ask again.
/W
--
http://mail.python.org/mailman/listinfo/python-list
Could someone please paste some program in wxPython that uses inharitance. I
would be very thankfull.
--
http://mail.python.org/mailman/listinfo/python-list
> "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>>
>> Why not just build a new list? E.g.
>>
>>newdevs = []
>>for dev in devs :
>>...
>>if not removing_dev :
>>newdevs.append(dev)
>>#end if
>>#end for
>>devs =
"Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in
message
news:[EMAIL PROTECTED]
Why not just build a new list? E.g.
newdevs = []
for dev in devs :
...
if not removing_dev :
newdevs.append(dev)
#end if
#end for
devs = newdevs
En Sun, 09 Sep 2007 22:58
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes:
> On Mon, 10 Sep 2007 17:42:16 +1000, bambam wrote:
>
>> "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in
>> message news:[EMAIL PROTECTED]
>>> In message <[EMAIL PROTECTED]>, bambam wrote:
>>>
Thank you,
>>>
>>> Don't top-post.
>>
>> I h
On Mon, 10 Sep 2007 17:42:16 +1000, bambam wrote:
> "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in
> message news:[EMAIL PROTECTED]
>> In message <[EMAIL PROTECTED]>, bambam wrote:
>>
>>> Thank you,
>>
>> Don't top-post.
>
> I have a number of news readers here, but all of them work
> better
A: Skid-marks in front of the hedgehog.
Q: What's the difference between a dead hedgehog on the road, and a dead
top-poster on the road?
--
http://mail.python.org/mailman/listinfo/python-list
On 9/10/07, bambam <[EMAIL PROTECTED]> wrote:
>
> I have a number of news readers here, but all of them work
> better with top-posting, and in none of them is top posting
> a problem. What software are you using?
>
> Steve.
>
I use gmail and I can assure you that top posting is annoying.
france
I have a number of news readers here, but all of them work
better with top-posting, and in none of them is top posting
a problem. What software are you using?
Steve.
"Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In message <[EMAIL PROTECTED]>, bambam wrot
bambam <[EMAIL PROTECTED]> wrote:
> > O(n) to find the element you wish to remove and move over
> > everything after it,
>
> Is that how lists are stored in cPython? It seems unlikely?
So-called "lists" in Python are stored contiguously in memory (more like
"vectors" in some other languages), so
In message <[EMAIL PROTECTED]>, bambam wrote:
> Thank you,
Don't top-post.
--
http://mail.python.org/mailman/listinfo/python-list
I can try that, but I'm not sure that it will work. The problem
is that devList is just a pointer to a list owned by someone else.
Making devList point to a new list won't work: I need to make
the parent list different. I could do this by adding an extra
level of indirection, but I think at the ris
I'm testing a series of scripts.
The scripts are testing a series of hardware devices.
The scripts are a sequence of device commands.
The scripts have sequence numbers.
I am adding exception handling to the to the 'inner
platform' that executes sequences.
I am doing this because testing of error
> Removing from a list while you iterate will had quadratic performance
Anecdote:
I was doing a route-finding program for a railway
ticketing system. My replacement explained to my boss
that it couldn't be done: the problem was one of that
class of problems that has no good optimum solution.
M
On Sep 6, 1:56 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:
> That said, it may be a good future language enhancement to define a
> reasonable consistent behavior for an iterator over a changing
> collection. This occurs quite common when we walk a collection and
> usually delete the current ite
On Sep 6, 7:44 am, "bambam" <[EMAIL PROTECTED]> wrote:
> First, thank you.
>
> All of the suggestions match what we want to do much better
> than what we are doing. We have a script, written in python,
> which is doing testing. But the python script doesn't look anything
> like the test script, bec
In message <[EMAIL PROTECTED]>, bambam wrote:
> The devices are in a list, and are removed by using pop(i). This
> messes up the loop iteration, so it is actually done by setting a
> flag on each device in the exception handler, with ANOTHER
> loop after each write/read/calculate sequence.
Why no
On Fri, 07 Sep 2007 12:03:26 +1000, bambam wrote:
> Hi Steven.
>
> Looking at your code, why are you naming the value __all__? It looks
> like a built-in variable?
When you say:
from module import *
Python looks in the module for a list of names called "__all__", and
imports only the names in
Hi Steven.
Looking at your code, why are you naming the value
__all__? It looks like a built-in variable?
Unless there is an automatic way to correctly get the
function list, I will probably be better off giving the lines
sequence numbers, and generating the function list from
that.
Steve.
"Ste
On Sep 5, 1:37 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> Karthik Gurusamy wrote:
> > On Sep 5, 11:17 am, James Stroud <[EMAIL PROTECTED]> wrote:
>
> >> for i in xrange(number_of_reads):
> >>for dev in devs:
> >> try:
> >>_reader = getattr(dev, 'read%d' % i)
> >>_reader(
On Thu, 06 Sep 2007 15:44:57 +1000, bambam wrote:
> First, thank you.
>
> All of the suggestions match what we want to do much better than what we
> are doing. We have a script, written in python, which is doing testing.
> But the python script doesn't look anything like the test script,
> becaus
On Thu, 06 Sep 2007 15:44:57 +1000, bambam wrote:
> def script(self)
> def a0010(): global self; self.power_on([self.dev]);
> def a0020(): global self; self.dev.addLog([self.name, ' started']);
> def a0030(): global self; self.resetMinuteReg([self.dev]);
> def a0040(): global self;
First, thank you.
All of the suggestions match what we want to do much better
than what we are doing. We have a script, written in python,
which is doing testing. But the python script doesn't look anything
like the test script, because the python script is written in python,
and the test script i
On 9/5/07, James Stroud <[EMAIL PROTECTED]> wrote:
>
>
> Another way is to make a copy of devs, if devs is short, which makes my
>
>
When I process something of that genre (e.g. files) I prefer not to lose
trace of what's happened by removing the "bad items". Instead I prefer to
flag or otherwise
Karthik Gurusamy wrote:
> On Sep 5, 11:17 am, James Stroud <[EMAIL PROTECTED]> wrote:
>>
>> for i in xrange(number_of_reads):
>>for dev in devs:
>> try:
>>_reader = getattr(dev, 'read%d' % i)
>>_reader()
>> except Exception, e:
>>print e
>>devs.remove(
On 9/5/07, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:
>
> On Sep 5, 11:17 am, James Stroud <[EMAIL PROTECTED]> wrote:
> > bambam wrote:
> > > I have about 30 pages (10 * 3 pages each) of code like this
> > > (following). Can anyone suggest a more compact way to
> > > code the exception handling? I
On Sep 5, 11:17 am, James Stroud <[EMAIL PROTECTED]> wrote:
> bambam wrote:
> > I have about 30 pages (10 * 3 pages each) of code like this
> > (following). Can anyone suggest a more compact way to
> > code the exception handling? If there is an exception, I need
> > to continue the loop, and conti
bambam wrote:
> I have about 30 pages (10 * 3 pages each) of code like this
> (following). Can anyone suggest a more compact way to
> code the exception handling? If there is an exception, I need
> to continue the loop, and continue the list.
>
> Steve.
>
> ---
> f
bambam a écrit :
> I have about 30 pages (10 * 3 pages each) of code like this
> (following). Can anyone suggest a more compact way to
> code the exception handling? If there is an exception, I need
> to continue the loop, and continue the list.
>
> Steve.
>
> ---
Sorry, just seen a mistake in my code, however Diez beat me to what I
was actually thinking!
Wes
On 05/09/07, Wesley Brooks <[EMAIL PROTECTED]> wrote:
> Try adding all the functions into a list such as;
>
> funcList = [dev.read1, dev.read2, dev.read3]
>
> for func in funcList:
>for dev in dev
On 9/5/07, bambam <[EMAIL PROTECTED]> wrote:
>
> I have about 30 pages (10 * 3 pages each) of code like this
> (following). Can anyone suggest a more compact way to
> code the exception handling? If there is an exception, I need
> to continue the loop, and continue the list.
>
> Steve.
>
>
def process_devs(devs, fun):
for dev in devs:
try:
fun(dev)
except:
print exception
remove dev from devs
return devs
process_devs(devs, lambda d: d.read1())
process_devs(devs, lambda d: d.read2())
...
On 9/5/07, bambam <[EMAIL PROTECT
Try adding all the functions into a list such as;
funcList = [dev.read1, dev.read2, dev.read3]
for func in funcList:
for dev in devs:
try:
func()
except:
print exception
remove dev from devs
Wes.
On 05/09/07, bambam <[EMAIL PROTECTED]> wrote:
>
bambam wrote:
> I have about 30 pages (10 * 3 pages each) of code like this
> (following). Can anyone suggest a more compact way to
> code the exception handling? If there is an exception, I need
> to continue the loop, and continue the list.
>
> Steve.
>
> ---
>
I have about 30 pages (10 * 3 pages each) of code like this
(following). Can anyone suggest a more compact way to
code the exception handling? If there is an exception, I need
to continue the loop, and continue the list.
Steve.
---
for dev in devs
try:
bambam a écrit :
> "Bruno Desthuilliers" <[EMAIL PROTECTED]>
> wrote in message news:[EMAIL PROTECTED]
>> As a side note, in Python, inheritance ...
>> ... should usually not be used for typing.
>
> :~(
> I'm sorry, I don't even know what that means... The code I
> have inherited from someone onl
On 2007-08-31, bambam <[EMAIL PROTECTED]> wrote:
> "Bruno Desthuilliers"
> <[EMAIL PROTECTED]> wrote in
> message news:[EMAIL PROTECTED]
>> As a side note, in Python, inheritance ... ... should usually
>> not be used for typing.
>
>:~(
> I'm sorry, I don't even know what that means... The code I ha
"Bruno Desthuilliers" <[EMAIL PROTECTED]>
wrote in message news:[EMAIL PROTECTED]
>
> As a side note, in Python, inheritance ...
> ... should usually not be used for typing.
:~(
I'm sorry, I don't even know what that means... The code I
have inherited from someone only a little more knowledgeabl
Thank you.
I'm glad to see that I don't need to choose between two
opposing viewpoints :~)
Steve.
--
http://mail.python.org/mailman/listinfo/python-list
Neil Cerutti <[EMAIL PROTECTED]> writes:
> i = 0
> while i < self.parent.GetPageCount():
> # do stuff
> i += 1
Alternatively:
from itertools import count
for i in count():
if i >= self.parent.GetPageCount():
break
...
--
http://mail.python.org/mailman/listinfo
On 2007-08-27, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> This sort of suggests a direct solution:
>
> for i in xrange(self.parent.GetPageCount()):
> if i >= self.parent.GetPageCount():
> break
> # do stuff
>
> At least that way you're spared the manual manipulation of i.
On second thought,
On 2007-08-27, bambam <[EMAIL PROTECTED]> wrote:
> Thank you, I have been through the tutorial several times, I
> guess I'm just not smart enough. Perhaps I have been led astray
> by what I read here?
>
> My code started like this:
>
> for i in range(self.parent.GetPageCount()):
>
> I was asked:
>
bambam a écrit :
> Thank you, I have been through the tutorial several times, I guess
> I'm just not smart enough. Perhaps I have been led astray by what
> I read here?
>
> My code started like this:
>
> for i in range(self.parent.GetPageCount()):
>
> I was asked:
>
>> Does page count change? i
bambam a écrit :
Steve, could you please stop top-posting ?-) TIA
> "Dan Bishop" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On Aug 23, 10:21 pm, "bambam" <[EMAIL PROTECTED]> wrote:
>>> Would someone like to suggest a replacement for this? This is a
>>> function that return
bambam wrote:
[but he top-posted]
> "Dan Bishop" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On Aug 23, 10:21 pm, "bambam" <[EMAIL PROTECTED]> wrote:
>>> Would someone like to suggest a replacement for this? This is a
>>> function that returns different kinds of similar object
Thank you. I figured the set would probably be faster,
but the lists are small, and I'm concerned that the code
is going to look Byzantine if I keep swapping between
lists, sets and dictionaries :~).
At the moment there are no sets or dictionaries in the
entire code base I am working with. I'm not
Thank you.
Steve.
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> bambam <[EMAIL PROTECTED]> wrote:
>
>> Is it safe to write
>>
>> A = [x for x in A if x in U]
>>
>> or is that undefined? I understand that the slice operation
>
> It's perfectly safe and well-defined
"bambam" <[EMAIL PROTECTED]> writes:
> Is it safe to write
> A = [x for x in A if x in U]
> or is that undefined? I understand that the slice operation
> can be used to make a temporary copy, so I could write
> A=[x for x in A[:] if x in U]
> but I've just copied that without any understanding.
Yo
bambam <[EMAIL PROTECTED]> wrote:
...
> Bags don't seem to be built in to my copy of Python, and
A "bag" is a collections.defaultdict(int) [[you do have to import
collections -- it's in the standard library, NOT built-in]].
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Thank you. I didn't reply earlier because I was trying to get my
head around what you wrote, which was strange and foreign
to me.
It seems to me that the dictionary object you suggested is a
direct replacement for the function code, only more efficient
because the case table is internalised with a
bambam <[EMAIL PROTECTED]> wrote:
> Is it safe to write
>
> A = [x for x in A if x in U]
>
> or is that undefined? I understand that the slice operation
It's perfectly safe and well-defined, as the assignment rebinds the LHS
name only AFTER the RHS list comprehension is done.
Alex
--
http://
Is it safe to write
A = [x for x in A if x in U]
or is that undefined? I understand that the slice operation
can be used to make a temporary copy, so I could write
A=[x for x in A[:] if x in U]
but I've just copied that without any understanding.
Steve.
"bambam" <[EMAIL PROTECTED]> wrote in
Thank you, I have been through the tutorial several times, I guess
I'm just not smart enough. Python is quite different from the
languages I am familiar with.
My code sample started like this:
>>for i in range(self.parent.GetPageCount()):
I was asked:
>Does page count change? i.e. is it necessa
901 - 1000 of 1308 matches
Mail list logo