Delaney, Timothy (Tim) wrote:
[...]
>
> Generally, you should always go for whatever is clearest/most easily
> read (not just in Python, but in all languages).
+1 QOTW
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd www.holdenweb.com
Lo
Sebastjan Trepca wrote:
> I think you are trying to concatenate a unicode string with regular
> one so when it tries to convert the regular string to unicode with
> ASCII(default one) encoding it fails. First find out which of these
> strings is regular and how it was encoded, then you can decode i
KraftDiner wrote:
> I had a structure that looked like this
> ((0,1), (2, 3), (4, 5), (6,7)
>
> I changed my code slightly and now I do this:
> odd = (1,3,5,7)
> even = (0,2,4,6)
> all = zip(even, odd)
>
> however the zip produces:
> [(0, 1), (2, 3), (4, 5), (6, 7)]
>
> Which is a list of tuples
Paul Rubin wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>
>>>for x in range(minutes,0,-1):
>>>sleep(60.0)
>>>print minutes, 'minutes remaining'
>>>
>>
>>Nice! Cross off another line! I feel like Hemingway. :)
>
>
> Besides the bug mentioned, I don't think you should really do it th
Matthias Kluwe wrote:
> Hi!
>
> I'd like to place several StaticBoxes in a frame, but I can't get it
> right.
>
> Consider the following code:
>
> import wx
>
> app = wx.PySimpleApp()
> frame = wx.Frame(parent=None, title="Test")
> box = wx.BoxSizer(wx.VERTICAL)
> frame.SetSizer(box)
> upper_bo
Jay Parlar <[EMAIL PROTECTED]> wrote:
> class A(object):
> def foo(self):
> print "bar"
>
> class B(object):
> def foo(self):
> print "bar"
>
> def typedfunction(x : A):
> x.foo()
>
> b = B()
> typedfunction(b) #Your system would probably consider this an error
Torsten Bronger wrote:
> Hallöchen!
>
> Thomas Heller <[EMAIL PROTECTED]> writes:
>
>> Torsten Bronger wrote:
>>
>>> [...] However, is there a way to avoid this dummy "pp3" module
>>> and add the C++ functions directy to the main namespace in the
>>> Python script?
>> Yes. You can import __buil
Robert Kern <[EMAIL PROTECTED]> writes:
> sturlamolden wrote:
...
> > 5. Versioning control? For each program there is only one
> > developer and a single or a handful users.
...
> This is one thing that a lot of people seem to get wrong: version
> control is not a burden on software development. I
John Salerno <[EMAIL PROTECTED]> wrote:
> John Salerno wrote:
> > One of the things I learned with C# is that it's always better to handle
> > any errors that might occur within the codes itself (i.e. using if
> > statements, etc. to catch potential out of range indexing) rather than
> > use too
Greg Ewing <[EMAIL PROTECTED]> wrote:
> Alex Martelli wrote:
>
> > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa
> > ckages/GUI/Cocoa/Applications.py", line 184, in init_application_name
> > ns_info['CFBundleName'] = GApplications.application_name
> > TypeError: obj
John Salerno <[EMAIL PROTECTED]> wrote:
...
> I think the 'from time import sleep' looks cleaner, because I'm only
> taking what I need (is an import any more expensive than this from?),
> but I also feel like the 'time.sleep' syntax is much more
> self-describing and better to read than just
Grant Edwards <[EMAIL PROTECTED]> wrote:
...
> > Nice! Cross off another line! I feel like Hemingway. :)
>
> Was he the one who once apologized to his editor for a story
> being so long because he was in a hurry and didn't have time to
> make it shorter?
Nope, that immortal quote is by Blaise
On Mar 8, 2006, at 8:32 PM, Etienne Desautels wrote:
>
> Hi Philip,
>
>> Hi all,
>> Has anyone ever seen Python 2.4.1's httplib choke when reading chunked
>> content?
>
> Yes, it's a know bug. See for yourself:
> https://sourceforge.net/tracker/?
> func=detail&atid=305470&aid=900744&group_id=547
I have found that some editors colourize text based on parsing a
section of text around what is visible. Long, multi-line comments or
strings might not then get colored correctly.
Personally, I do use block comments in other languages but maybe they
should not exist in finished code for reasons al
Greg Lindstrom wrote:
> I'm running Python 2.4 on windows xp "professional" and seem to recall there
> is a way to kick off system command (or any external routine) and then
> collect the screen output back into the calling python routine for
> analysis. I've look and googled but have come up lac
John Salerno <[EMAIL PROTECTED]> writes:
> > for x in range(minutes,0,-1):
> > sleep(60.0)
> > print minutes, 'minutes remaining'
> >
> Nice! Cross off another line! I feel like Hemingway. :)
Besides the bug mentioned, I don't think you should really do it that
way, since sleep(60.0) migh
James Stroud wrote:
> John Salerno wrote:
>> Grant Edwards wrote:
>>
>>> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>>>
from time import sleep
minutes = input('Enter the number of minutes to wait: ')
for x in range(minutes):
sleep(1.0)
minutes
John Salerno wrote:
>> for x in range(minutes,0,-1):
>> sleep(60.0)
>> print minutes, 'minutes remaining'
>>
>
> I might be doing something wrong, but this just keeps printing out '10
> minutes remaining' each time.
should be:
for x in range(minutes,0,-1):
sleep(60.0)
print x,
John Salerno wrote:
> Grant Edwards wrote:
>
>> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>>
>>> from time import sleep
>>>
>>> minutes = input('Enter the number of minutes to wait: ')
>>>
>>> for x in range(minutes):
>>> sleep(1.0)
>>> minutes -= 1
>>> print minutes, 'min
Ben Cartwright wrote:
> BartlebyScrivener wrote:
>> What about a console beep? How do you add that?
>>
>> rpd
>
> Just use ASCII code 007 (BEL/BEEP):
>
> >>> import sys
> >>> sys.stdout.write('\007')
>
> Or if you're on Windows, use the winsound standard module.
>
> --Ben
>
I'd prefer to
import pygame
def main():
SIZE = (300, 200)
WHITE = (255, 255, 255)
pygame.init()
# Create a new grayscale surface
pic = pygame.Surface(SIZE, 0, 8)
palette = tuple([(i, i, i) for i in range(256)])
pic.set_palette(palette)
# Fill it with a gradient
array = pyga
"Brian L. Troutwine" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've recently begun to teach myself pygame by making a bunch of small
> toys. My current toy is cellular automata displayer and I've gotten a
> bit stuck on the displaying bit. (If automata isn't the plural of
> au
Grant Edwards wrote:
> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>
>> from time import sleep
>>
>> minutes = input('Enter the number of minutes to wait: ')
>>
>> for x in range(minutes):
>> sleep(1.0)
>> minutes -= 1
>> print minutes, 'minutes remaining.'
>
> for x in
> John Salerno wrote:
>> Given:
> > numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> > can someone explain to me why
> > numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
It appears that s[i:j:-1] is s[(j+1):(i+1)] .reverse()'ed. For 'numbers',
this is 10, 9, 8, 7, 6, 5, 4, 3, 2]. Then take every other i
Grant Edwards wrote:
> Was he the one who once apologized to his editor for a story
> being so long because he was in a hurry and didn't have time to
> make it shorter?
Hmm, not sure. He doesn't seem like the type to apologize, or even have
long stories. :) He was ruthless with his edits, that'
On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
>> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>>
>>> from time import sleep
>>>
>>> minutes = input('Enter the number of minutes to wait: ')
>>>
>>> for x in range(minutes):
>>> sleep(1.0)
>>> minutes
BartlebyScrivener wrote:
> What about a console beep? How do you add that?
>
> rpd
Just use ASCII code 007 (BEL/BEEP):
>>> import sys
>>> sys.stdout.write('\007')
Or if you're on Windows, use the winsound standard module.
--Ben
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> from time import sleep
...
> sleep(1.0)
Very picky point, but I'd like to know what others think of this. Should
I import as above, or should I do this:
import time
time.sleep(60.0) ???
I think the 'from time import sleep' looks cleaner, because I'm only
tak
Grant Edwards wrote:
> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>
>> from time import sleep
>>
>> minutes = input('Enter the number of minutes to wait: ')
>>
>> for x in range(minutes):
>> sleep(1.0)
>> minutes -= 1
>> print minutes, 'minutes remaining.'
>
> for x in
BartlebyScrivener wrote:
> What about a console beep? How do you add that?
>
> rpd
>
Ooh, good point! I forgot about the most important part, otherwise I'd
never know it was done and someone would steal my clothes! :)
Time to do some library reference research
--
http://mail.python.org/m
James Stroud wrote:
> Very nice, but maybe
>
> ...
>sleep(60.0)
>
> This corrects for the number of seconds in a minute.
>
> James
>
Thanks! And yeah, I fixed that little issue. If only laundry could be
done that fast. :)
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
> from time import sleep
>
> minutes = input('Enter the number of minutes to wait: ')
>
> for x in range(minutes):
> sleep(1.0)
> minutes -= 1
> print minutes, 'minutes remaining.'
for x in range(minutes,0,-1):
sleep(60.
David Pratt wrote:
> Hi Ben. I hadn't realize that walk was just giving the file name so the
> join did the job just great.
I don't think that deleting the .DS_Store files is the
right approach to this, for various reasons:
* You're messing with MacOSX's metadata, which is
not a nice thing t
What about a console beep? How do you add that?
rpd
--
http://mail.python.org/mailman/listinfo/python-list
I just noticed, if you don't define maxsize in _init(), you need to
override _full() as well:
def _full(self):
return False
cheers,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> My first project when I started learning C# was to make a little timer
> to tell me when my laundry was done :) and I thought it would be fun to
> convert this to Python. Here's what I came up with after much struggling
> with the Timer class from the threading module -- as
John Salerno wrote:
> sleep(1.0)
Heh heh, that was for testing. Obviously it should read 60.0 (is a float
necessary at all?).
--
http://mail.python.org/mailman/listinfo/python-list
My first project when I started learning C# was to make a little timer
to tell me when my laundry was done :) and I thought it would be fun to
convert this to Python. Here's what I came up with after much struggling
with the Timer class from the threading module -- as you can see, I
abandoned i
André wrote:
> An extended slice of list x of length n in the form x[j:k:i] selects
> every i-th element starting with and including the element at index j
This makes it sound like the index of 10 should be inclusive.
> When either index is missing or lies outside of the
> list bounds, the mini
Alex Martelli wrote:
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa
> ckages/GUI/Cocoa/Applications.py", line 184, in init_application_name
> ns_info['CFBundleName'] = GApplications.application_name
> TypeError: object does not support item assignment
You need to r
Peter Maas wrote:
> This is hard to understand for an outsider. If you pass an int, a float,
> a string or any other "atomic" object to a function you have "pass by
> value" semantics. If you put a compound object like a list or a dictionary
> or any other object that acts as an editable data cont
Andy Salnikov wrote:
> Actually os.system() is rather poor replacement for the shell's
> capabilities, and it's _very_ low level, it's really a C-level code
> wrapped in Python syntax.
Since os.system() spawns a shell to execute the command,
it's theoretically capable of anything that the shell
c
cesco wrote:
> I have a binary file containing 1000 floating point numbers. I want to
> load that file into an array. A way to do it could be the following:
>
import array
data = array.array('f')
f = open('FileName.bin', 'rb')
data.fromfile(f, 1000)
>
> Now I have the following pr
Andy Salnikov wrote:
> I saw lots of awk or sed "code" embedded in scripts
In my experience, embedding any of make/sh/awk/sed in
any of the others is a nightmare of singlequote/
doublequote/backslash juggling that makes a few
tab/space problems in Python pale by comparison.
--
Greg Ewing, Comput
Dennis Lee Bieber wrote:
> On Wed, 08 Mar 2006 06:20:42 +, Steve Holden <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>>Hang around here long and you'll see a bunch of people waiting on
>>replies to questions Google could have given them far quicker. If we
>>weren't pa
Hello-
I'm running Python 2.4 on windows xp "professional" and seem to recall
there is a way to kick off system command (or any external routine) and
then collect the screen output back into the calling python routine for
analysis. I've look and googled but have come up lacking.
Please tell me t
I've recently begun to teach myself pygame by making a bunch of small
toys. My current toy is cellular automata displayer and I've gotten a
bit stuck on the displaying bit. (If automata isn't the plural of
automaton please forgive me.) The current automata are only binary and
are calculated using 2
Steven D'Aprano wrote:
> John Salerno wrote:
>
> > Given:
> >
> > numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> >
> > can someone explain to me why
> >
> > numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
>
> I think the documentation is misleading/incomplete when
> it comes to negative strides for ext
John Salerno wrote:
> James Stroud wrote:
>
>> John Salerno wrote:
>>
>>> Given:
>>>
>>> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>>
>>> can someone explain to me why
>>>
>>> numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
>>>
>>> I thought the first index, whether going forward or backward, was
John Salerno wrote:
> Given:
>
> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>
> can someone explain to me why
>
> numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
I think the documentation is misleading/incomplete when
it comes to negative strides for extended slices.
The relevent sections are h
Hi Philip,
> Hi all,
> Has anyone ever seen Python 2.4.1's httplib choke when reading chunked
> content?
Yes, it's a know bug. See for yourself:
https://sourceforge.net/tracker/?
func=detail&atid=305470&aid=900744&group_id=5470
Etienne
> I'm using it via urrlib2, and I ran into a particular s
John Salerno wrote:
> One of the things I learned with C# is that it's always better to handle
> any errors that might occur within the codes itself (i.e. using if
> statements, etc. to catch potential out of range indexing) rather than
> use too many try/catch statements, because there is some
James Stroud wrote:
> John Salerno wrote:
>> Given:
>>
>> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>
>> can someone explain to me why
>>
>> numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
>>
>> I thought the first index, whether going forward or backward, was
>> inclusive. And there is no index of
John Salerno wrote:
> Given:
>
> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>
> can someone explain to me why
>
> numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
I always have trouble with these. Given the docs[1]:
"""
The slice of s from i to j with step k is defined as the sequence of
items w
John Salerno wrote:
> Given:
>
> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>
> can someone explain to me why
>
> numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
>
> I thought the first index, whether going forward or backward, was
> inclusive. And there is no index of 10 in this list, so what is
Steven D'Aprano wrote:
> The classic example of the "look before you leap" and
> "just do it" idioms involves looking up a key in a
> dictionary:
>
> # method one
> if some_dict.has_key(key):
> do_something_with(some_dict[key])
> else:
> do_something_else()
FWIW, in recent Python versi
On Wednesday 08 March 2006 12:42 pm, Warby wrote:
> The danger with block comments is that there is no way to tell that the
> code you're looking at has been commented out unless you can see the
> start or end of the comment block. If you have a modern editor, it
> probably changes the color of al
[EMAIL PROTECTED] writes:
> I have been a software developer for the past 10 years now. I get job
> descriptions that requires problem-solving skills as one of the most
> desirable skills in a candidate. But there are not many resources that
> is devoted to this topic.
>
> So, I have created a web
Hello,
I have been a software developer for the past 10 years now. I get job
descriptions that requires problem-solving skills as one of the most
desirable skills in a candidate. But there are not many resources that
is devoted to this topic.
So, I have created a website for problem solving skill
On Wednesday 08 March 2006 09:35 am, Byte wrote:
> I know its possible to acsess Python via the command line, but can I do
> the opposite and acsess the command line via Python? For example, can I
> write a script that will enter
>
> $ firefox
>
> on the command line, opening Firefox for me?
You
John Salerno wrote:
> One of the things I learned with C# is that it's always better to handle
> any errors that might occur within the codes itself (i.e. using if
> statements, etc. to catch potential out of range indexing) rather than
> use too many try/catch statements, because there is some
In article <[EMAIL PROTECTED]>,
John Salerno <[EMAIL PROTECTED]> wrote:
> One of the things I learned with C# is that it's always better to handle
> any errors that might occur within the codes itself (i.e. using if
> statements, etc. to catch potential out of range indexing) rather than
> use
John Salerno wrote:
> One of the things I learned with C# is that it's always better to handle
> any errors that might occur within the codes itself (i.e. using if
> statements, etc. to catch potential out of range indexing) rather than
> use too many try/catch statements, because there is some
One of the things I learned with C# is that it's always better to handle
any errors that might occur within the codes itself (i.e. using if
statements, etc. to catch potential out of range indexing) rather than
use too many try/catch statements, because there is some overhead every
time the pro
Given:
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
can someone explain to me why
numbers[10:0:-2] results in [10, 8, 6, 4, 2]?
I thought the first index, whether going forward or backward, was
inclusive. And there is no index of 10 in this list, so what is it
referring to?
Thanks.
--
http://m
KraftDiner wrote:
> I had a structure that looked like this
> ((0,1), (2, 3), (4, 5), (6,7)
>
> I changed my code slightly and now I do this:
> odd = (1,3,5,7)
> even = (0,2,4,6)
> all = zip(even, odd)
>
> however the zip produces:
> [(0, 1), (2, 3), (4, 5), (6, 7)]
>
> Which is a list of tuple
Steve Holden wrote:
> Alexander wrote:
>
>> hi, my name is alexander. i'm from indonesia
>> i wanna ask, is there Pygoogle with GUI? because i've got assignment
>> from my teacher to make an user interface for Pygoogle. if there's a
>> Pygoogle with GUI, can u tell me where to find it.
>>
> So "m
Fredrik Tolf wrote:
> On Mon, 2006-03-06 at 20:25 -0800, James Stroud wrote:
>
>>Fredrik Tolf wrote:
>>
>>>If I have a variable which points to a function, can I check if certain
>>>argument list matches what the function wants before or when calling it?
>>>
>>>Currently, I'm trying to catch a Typ
Hi all,
Has anyone ever seen Python 2.4.1's httplib choke when reading chunked
content? I'm using it via urrlib2, and I ran into a particular server
that returns something that httplib doesn't expect. Specifically, in
the code below where the error occurs, line == ''.
Python 2.4.1 (#2, Oct 12 2005
Max M wrote:
> decorated = [(obj.x, obj) for obj in objects]
> max_decorated = max(decorated)
> max_obj = max_decorated[-1]
Python 2.5 will make this even easier - max() and min() aquire a `key`
keyword parameter much like list.sort()/sorted().
max_obj = max(objects, key=operator.attrgetter(
Install active python from
http://activestate.com/Products/ActivePython/?mp=1
Run PythonWin for: coding, interactive commands, and debugging.
Good luck.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Tolf wrote:
> On Mon, 2006-03-06 at 20:25 -0800, James Stroud wrote:
>
>>Fredrik Tolf wrote:
>>
>>>If I have a variable which points to a function, can I check if certain
>>>argument list matches what the function wants before or when calling it?
>>>
>>>Currently, I'm trying to catch a Typ
"Michael Tobis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I think I agree with Steve here.
>
> I suspect you should either have sufficiently trained your users in
> Python, or have limited them to one-line statements which you could
> then strip of leading whitespace before pas
Hallöchen!
Thomas Heller <[EMAIL PROTECTED]> writes:
> Torsten Bronger wrote:
>
>> [...] However, is there a way to avoid this dummy "pp3" module
>> and add the C++ functions directy to the main namespace in the
>> Python script?
>
> Yes. You can import __builtin__, and add methods to it. This
cesco schrieb:
> Hi,
>
> I have a binary file containing 1000 floating point numbers. I want to
> load that file into an array. A way to do it could be the following:
>
import array
data = array.array('f')
f = open('FileName.bin', 'rb')
data.fromfile(f, 1000)
>
> Now I have t
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Andy Salnikov wrote:
>> "Michael Tobis" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>
>>>
>>>When you say "all kinds" of inlined code, do you have any other
>>>examples besides HTML?
>>>
>>
>> Make
Jarek Zgoda wrote:
> Michael Ekstrand napisa³(a):
>
> > Glade + PyGTK + libglade does the trick. libglade (exposed as gtk.glade
> > in Python) allows you to load Glade interface files (the raw XML Glade
> > saves your interfaces as) and then connect to various signals, access
> > the widgets, etc.
Hi,
I have a binary file containing 1000 floating point numbers. I want to
load that file into an array. A way to do it could be the following:
>>> import array
>>> data = array.array('f')
>>> f = open('FileName.bin', 'rb')
>>> data.fromfile(f, 1000)
Now I have the following problem: if I don't
Michael Tobis wrote:
> > No one
> > of the complainers and negativists do claim that they could do it much
> > better.
>
> Indeed, I do not have to be able to write a particular program to
> notice it has bugs.
>
> On the other hand, (since I think the design, while not brilliant, is
> good) fixin
In <[EMAIL PROTECTED]>, Blackbird wrote:
> By "cargo cult programming", do you mean actually *running* the code?
http://www.catb.org/~esr/jargon/html/C/cargo-cult-programming.html
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
Douglas Alan wrote:
> Experienced Lisp programmers use indentation to visually parse the
> program structure, just like Python programmers do for Python.
> Experienced Lisp programmers learn to not see the parentheses when
> they don't need to.
True, and this is IMHO an advantage of lisp to pytho
In article <[EMAIL PROTECTED]>,
"J Rice" <[EMAIL PROTECTED]> wrote:
> Hi Donn,
> Not sure I fully understand your suggestion. bind() only works once --
> I can't bind again in the client. Same thing with connect() -- once I
> issue a connect in the server, it rejects it in the client.
>
> Doin
"Carl Banks" <[EMAIL PROTECTED]> writes:
> Douglas Alan wrote:
>
>> For instance, if Python were to have been designed so that you would
>> write:
>>
>>let myVeryLongVariableName = 3
>>
>> I would have preferred this over
>>
>>myVeryLongVariableName = 3
>>
>> With the latter, I have to sca
Thomas Guettler <[EMAIL PROTECTED]> writes:
> > back to the originating url, i.e. I want the cgi to send a 302 redirect.
>
> I have this setup for a small script (for bigger things I use quixote)...
Thanks. It looks like you've written your cgi completely from
scratch. I was hoping to use the cg
I see no problem with finding existing code on the Internet and used to
learn a subject, so long as it isn't just stolen and handed in as is.
I guess I still believe people are good, no matter how hard Usenet and
IRC tries to convince me otherwise.
--
http://mail.python.org/mailman/listinfo/pyth
John Salerno wrote:
> I'm interested in trying out shells other than IDLE, and I found
> PyShell, but I'm not sure how to get it exactly. Is there a way to get
> it without installing wxPython, or is it a part of it? I can't find much
> reference to it in any of the manuals at wxpython.org (except
[EMAIL PROTECTED] wrote:
> I am a python newbie. I have writen some 500 lines of code. There are 4
> classes and in all 5 files.
>
> Now, I am trying to run the program. I am getting wrong values for the
> simulation results.
> Is there any debugging facilities in python which would let me go step
On 8 Mar 2006 13:23:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I am a python newbie. I have writen some 500 lines of code. There are 4classes and in all 5 files.
Now, I am trying to run the program. I am getting wrong values for thesimulation results.Is there any debugging facilities in
I am a python newbie. I have writen some 500 lines of code. There are 4
classes and in all 5 files.
Now, I am trying to run the program. I am getting wrong values for the
simulation results.
Is there any debugging facilities in python which would let me go step
by step and check the values of the
"gene tani" <[EMAIL PROTECTED]> writes:
> Rich wrote:
> > Hi,
> >
> > (this is a probably a bit OT here, but comp.lang seems rather
> > desolated, so I'm not sure I would get an answer there. And right now
> > I'm in the middle of learning Python anyway so...)
> >
> > Anyway, my question is: what
John wrote:
> Can anyone help me in coding a script that can send a text message
> typed to
> the script like.
>
> sendmessage 6318019564 "test message"
>
> What I want to do is fill up this information on this webpage
>
> http://www.cingularme.com/do/public/send;jsessionid=aKDwXM1S0Reh
>
> and
Michael Ekstrand napisał(a):
> Glade + PyGTK + libglade does the trick. libglade (exposed as gtk.glade
> in Python) allows you to load Glade interface files (the raw XML Glade
> saves your interfaces as) and then connect to various signals, access
> the widgets, etc.
>
> About as fast as anything
Fredrik Tolf wrote:
> # ...
> if callable(f):
> try:
> f(*cv[1:])
> except TypeError:
> self.reply("err", "argno")
> # ...
>
> However, this results in bugs in the server code that would cause
> TypeError to reply to the client that it had the wrong number of args,
> and I
KraftDiner schrieb:
> I had a structure that looked like this
> ((0,1), (2, 3), (4, 5), (6,7)
>
> I changed my code slightly and now I do this:
> odd = (1,3,5,7)
> even = (0,2,4,6)
> all = zip(even, odd)
>
> however the zip produces:
> [(0, 1), (2, 3), (4, 5), (6, 7)]
>
> Which is a list of tupl
Just do:
tuple(zip(even,odd))
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
KraftDiner
Sent: Wednesday, March 08, 2006 3:22 PM
To: python-list@python.org
Subject: a question about zip...
I had a structure that looked like this
((0,1), (2, 3), (4, 5), (
Douglas Alan wrote:
> For instance, if Python were to have been designed so that you would
> write:
>
>let myVeryLongVariableName = 3
>
> I would have preferred this over
>
>myVeryLongVariableName = 3
>
> With the latter, I have to scan down the line to see that this line is
> in an assign
KraftDiner wrote:
> I had a structure that looked like this
> ((0,1), (2, 3), (4, 5), (6,7)
>
> I changed my code slightly and now I do this:
> odd = (1,3,5,7)
> even = (0,2,4,6)
> all = zip(even, odd)
>
> however the zip produces:
> [(0, 1), (2, 3), (4, 5), (6, 7)]
>
> Which is a list of tuples
Brian Elmegaard wrote:
> "Matt Hammond" <[EMAIL PROTECTED]> writes:
>
>
>>y_max = max([e.x for e in y])
>
>
> Would there be a way to refer back to the e with maximum x, or how
> could I find other attributes of it?
>
You should look into __cmp__ and other magic methods. This is probably
the
Mudcat wrote:
> Hi,
>
> I have looked through the previous suggestions on graphing modules and
> have been able to find some good suggestions. However I was wondering
> about something more specific. I am going to write a program that
> tracks stock prices and other financial related charts, so I
KraftDiner wrote:
> I have a 2D array. Say it is 10x10 and I want a 1D Array of 100
> elements...
> What is the syntax?
>
> oneD = reshape(twoD, (100,1))
> or
> oneD = reshape(twoD, (1,100))
>
> One I guess is the transpose of the other but both seem to be
> arrays of arrays...
>
> help?!
>
Us
1 - 100 of 242 matches
Mail list logo