Alan Gauld wrote:
> "Wayne Watson" <[EMAIL PROTECTED]> wrote
>
>> BTW, how does one continue a long statement
>> that has, say, a long path to a file?
>
> You can create a long string by adding the shorter string
> elements :
>
> f = open(
> "a:/very/long/path/name/that/needs/a/whole/line/to./it
Alan Gauld wrote:
"Emile van Sebille" <[EMAIL PROTECTED]> wrote
yet if i wrote range (1, 500, 2) [1, 3, 5, 7... ..499] is there
a command where i could total that list quickly?
You're looking for sum --
sum(range (1, 500, 2) )
Or on older Python versions reduce:
import operator
s =
"Wayne Watson" <[EMAIL PROTECTED]> wrote
junkfile = open('c:\tmp\junkpythonfile','w')
IOError: [Errno 2] No such file or directory:
'c:\tmp\\junkpythonfile'
I suspect the problem is with the back slash. Comments?
Correct. There are several ways round this, the simplest
being to use forw
"Emile van Sebille" <[EMAIL PROTECTED]> wrote
yet if i wrote range (1, 500, 2) [1, 3, 5, 7... ..499] is there
a command where i could total that list quickly?
You're looking for sum --
sum(range (1, 500, 2) )
Or on older Python versions reduce:
import operator
s = reduce(operator.ad
Graphviz (http://www.graphviz.org/) is great for this sort of thing, but it's
an external program. There is a Python interface, pydot
(http://dkbza.org/pydot.html)
Cheers
On Saturday 23 August 2008 15:34, Daniel Sarmiento wrote:
> Hi
>
> I am working on a red-black binary tree class. I would
Hi
I am working on a red-black binary tree class. I would like to print
it in a nice, graphical way. I have never done any GUI programming, or
generated any graphics in python, before.
What libraries would you use, what's the most straight forward way to
achieve what I want?
Thank you.
_
Tom Wakelam wrote:
yet if i wrote range (1, 500, 2) [1, 3, 5, 7... ..499] is there a
command where i could total that list quickly?
You're looking for sum --
sum(range (1, 500, 2) )
___
Tutor maillist - Tutor@python.org
http://mail.python.o
Kent Johnson wrote:
> The \ character is a special 'escape' character that is used to insert
> non-printing characters into a string. \t represents a single tab
> character, not the two characters \ and t.
>
> To put an actual backslash into a string, you can either double it:
> 'c:\\tmp\\junkpyth
Hi, hope i've got the email right, and you can help
If i have a list of integers, could i then total up the list?
e.g.
range (1, 5) gives [1, 2, 3, 4] which is easily totalled at 10,
yet if i wrote range (1, 500, 2) [1, 3, 5, 7... ..499] is there a command
where i could total that list q
On Sat, Aug 23, 2008 at 9:56 AM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
> Python doesn't like this:
>
> junkfile = open('c:\tmp\junkpythonfile','w')
>
> I get
> junkfile = open('c:\tmp\junkpythonfile','w')
> IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile'
The \ characte
On Sat, Aug 23, 2008 at 6:47 AM, Eric Abrahamsen
<[EMAIL PROTECTED]> wrote:
> At first I thought the bisect module was the way to go, but it is too
> tightly tied to integer list indices, and works very awkwardly when
> bisecting on datetime attributes.
I'm not sure what the problem is with bisect
On Fri, Aug 22, 2008 at 9:46 AM, Ricardo Aráoz <[EMAIL PROTECTED]> wrote:
> What I find lacking in the docs are a link to a code example for every item
> and a "See Also" link to other related items. With some modules I can't make
> sense of the different bits and pieces till I see a code example,
Title: Signature.html
Python doesn't like this:
junkfile = open('c:\tmp\junkpythonfile','w')
I get
junkfile = open('c:\tmp\junkpythonfile','w')
IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile'
This problematic segment is just a hack of a similar statement which
On Sat, 2008-08-23 at 12:00 +0200, [EMAIL PROTECTED] wrote:
>
> Message: 1
> Date: Fri, 22 Aug 2008 20:46:25 -0400
> From: "lawful falafel" <[EMAIL PROTECTED]>
> Subject: [Tutor] Problem with creating a class to access a 2d array
> To: tutor@python.org
> Message-ID:
> <[EMAIL PROTECTED]>
>
Thanks Bill.
That does work!
Thanks a lot! :)
Regards,
Olrik
2008/8/23 Bill Burns <[EMAIL PROTECTED]>
> Olrik Lenstra wrote:
>
>> It works! :)
>> My program is now as good as done, only one thing that bothers me a bit.
>> When I click the scan button the GUI Freezes because it is handling the
>>
Hi,
I've got a problem that takes a bit of explaining, but it's relatively
simple when you get down to it. This is another django-related thing,
but the issue itself is pure python.
I made a custom class, called an EventEngine, which represents a span
of time. You initialize it with a que
"lawful falafel" <[EMAIL PROTECTED]> wrote
I really like python, but the one thing I really hate is that most
of the
tutorials treat it like interactive scripting instead of object
oriented
development, which really confuses me.
Can you explain what confuses you about that?
The original Obj
> I am currently trying to teach myself python. This isnt my first language,
> as I used to be quite good at using java.
you are in good shape... you will only need to "tweak" some of your
notions with regards to Java for Python, and you will be in good
shape.
> I really like python, but the one
18 matches
Mail list logo