Mark Summerfield schrieb:
> On 14 Sep, 21:23, James Stroud <[EMAIL PROTECTED]> wrote:
>> Mark Summerfield wrote:
>>> I guess I'll have to rename my module (although unfortunately, my book
>>> has just gone into production and I have a (simpler) example of what I
>>> considered to be an ordered dict
Python in a nutshell also comes in a second edition:
http://www.oreilly.com/catalog/pythonian2/index.html. Here, many of
the new features in Python 2.5 are included. I haven't read through
the first the edition, but I can honestly say that reading through the
second edition has made me a better pro
Goodtolove.com is sharing their 50% adsense revenue with you to post
videos of anything.
Just keep up logging in and start posting now to make money...
--
http://mail.python.org/mailman/listinfo/python-list
I used python extensive 3-5 years back. Coming back I find some
changes. Trying to understand whats new and would appreciate any
help/comments/pointers.
Earlier there were basically two options:
SWIG: convenient but inefficient
Native (Extending/Embedding): an efficient way of getting a headache
Hi,
is there something corresponding to the java String.trim() method, ie
trim start and trailing space/tab chars from string?
say convert " asdf " to "asdf"?
Thnx
--
http://mail.python.org/mailman/listinfo/python-list
On 15/09/2007, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote:
> Hi,
> is there something corresponding to the java String.trim() method, ie
> trim start and trailing space/tab chars from string?
> say convert " asdf " to "asdf"?
>>> ' asdf '.strip()
'asdf'
>>> ' asdf '.rstrip()
' asdf'
>>>
Steven D'Aprano wrote:
> On Fri, 14 Sep 2007 18:19:45 -0700, James Stroud wrote:
>
>>> How do I subclass int and/or long so that my class also auto-converts
>>> only when needed?
>>>
>> Use __new__.
>
> The disadvantage of that is that your example code requires me to
> duplicate my methods in t
Rustom Mody schrieb:
> I used python extensive 3-5 years back. Coming back I find some
> changes. Trying to understand whats new and would appreciate any
> help/comments/pointers.
>
> Earlier there were basically two options:
> SWIG: convenient but inefficient
> Native (Extending/Embedding): an
On Sep 15, 7:24 pm, Konstantinos Pachopoulos <[EMAIL PROTECTED]>
wrote:
> Hi,
> is there something corresponding to the java String.trim() method, ie
> trim start and trailing space/tab chars from string?
> say convert " asdf " to "asdf"?
http://docs.python.org/lib/string-methods.html
--
htt
>>> s=" abcdef "
>>> s.strip()
'abcdef'
>>> s.rstrip()
' abcdef'
>>> s.lstrip()
'abcdef '
>>>
On 9/15/07, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote:
> Hi,
> is there something corresponding to the java String.trim() method, ie
> trim start and trailing space/tab chars fro
On 15/09/2007 1:50 PM, Gabriel Genellina wrote:
> En Fri, 14 Sep 2007 18:56:34 -0300, <[EMAIL PROTECTED]> escribi�:
>
>> I have installed python 2.5 for windows in my pc, I have a file xls
>> say "file.xls" in c:/python25. How I can read this files from Python.
>> Many thanks in advance.
>
> Tr
Used copies of computer books for out of date editions are always
cheap. "Python in a Nutshell (2nd ed)" is a reference book with a
frustratingly poor index--go figure. It also contains errors not
posted in the errata.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 15, 4:36 pm, Paddy <[EMAIL PROTECTED]> wrote:
> On Sep 15, 2:57 am, James Stroud <[EMAIL PROTECTED]> wrote:
>
>
>
> > Paddy wrote:
> > > Lets say i have a generator running that generates successive
> > > characters of a 'string'
> > >>From what I know, if I want to do a regexp search for a
Hi,
I am looking for the best way to convert a string of length 1 (= 1
character as string) to integer that has the same value as numeric
representation of that character. Background: I am writing functions
abstracting endianness, e.g. converting a string of length 4 to the
appropriate integer val
J. Cliff Dyer wrote:
> Bryan Olson wrote:
>> Scott David Daniels wrote:
>>
>>> C, which was designed as a "high level assembly language," does not
>>> tightly define the results of / and % for negative numbers. Instead
>>> it defines the result for positive over positive, and constrains the
>>>
On Sat, 15 Sep 2007 11:55:28 +, Boris Dušek wrote:
> I am looking for the best way to convert a string of length 1 (= 1
> character as string) to integer that has the same value as numeric
> representation of that character. Background: I am writing functions
> abstracting endianness, e.g. con
* Johny (Fri, 14 Sep 2007 12:51:22 -0700)
> Is there any good sniffer for https protocol?
What's the connection to Python?
> How can be watched https conversation?
ssldump. Note that in order to decrypt the traffic you need to have
the server's private key.
--
http://mail.python.org/mailman/li
On Sep 15, 1:59 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> So you are looking for the `struct` module in the standard library instead
> of doing this yourself. :-)
>
> If you insist on doing it yourself take a look at the built-in `ord()`
> function.
>
Thanks Marc,
both things are
i think in Ruby, if you have an array (or list) of integers
foo = [1, 2, 3]
you can use foo.join(",") to join them into a string "1,2,3"
in Python... is the method to use ",".join() ? but then it must take
a list of strings... not integers...
any fast method?
--
http://mail.python.org/mailm
On Sep 15, 9:55 pm, Boris Dušek <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am looking for the best way to convert a string of length 1 (= 1
> character as string) to integer that has the same value as numeric
> representation of that character. Background: I am writing functions
> abstracting endiannes
On Sat, 15 Sep 2007 12:36:02 +, Summercool wrote:
> i think in Ruby, if you have an array (or list) of integers
>
> foo = [1, 2, 3]
>
> you can use foo.join(",") to join them into a string "1,2,3"
>
> in Python... is the method to use ",".join() ? but then it must take
> a list of strings
Hi,
this snippet, adapted from
http://svn.effbot.org/public/tags/celementtree-1.0-20050126/selftest.py
fails miserably with an unknown entity exception:
from xml.etree.cElementTree import *
ENTITY_XML = """
&entity;
"""
parser = XMLTreeBuilder()
parser.entity["entity"] = "text"
print parser.e
print ''.join([str(i) for i in [1,2,3]])
On 9/15/07, Summercool <[EMAIL PROTECTED]> wrote:
> i think in Ruby, if you have an array (or list) of integers
>
> foo = [1, 2, 3]
>
> you can use foo.join(",") to join them into a string "1,2,3"
>
> in Python... is the method to use ",".join() ? but the
On Sep 15, 10:36 pm, Summercool <[EMAIL PROTECTED]> wrote:
> i think in Ruby, if you have an array (or list) of integers
>
> foo = [1, 2, 3]
>
> you can use foo.join(",") to join them into a string "1,2,3"
>
> in Python... is the method to use ",".join() ? but then it must take
> a list of string
On Sep 14, 9:49 pm, Paddy <[EMAIL PROTECTED]> wrote:
> Lets say i have a generator running that generates successive
> characters of a 'string'>From what I know, if I want to do a regexp search
> for a pattern of
>
> characters then I would have to 'freeze' the generator and pass the
> characters
On Sep 15, 10:56 pm, Paddy <[EMAIL PROTECTED]> wrote:
> On Sep 14, 9:49 pm, Paddy <[EMAIL PROTECTED]> wrote:
>
> > Lets say i have a generator running that generates successive
> > characters of a 'string'>From what I know, if I want to do a regexp search
> > for a pattern of
>
> > characters then
In article <[EMAIL PROTECTED]>,
gamename <[EMAIL PROTECTED]> wrote:
>On Sep 13, 1:42 am, [EMAIL PROTECTED] wrote:
>> On Sep 12, 9:27 pm, gamename <[EMAIL PROTECTED]> wrote:
>>
>> > Hi,
>>
>> > Is it still the case there is no practical Expect-like module for
>> > win32? I know that cygwin can supp
Le Fri, 14 Sep 2007 12:52:52 -0700, James Stroud a écrit:
[...]
> Other than that your strip() is stripping off some whitespace that is
> part of the name, I really can't see the problem either, but did you try
> to add in the explicit path? E.g.:
actually, the problem was in "while i <= len(li
I V wrote:
> On Thu, 13 Sep 2007 23:49:32 -0400, Amer Neely wrote:
>> In trying to track down why this script would not run on my host, it has
>> to come to light that Python is installed, however the Apache module is
>> not. So, short story is - I was flogging a dead horse.
>
> Which Apache modul
Bryan Olson wrote:
> Amer Neely wrote:
>> This seems to indicate that maybe my host needs to configure Apache to
>> run python scripts? But I didn't need to do anything with mine.
>
> Another possibility: If it works on Windows but not Unix, check
> the end-of-line characters. Windows ends each l
Can anyone provide an example how to find out the return code and
header from an urllib2 request?
For example
response = urllib2.urlopen('http://www.google.com').read().strip()
provides data
but I do not know if the return code was 200 or different.
Thanks
--
http://mail.python.org/mailman/lis
js escribió:
>> On 9/15/07, Summercool <[EMAIL PROTECTED]> wrote:
>> in Python... is the method to use ",".join() ? but then it must take
>> a list of strings... not integers...
>>
>> any fast method?
> print ''.join([str(i) for i in [1,2,3]])
It's better to use generator comprehension inste
Hi
First of all I am a beginner with python and I am a bit fooling around
to check wich possibilities I have. I'm trying to get some data to an
internal developped application.
Server: DDE
Topic: SCSDDeServer
Item: SendCustomerData
Item data: value, value, value
I got the following code
import
On Sep 13, 3:37 am, [EMAIL PROTECTED] wrote:
> We are offering $2000 USD for the best website developed withwww.hatspin.com
>
> Are you up to it??
Hey, thanks for spamming our group. Perhaps you should try again after
you learn proper HTML coding.
Results from http://validator.w3.org/ : Failed val
Bryan Olson wrote:
> Amer Neely wrote:
>> This seems to indicate that maybe my host needs to configure Apache to
>> run python scripts? But I didn't need to do anything with mine.
>
> Another possibility: If it works on Windows but not Unix, check
> the end-of-line characters. Windows ends each l
Diez B. Roggisch wrote:
> Any suggestions on how to teach the built-in ET-parser entities?
As you already do it in your code.
http://effbot.org/elementtree/elementtree-xmlparser.htm#tag-ET.XMLParser.entity
But I guess your version of cET is just too old.
Stefan
--
http://mail.python.org/mailma
> Hey, thanks for spamming our group. Perhaps you should try again after
> you learn proper HTML coding.
> Results from http://validator.w3.org/ : Failed validation, 26 Errors
>
> Really, really doubt that you are doing anything but trying to gather
> e-mails. My 12 year old has made better sites.
Hi to all,
thanks for your help. The approach
print '\r\n'.join([x.strip() for x in
open('c:/flutest.txt') if 'e-0' in x])
works quite well :-)
Greetings!
Fabian
Fabian Braennstroem schrieb am 09/13/2007 09:09 PM:
> Hi,
>
> I would like to delete a region on a log file which has this
>
Stefan Behnel schrieb:
> Diez B. Roggisch wrote:
>> Any suggestions on how to teach the built-in ET-parser entities?
>
> As you already do it in your code.
>
> http://effbot.org/elementtree/elementtree-xmlparser.htm#tag-ET.XMLParser.entity
>
> But I guess your version of cET is just too old.
Un
How about using httplib?
http://docs.python.org/lib/httplib-examples.html
HTTPResponse has getheaders() method, too.
On 9/15/07, Johny <[EMAIL PROTECTED]> wrote:
> Can anyone provide an example how to find out the return code and
> header from an urllib2 request?
> For example
> response = url
Stefan Behnel wrote:
> Diez B. Roggisch wrote:
>> Any suggestions on how to teach the built-in ET-parser entities?
>
> As you already do it in your code.
>
> http://effbot.org/elementtree/elementtree-xmlparser.htm#tag-ET.XMLParser.entity
Hmmm, I never needed this, but the test doesn't work for m
On 9/15/07, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Fri, 14 Sep 2007 22:59:13 -0300, Eduardo O. Padoan wrote:
>
> > On 14 Sep 2007 18:08:00 -0700, Paul Rubin
> > <"http://phr.cx"@nospam.invalid> wrote:
> >> "Eduardo O. Padoan" <[EMAIL PROTECTED]> writes:
> >> > Not totally unrelated, but in Py3k
On Sep 13, 5:50 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> Rodney Maxwell wrote:
> > The following are apparently legal Python syntactically:
> >L[1:3, 8:10]
> >L[1, ..., 5:-2]
>
> > But they don't seem to work on lists:
> l = [0,1,2,3]
> l[0:2,3]
> > Traceback (most recent cal
On Sep 13, 5:50 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> Rodney Maxwell wrote:
> > The following are apparently legal Python syntactically:
> >L[1:3, 8:10]
> >L[1, ..., 5:-2]
>
> > But they don't seem to work on lists:
> l = [0,1,2,3]
> l[0:2,3]
> > Traceback (most recent cal
On Sep 15, 2:07 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Sep 15, 10:56 pm, Paddy <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Sep 14, 9:49 pm, Paddy <[EMAIL PROTECTED]> wrote:
>
> > > Lets say i have a generator running that generates successive
> > > characters of a 'string'>From what I know, if
On Sep 14, 2007, at 11:54 PM, David Trudgett wrote:
> TheFlyingDutchman <[EMAIL PROTECTED]> writes:
>
>> The confusing way about the current Python method when you first
>> encounter it is
>> why is "self" being passed in when you write the function but not
>> when you call it. If the compiler is
On 2007-09-15, Arnau Sanchez <[EMAIL PROTECTED]> wrote:
>>> in Python... is the method to use ",".join() ? but then it
>>> must take a list of strings... not integers...
>>>
>>> any fast method?
>
> > print ''.join([str(i) for i in [1,2,3]])
>
> It's better to use generator comprehension instead
Hi list.
Is there any module that is compatible with RFC-3986 or 2396, which is like
Perl's URI module(http://search.cpan.org/~gaas/URI-1.35/URI.pm)?
I like to normalize lots of URIs I've got in my database to make them
all unique ones.
Thank you in advance.
--
http://mail.python.org/mailman/l
On Sep 15, 2007, at 8:56 AM, Arnau Sanchez wrote:
> js escribió:
>
>>> On 9/15/07, Summercool <[EMAIL PROTECTED]> wrote:
>
>>> in Python... is the method to use ",".join() ? but then it must
>>> take
>>> a list of strings... not integers...
>>>
>>> any fast method?
>
>> print ''.join([str(i)
On Sep 15, 2007, at 11:07 AM, Grant Edwards wrote:
> On 2007-09-15, Arnau Sanchez <[EMAIL PROTECTED]> wrote:
>
in Python... is the method to use ",".join() ? but then it
must take a list of strings... not integers...
any fast method?
>>
>>> print ''.join([str(i) for i in [1,2,
On 2007-09-15, Erik Jones <[EMAIL PROTECTED]> wrote:
>>> print ''.join([str(i) for i in [1,2,3]])
>>
>> It's better to use generator comprehension instead of LC:
>>
>> ",".join(str(i) for i in [1, 2, 3])
>
> Why is that? That entire expression must be evaluated to obtain the
> result, so what i
Free guitars here!!
http://freeguitars.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
i have the following string s and the following code, which doesn't
successfully remove the "\", but sucessfully removes the "\\".
>>> s="Sad\\asd\asd"
>>> newS=""
>>> for i in s:
... if i!="\\":
... newS=newS+i
...
>>> newS
'Sadasd\x07sd'
I have also read the following,
Konstantinos Pachopoulos wrote:
> i have the following string s and the following code, which doesn't
> successfully remove the "\", but sucessfully removes the "\\".
>
s="Sad\\asd\asd"
newS=""
for i in s:
> ... if i!="\\":
> ... newS=newS+i
I'm not quite sure what
> > It's nice people have invented so many ways to spell the
> > builting "map" ;)
> >
> ",".join(map(str,[1,2,3]))
> > '1,2,3'
>
> IIRC, map's status as a builtin is going away.
Actually, py3k built-in map == itertools.imap
>>> map(str, [])
--
http://www.advogato.org/person/eopadoan/
Boo
Diez B. Roggisch wrote:
> ctypes is for C. Where it is great to use.
if you need simple wrappers then swig and ctypes are both good since
they can generate it for you
pyrex is also good for wrapping and for writing c extension code
> If you need C++-wrapping, I recommend SIP.
i recommend py++
Grant Edwards ha escrito:
> > Or, if you happen to like the itertools modules:
> >
> > from itertools import imap
> > ",".join(imap(str, [1, 2, 3]))
>
> It's nice people have invented so many ways to spell the
> builting "map" ;)
Did you wonder why the Python developers bother to implement "imap"
http://world-traveling-destinations.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> On 2007-09-15, Erik Jones <[EMAIL PROTECTED]> wrote:
>
print ''.join([str(i) for i in [1,2,3]])
>>> It's better to use generator comprehension instead of LC:
>>>
>>> ",".join(str(i) for i in [1, 2, 3])
>> Why is that? That entire expression must be evaluated to obtain
http://freesoftwareupgrades.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
Am I the only one that thinks that python statements should force
whitespace before and after them?
Right now this is not enforced and for an example these statements are
valid
print"hello"
"foo"if"bar"else"foobar"
for(x,y)in[(1,2),(3,4)]:print(x,y)
[(y)for(x,y)in[("foo",2),("bar",4)]if"foo"in(x)
Konstantinos Pachopoulos wrote:
> Hi,
> i have the following string s and the following code, which doesn't
> successfully remove the "\", but sucessfully removes the "\\".
>
> >>> s="Sad\\asd\asd"
> >>> newS=""
> >>> for i in s:
> ... if i!="\\":
> ... newS=newS+i
> ...
> >>>
On Sep 15, 12:57 am, Terry Carroll <[EMAIL PROTECTED]> wrote:
> I'm trying to use wx.ProgressBar, and the cancel button is not
> responding.
>
> Here is a simple program that exhibits the problem:
>
> #
> import wx
> import time
>
> max = 10
buffi wrote:
> Am I the only one that thinks that python statements should force
> whitespace before and after them?
>
> Right now this is not enforced and for an example these statements are
> valid
>
> print"hello"
> "foo"if"bar"else"foobar"
> for(x,y)in[(1,2),(3,4)]:print(x,y)
> [(y)for(x,y)in
Hi,
From
http://www.pyzine.com/Issue008/Section_Articles/article_Encodings.html#guessing-the-encoding:
> The way to access the information about the "normal" encoding used on the
> current computer is through the locale module. Before using locale to
> retrieve the information you want, you need
buffi wrote:
> Am I the only one that thinks that python statements should force
> whitespace before and after them?
>
> Right now this is not enforced and for an example these statements are
> valid
>
> print"hello"
> "foo"if"bar"else"foobar"
> for(x,y)in[(1,2),(3,4)]:print(x,y)
> [(y)for(x,y)in[(
On 9/15/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote:
> And I'd hate to have to remember all of the rules for what can go
> together and what can't, especially when it comes time to debug. No.
> I don't think it should be forced, but maybe put it in PEP8 or PEP3008.
It is: see "Whitespace in Expre
On Sat, 15 Sep 2007 19:34:45 +0300, Konstantinos Pachopoulos wrote:
> Hi,
> i have the following string s and the following code, which doesn't
> successfully remove the "\", but sucessfully removes the "\\".
There is no \\ in the string; there's one \ , which gets succesfully
removed.
> >>> s=
Wow I just got it, and its nice doesn't even look used god damn. :D.
On 9/14/07, Lamonte Harris <[EMAIL PROTECTED]> wrote:
>
> Lol, you bought it, dude theres not one left imho. When I bought it, it
> still said 1 More left Lol...mines should be her no less then a hour -.-...
> Taking SO LONG.
>
awesome!
I should see it in about 2 wks.. im poor. So I choose super snail mail.
LN
--
http://mail.python.org/mailman/listinfo/python-list
Hi,everyone: I am a c programmer,and want using Python instead of C
I can change backcolor using C,like this:
textbackground(color);
How can I do in Python?
Best regards
点 击 此 处!免 费 试 玩 07 年 最 受 期 待 的 游 戏 大 作 ! --
http://mail.python.org/mailman/listinfo/python-list
Hello everyone,
I'm trying to test the tempfile module with the following script,
which basically creates a temporary file, fills the file with some
test data and prints it.
import tempfile
t = tempfile.TemporaryFile()
t.write("lalalala")
t.flush()
print t.read()
Unfortunately, the print statem
On Sep 15, 10:11 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> buffi wrote:
> > Am I the only one that thinks that python statements should force
> > whitespace before and after them?
>
> > Right now this is not enforced and for an example these statements are
> > valid
>
> > print"hello"
> > "f
On Sep 15, 3:55 pm, [EMAIL PROTECTED] wrote:
> Hi,everyone: I am a c programmer,and want using Python instead of C
> I can change backcolor using C,like this:
>
> textbackground(color);
>
> How can I do in Python?
>
> Best regards
>
> 点 击 此 处!免 费 试 玩 07 年 最 受 期 待 的 游 戏 大 作 !
textbackgrou
On Sep 15, 11:11 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm trying to test the tempfile module with the following script,
> which basically creates a temporary file, fills the file with some
> test data and prints it.
>
> import tempfile
>
> t = tempfile.TemporaryF
I can't see to get any y, x coordinates to work with curses. Here is
an example:
import curses
def my_program(screen):
while True:
ch = screen.getch()
if ch == ord("q"):
break
if ch <= 255:
screen.addstr(30, 10, "*%s*" % chr(ch))
sc
US patent application services:
http://www.pinskylaw.ca/Practice/OntarioTorontoLawyers/business_patents.htm
--
http://mail.python.org/mailman/listinfo/python-list
buffi wrote:
> On Sep 15, 10:11 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
>> buffi wrote:
>>> Am I the only one that thinks that python statements should force
>>> whitespace before and after them?
>>> Right now this is not enforced and for an example these statements are
>>> valid
>>> print"h
Hello all,
I was staring at a segment of code that looked like this today:
for something in stuff[x:y]:
whatever(something)
and was wondering if the compiler really made a copy of the slice from
stuff as the code seems to suggest, or does it find some way to produce
an iterator witho
On Sep 15, 11:49 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> buffi wrote:
> > On Sep 15, 10:11 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> >> buffi wrote:
> >>> Am I the only one that thinks that python statements should force
> >>> whitespace before and after them?
> >>> Right now this is n
Steve Holden wrote:
> I don't know why you have a bug up your ass about it, as the
> Americans say.
I think most Americans say "wild hare up your ass". We do not, in fact,
say "wild hair up your ass". Many of us can testify that a hair up one's
ass would be nothing terribly unusual and would go
On Sep 15, 11:58 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I was staring at a segment of code that looked like this today:
>
> for something in stuff[x:y]:
> whatever(something)
>
> and was wondering if the compiler really made a copy of the slice from
> stuff as the co
On Sep 15, 5:24 pm, buffi <[EMAIL PROTECTED]> wrote:
> On Sep 15, 11:11 pm, "[EMAIL PROTECTED]"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > Hello everyone,
>
> > I'm trying to test the tempfile module with the following script,
> > which basically creates a temporary file, fills the file with some
> > t
buffi wrote:
> On Sep 15, 11:58 pm, James Stroud <[EMAIL PROTECTED]> wrote:
>> Hello all,
>>
>> I was staring at a segment of code that looked like this today:
>>
>> for something in stuff[x:y]:
>> whatever(something)
>>
>> and was wondering if the compiler really made a copy of the slice
On Sep 16, 12:20 am, James Stroud <[EMAIL PROTECTED]> wrote:
> buffi wrote:
> > On Sep 15, 11:58 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> >> Hello all,
>
> >> I was staring at a segment of code that looked like this today:
>
> >> for something in stuff[x:y]:
> >> whatever(something)
This is a case where its up to the type involved. For example,
xrange() slices the way you want but range() does not. Maybe a type
would return for slices a proxy object that got the value by index or
maybe it knows that it makes more sense to give you a copy because
changes during the iteration sh
On Sep 14, 11:57 pm, Terry Carroll <[EMAIL PROTECTED]> wrote:
> I'm trying to use wx.ProgressBar, and the cancel button is not
> responding.
>
> Here is a simple program that exhibits the problem:
>
> #
> import wx
> import time
>
> max = 10
On Sep 16, 12:25 am, "Calvin Spealman" <[EMAIL PROTECTED]> wrote:
> This is a case where its up to the type involved. For example,
> xrange() slices the way you want but range() does not.
Coul you explain this?
As far as I know you can't slice a xrange
- Björn Kempén
--
http://mail.python.org/m
On 2007-09-15, Robert Kern <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
>> On 2007-09-15, Erik Jones <[EMAIL PROTECTED]> wrote:
>>
> print ''.join([str(i) for i in [1,2,3]])
It's better to use generator comprehension instead of LC:
",".join(str(i) for i in [1, 2, 3])
>>> Wh
[EMAIL PROTECTED] wrote:
> On Sep 15, 5:24 pm, buffi <[EMAIL PROTECTED]> wrote:
>> On Sep 15, 11:11 pm, "[EMAIL PROTECTED]"
>>
>>
>>
>> <[EMAIL PROTECTED]> wrote:
>>> Hello everyone,
>>> I'm trying to test the tempfile module with the following script,
>>> which basically creates a temporary file,
Pretend that you have a number that is always pointing somewhere in
your temporary file.
It starts a 0.
If you then write "lalalala" (8 characters) it will point after these
at position 8, so that you can write more stuff after your previous
text later by calling write.
The read method reads all t
Terry Carroll wrote:
> I'm trying to use wx.ProgressBar, and the cancel button is not
> responding.
>
> Here is a simple program that exhibits the problem:
>
> #
> import wx
> import time
>
> max = 10
> app = wx.PySimpleApp()
> dlg = wx.Prog
On Sep 14, 11:57 pm, Terry Carroll <[EMAIL PROTECTED]> wrote:
> I'm trying to use wx.ProgressBar, and the cancel button is not
> responding.
>
> Here is a simple program that exhibits the problem:
>
> #
> import wx
> import time
>
> max = 10
On 16/09/2007 8:11 AM, James Stroud wrote:
> Steve Holden wrote:
>> I don't know why you have a bug up your ass about it, as the
>> Americans say.
>
> I think most Americans say "wild hare up your ass".
The essence of Steve's point appears to be that the OP has ridden into
town to preach a misgu
Terry Carroll wrote:
>
> 2) The variable "skip: set to False on the first iteration, and then
> set to True on subsequent iterations? Note that this happens even if
> no buttons are selected. This is just a weirdness to me, and not my
> main concern, but I thought I'd mention it in case it's rele
Hi everyone, I'm a beginning programming student in Python and have a
few questions regarding strings.
If s1 = "spam"
If s2 = "ni!"
1. Would string.ljust(string.upper(s2),4) * 3 start it at the left
margin and move it 12 spaces to the right because of the 4 *3? If so,
why is it in the parath
On Sat, 15 Sep 2007 15:56:40 +0200, Arnau Sanchez wrote:
> js escribió:
>
>>> On 9/15/07, Summercool <[EMAIL PROTECTED]> wrote:
>
>>> in Python... is the method to use ",".join() ? but then it must take
>>> a list of strings... not integers...
>>>
>>> any fast method?
>
> > print ''.join([st
On Sat, 15 Sep 2007 19:52:47 -0400, Shawn Minisall wrote:
> Hi everyone, I'm a beginning programming student in Python and have a
> few questions regarding strings.
>
> If s1 = "spam"
>
> If s2 = "ni!"
>
> 1. Would string.ljust(string.upper(s2),4) * 3 start it at the left
> margin and move it
On Sat, 15 Sep 2007 14:58:15 -0700, James Stroud wrote:
> I was staring at a segment of code that looked like this today:
>
> for something in stuff[x:y]:
> whatever(something)
>
> and was wondering if the compiler really made a copy of the slice from
> stuff as the code seems to sugg
On Sat, 15 Sep 2007 14:15:20 +, brus stoc at gmail dot com wrote:
[snip spam]
> Hey, thanks for spamming our group.
You know, there are probably millions of people who never received the
original spam because their Usenet provider does a good job of filtering
out crud, and they wouldn't e
1 - 100 of 118 matches
Mail list logo