On 10/16/17 7:39 PM, מיקי מונין wrote:
Hello, I am working on an article on python string formatting. As a part of
the article I am researching the different forms of python string
formatting.
While researching string interpolation(i.e. the % operator) I noticed
something weird with string lengt
Hello, I am working on an article on python string formatting. As a part of
the article I am researching the different forms of python string
formatting.
While researching string interpolation(i.e. the % operator) I noticed
something weird with string lengths.
Given two following two functions:
On Thu, Jan 14, 2016 at 3:03 PM, Michal Nalevanko
wrote:
> I've just installed Python 3.5.1 on my computer and came across somewhat
> strange behavior.
>
> This is a snapshot of a short code that I wrote: https://goo.gl/izYbD0
>
> Quite simple, you might say. Obviously, th
Hello,
I've just installed Python 3.5.1 on my computer and came across somewhat
strange behavior.
This is a snapshot of a short code that I wrote: https://goo.gl/izYbD0
Quite simple, you might say. Obviously, the program should create a new
text file, nothing else. But do you see the numbe
On Tue, 03 Jun 2014 10:01:26 +0200, Peter Otten wrote:
> Steven D'Aprano wrote:
>
>> On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
>>
>>> I invoked the wrong bug.py :/ , works fine now (this happens to me
>>> when im a bit tired sometimes...).
>>
>> Clarity in naming is an excellent thin
Steven D'Aprano wrote:
> On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
>
>> I invoked the wrong bug.py :/ , works fine now (this happens to me when
>> im a bit tired sometimes...).
>
> Clarity in naming is an excellent thing. If you have two files called
> "bug.py", that's two too many.
On Tue, Jun 3, 2014 at 12:06 PM, Rustom Mody wrote:
> Add to that the restriction to limited character sets such as ASCII
> – a restriction that has only historical relevance
Wrong. The name has to fit inside the human's brain; if it's not
ASCII, that's not a problem.
ChrisA
--
https://mail.pyt
On Tuesday, June 3, 2014 6:27:25 AM UTC+5:30, Ben Finney wrote:
> Steven D'Aprano writes:
> > On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
> > > I invoked the wrong bug.py :/ , works fine now (this happens to me
> > > when im a bit tired sometimes...).
> > Clarity in naming is an excellen
Steven D'Aprano writes:
> On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
>
> > I invoked the wrong bug.py :/ , works fine now (this happens to me
> > when im a bit tired sometimes...).
>
> Clarity in naming is an excellent thing […] Programs should be named
> by what they do […] or when tha
On Mon, Jun 2, 2014 at 5:30 PM, Chris Angelico wrote:
> On Tue, Jun 3, 2014 at 10:22 AM, Steven D'Aprano
> wrote:
>> On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
>>
>>> I invoked the wrong bug.py :/ , works fine now (this happens to me when
>>> im a bit tired sometimes...).
>>
>> Clarity
On Tue, Jun 3, 2014 at 10:22 AM, Steven D'Aprano
wrote:
> On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
>
>> I invoked the wrong bug.py :/ , works fine now (this happens to me when
>> im a bit tired sometimes...).
>
> Clarity in naming is an excellent thing. If you have two files called
> "
On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
> I invoked the wrong bug.py :/ , works fine now (this happens to me when
> im a bit tired sometimes...).
Clarity in naming is an excellent thing. If you have two files called
"bug.py", that's two too many.
Imagine having fifty files called "
I invoked the wrong bug.py :/ , works fine now (this happens to me when im
a bit tired sometimes...).
Im unsure about the "real" bugreport, will investigate if I find some time
and motivation.
--
https://mail.python.org/mailman/listinfo/python-list
robert...@googlemail.com wrote:
> Hello folks,
>
> I am not sure if it is only on my system the case that the code in
> http://pastebin.com/WETvqMJN misbehaves in the stated way.
> Can anybody reproduce it?
>
> I thought it could be that the tabs/spaces do influence it, but it doesn't
> care.
>
On 02/06/2014 17:35, robert...@googlemail.com wrote:
Hello folks,
I am not sure if it is only on my system the case that the code in
http://pastebin.com/WETvqMJN misbehaves in the stated way.
Can anybody reproduce it?
I thought it could be that the tabs/spaces do influence it, but it
doesn't ca
Hello folks,
I am not sure if it is only on my system the case that the code in
http://pastebin.com/WETvqMJN misbehaves in the stated way.
Can anybody reproduce it?
I thought it could be that the tabs/spaces do influence it, but it doesn't
care.
Thank you very much for your time.
Robert
--
htt
On 02/26/2014 10:24 PM, ast wrote:
Hello
box is a list of 3 integer items
If I write:
box.sort()
if box == [1, 2, 3]:
the program works as expected. But if I write:
if box.sort() == [1, 2, 3]:
it doesn't work, the test always fails. Why ?
Thx
sort() sorts the sequence in pla
On 02/26/2014 10:24 PM, ast wrote:
Hello
box is a list of 3 integer items
If I write:
box.sort()
if box == [1, 2, 3]:
the program works as expected. But if I write:
if box.sort() == [1, 2, 3]:
Most such questions can be answered by printing out the values in
question and observi
Thanks for the very clear explanation
--
https://mail.python.org/mailman/listinfo/python-list
"ast" :
> if I write:
>
>if box.sort() == [1, 2, 3]:
>
> it doesn't work, the test always fails. Why ?
The list.sort() method returns None.
The builtin sorted() function returns a list:
if sorted(box) == [1, 2, 3]:
would work.
Note that the list.sort() method is often preferred because
"ast" writes:
> If I write:
>
>box.sort()
>if box == [1, 2, 3]:
>
> the program works as expected. But if I write:
>
>if box.sort() == [1, 2, 3]:
>
> it doesn't work, the test always fails. Why ?
Because very often methods **dont't** return the object they are applied
(self that is).
On Thu, Feb 27, 2014 at 07:24:24AM +0100, ast wrote:
> Hello
>
> box is a list of 3 integer items
>
> If I write:
>
>box.sort()
>if box == [1, 2, 3]:
>
>
> the program works as expected. But if I write:
>
>if box.sort() == [1, 2, 3]:
>
> it doesn't work, the test always fails. Wh
"ast" wrote in message
news:530eda1d$0$2061$426a7...@news.free.fr...
> Hello
>
> box is a list of 3 integer items
>
> If I write:
>
>box.sort()
>if box == [1, 2, 3]:
>
>
> the program works as expected. But if I write:
>
>if box.sort() == [1, 2, 3]:
>
> it doesn't work, the test alwa
Hello
box is a list of 3 integer items
If I write:
box.sort()
if box == [1, 2, 3]:
the program works as expected. But if I write:
if box.sort() == [1, 2, 3]:
it doesn't work, the test always fails. Why ?
Thx
--
https://mail.python.org/mailman/listinfo/python-list
Kasper Guldmann writes:
> I was playing around with lambda functions, but I cannot seem to
> fully grasp them. I was running the script below in Python 2.7.5,
> and it doesn't do what I want it to. Are lambda functions really
> supposed to work that way. How do I make it work as I intend?
>
> f =
On Friday, September 20, 2013 8:51:20 PM UTC+5:30, Kasper Guldmann wrote:
> I was playing around with lambda functions, but I cannot seem to fully grasp
> them. I was running the script below in Python 2.7.5, and it doesn't do what
> I want it to. Are lambda functions really supposed to work that w
On 20/09/2013 16:21, Kasper Guldmann wrote:
I was playing around with lambda functions, but I cannot seem to fully grasp
them. I was running the script below in Python 2.7.5, and it doesn't do what
I want it to. Are lambda functions really supposed to work that way. How do
I make it work as I int
On Sat, Sep 21, 2013 at 1:21 AM, Kasper Guldmann wrote:
> f = []
> for n in range(5):
> f.append( lambda x: x*n )
You're leaving n as a free variable here. The lambda function will
happily look to an enclosing scope, so this doesn't work. But there is
a neat trick you can do:
f = []
for n in
I was playing around with lambda functions, but I cannot seem to fully grasp
them. I was running the script below in Python 2.7.5, and it doesn't do what
I want it to. Are lambda functions really supposed to work that way. How do
I make it work as I intend?
f = []
for n in range(5):
f.append(
Hi everyone,
I realize my previous post was quite unreadable, thanks to my email
client. I am going to report my question here, with slight enhancements.
Apologies for inconvenience caused and spamming your mailboxes.
I am facing a strange problem using weave on 64 bit machine.
Specifically
Thank you all for your replies.
I had the matrix concept in mind such as
explained in the numpy example.
Rob
On Thu, Apr 18, 2013 at 3:19 PM, Wolfgang Maier <
wolfgang.ma...@biologie.uni-freiburg.de> wrote:
> Robrecht W. Uyttenhove gmail.com> writes:
>
> >
> > Hello,
> > I tried out the follo
Robrecht W. Uyttenhove gmail.com> writes:
>
> Hello,
> I tried out the following
code:y=[range(0,7),range(7,14),range(14,21),range(21,28),range(28,35)]
> >>> y[[0, 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, >
In "Robrecht W.
Uyttenhove" writes:
> I tried out the following code:
> y=[range(0,7),range(7,14),range(14,21),range(21,28),range(28,35)]
> >>> y
> [[0, 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,
Robrecht W. Uyttenhove wrote:
> Hello,
>
> I tried out the following code:
> y=[range(0,7),range(7,14),range(14,21),range(21,28),range(28,35)]
y
> [[0, 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, 3
Hello,
I tried out the following code:
y=[range(0,7),range(7,14),range(14,21),range(21,28),range(28,35)]
>>> y
[[0, 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]]
>>> y[1:5:2][::3]
[[7, 8, 9, 10, 11, 12,
On 16-Aug-2012 19:40, Steven D'Aprano wrote:
On Thu, 16 Aug 2012 13:18:59 +0200, Virgil Stokes wrote:
On 15-Aug-2012 02:19, Steven D'Aprano wrote:
On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote:
You might find the following useful:
def testFunc(startingList):
xOnlyList = [];
On Thu, 16 Aug 2012 13:18:59 +0200, Virgil Stokes wrote:
> On 15-Aug-2012 02:19, Steven D'Aprano wrote:
>> On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote:
>>
>>> You might find the following useful:
>>>
>>> def testFunc(startingList):
>>> xOnlyList = []; j = -1
>>> for xl in s
x27;''
Purpose: Time four different algorithms for the same task
Author: V. Stokes (v...@it.uu.se, 2012-08-16 (15:46), 2012-08-16)
Refs:
python-list@python.org list
* Strange behavior, 14-Aug-2012 17:38, light1qu...@gmail.com
* Re: Strange behavior, 14-Aug-2012 21:40, Stok
Virgil Stokes wrote:
>>> def testFunc(startingList):
>>>xOnlyList = []; j = -1
>>>for xl in startingList:
>>>if (xl[0] == 'x'):
>> That's going to fail in the starting list contains an empty string. Use
>> xl.startswith('x') instead.
> Yes, but this was by design (tacitly assumed that startingList
algorithm-2A slower than algorithm-2?
I would be interested in seeing code that is faster than algorithm-1 --- any
suggestions are welcomed. And of course, if there are any errors in my attached
code please inform me of them and I will try to correct them as soon as
possible. Note, some of the
light1qu...@gmail.com writes:
> I got my answer by reading your posts and referring to:
> http://docs.python.org/reference/compound_stmts.html#the-for-statement
> (particularly the shaded grey box)
Not that the problem is not specific to python (if you erase the current
element when traversing a
Chris Angelico writes:
> Other people have explained the problem with your code. I'll take this
> example as a way of introducing you to one of Python's handy features
> - it's an idea borrowed from functional languages, and is extremely
> handy. It's called the "list comprehension", and can be l
On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote:
> You might find the following useful:
>
> def testFunc(startingList):
> xOnlyList = []; j = -1
> for xl in startingList:
> if (xl[0] == 'x'):
That's going to fail in the starting list contains an empty string. Use
xl.s
On Wed, Aug 15, 2012 at 1:38 AM, wrote:
> def testFunc(startingList):
> xOnlyList = [];
> for str in startingList:
> if (str[0] == 'x'):
> print str;
> xOnlyList.append(str)
> startingList.remo
Original Message
Subject:Re: Strange behavior
Date: Tue, 14 Aug 2012 21:32:16 +0200
From: Virgil Stokes
To: light1qu...@gmail.com
On 2012-08-14 17:38, light1qu...@gmail.com wrote:
Hi, I am migrating from PHP to Python and I am slightly confused.
I am
On 2012-08-14 17:38, light1qu...@gmail.com wrote:
Hi, I am migrating from PHP to Python and I am slightly confused.
I am making a function that takes a startingList, finds all the strings in the
list that begin with 'x', removes those strings and puts them into a xOnlyList.
However if you run
On 8/14/2012 11:59 AM, Alain Ketterlin wrote:
light1qu...@gmail.com writes:
However if you run the code you will notice only one of the strings
beginning with 'x' is removed from the startingList.
def testFunc(startingList):
xOnlyList = [];
for str in startingList:
light1qu...@gmail.com writes:
> However if you run the code you will notice only one of the strings
> beginning with 'x' is removed from the startingList.
>
> def testFunc(startingList):
> xOnlyList = [];
> for str in startingList:
> if (str[0] == 'x'):
>
Hi, I am migrating from PHP to Python and I am slightly confused.
I am making a function that takes a startingList, finds all the strings in the
list that begin with 'x', removes those strings and puts them into a xOnlyList.
However if you run the code you will notice only one of the strings beg
On Mon, Feb 13, 2012 at 3:16 PM, Arnaud Delobelle wrote:
>> Strangely it was working fine the other day. Then while debugging a
>> script it suddenly started do this and now does this for every script
>
> How were you debugging?
I think I may have been attempting to use pipes to redirect stdin
an
On 13 February 2012 19:50, waylan wrote:
> When I try running any Python Script on the command line with Python
> 3.2 I get this weird behavior. The cursor dances around the command
> line window and nothing ever happens. Pressing Ctr+C does nothing.
> When I close the window (mouse click on X in
_":
print("Hello, World!")
In an attempt to check the exact version of Python, even this causes
the strange behavior:
c:\Python32\python.exe -V
I'm on Windows XP if that matters. IDLE (which works fine) tells me
I'm on Python 3.2.2
Any suggestions?
--
http://mail.python.org/mailman/listinfo/python-list
I don't know how many times I stared at that code without seeing the error.
Thanks so much!
Phillip
On Fri, Sep 23, 2011 at 1:26 PM, Arnaud Delobelle wrote:
> On 23 September 2011 21:09, Dr. Phillip M. Feldman
> wrote:
> >
> > A few weeks ago, I wrote a class that creates an iterator for solv
On 23 September 2011 21:09, Dr. Phillip M. Feldman
wrote:
>
> A few weeks ago, I wrote a class that creates an iterator for solving the
> general unlabeled-balls-in-labeled boxes occupancy problem. Chris Rebert
> converted my code to a generator, which made the code cleaner, and I
> subsequently s
above, but one of
them is now missing. If someone can shed light on why this is happening, I'd
be grateful.
Phillip
http://old.nabble.com/file/p32503886/balls_in_labeled_boxes.py
balls_in_labeled_boxes.py
--
View this message in context:
http://old.nabble.com/strange-behavior-from-recursive
e
code work all time. That is the main reason I believe there is a problem in
the Queue code somewhere.
Cheers,
On Wed, Sep 15, 2010 at 5:47 PM, MRAB wrote:
> On 15/09/2010 21:10, Bruno Oliveira wrote:
>
>> Hi list,
>>
>> I recently found a bug in my company
On 15/09/2010 21:10, Bruno Oliveira wrote:
Hi list,
I recently found a bug in my company's code because of a strange
behavior using multiprocessing.Queue. The following code snippet:
from multiprocessing import Queue
queue = Queue()
queue.put('x')
print queue.get_nowa
Hi list,
I recently found a bug in my company's code because of a strange behavior
using multiprocessing.Queue. The following code snippet:
from multiprocessing import Queue
queue = Queue()
queue.put('x')
print queue.get_nowait()
Fails with:
...
File
"E:\Shared\
Tsviki Hirsh wrote:
>>>dict.fromkeys('at',50)
{'a': 50, 't': 50}
This is obviously not what I wanted.
Not obvious at all. It is precisely what you asked for ;-)
Please read the doc:
5.8. Mapping Types — dict
"classmethod fromkeys(seq[, value])
Create a new dictionary with keys from seq and
On Mon, Dec 7, 2009 at 12:42 AM, Tsviki Hirsh wrote:
> Dear list,
> I'm trying to create a dictionary from set of keys and values using
> dict.fromkeys
> When I type:
dict.fromkeys('a',50)
> the output is:
> {'a': 50}
> This is fine, but when I try to set the same value to a different name key
Dear list,
I'm trying to create a dictionary from set of keys and values using
dict.fromkeys
When I type:
>>>dict.fromkeys('a',50)
the output is:
{'a': 50}
This is fine, but when I try to set the same value to a different name key:
>>>dict.fromkeys('at',50)
the output now is:
{'a': 50, 't':
In article <626f24e5-4d8e-416c-b3ed-dc56a88dc...@s21g2000prm.googlegroups.com>,
Lambda wrote:
>
>def matrix_power(m, n):
> result = m[:]
> print result is m
Use copy.deepcopy()
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
"You could make Eskimos emigrate t
Mark Dickinson wrote:
On Oct 28, 8:24 am, Lambda wrote:
Thank you!
Following is my final code:
Looks good, but are you sure about that word 'final'? ;-)
def matrix_power(m, n):
"""
Raise 2x2 matrix m to nth power.
"""
if n =0: return [[1, 0], [0, 1]]
x =atrix_power(m,
Lambda wrote:
> I defined a function to raise a 2x2 matrix to nth power:
> BTW, numpy has such a function, but it doesn't support really large
> number.
> Does numpy has some functions that support arbitrarily large number?
You can tell it to use Python instead of C integers:
>>> import numpy
>
On Oct 28, 8:24 am, Lambda wrote:
> Thank you!
> Following is my final code:
Looks good, but are you sure about that word 'final'? ;-)
>
> def matrix_power(m, n):
> """
> Raise 2x2 matrix m to nth power.
> """
> if n == 0: return [[1, 0], [0, 1]]
>
> x = matrix_power(m, n / 2)
I sugg
On Oct 28, 10:40 am, Chris Rebert wrote:
> On Tue, Oct 27, 2009 at 7:15 PM, Lambda wrote:
> > I defined a function to raise a 2x2 matrix to nth power:
>
> > def matrix_power(m, n):
> > result = m[:]
>
> Note that this only copies the *outer* list. It does NOT copy any of
> the inner, nested list
Lambda wrote:
I defined a function to raise a 2x2 matrix to nth power:
There is a much faster way to raise x to a count power n than the
definitional but naive method of multipling 1 by x n times. It is based
on the binary representation of n.
Example: x**29 = x**(16+8+4+1) = x**16 * x**8 *
On Tue, Oct 27, 2009 at 7:15 PM, Lambda wrote:
> I defined a function to raise a 2x2 matrix to nth power:
>
> def matrix_power(m, n):
> result = m[:]
Note that this only copies the *outer* list. It does NOT copy any of
the inner, nested lists, it just makes fresh *references* to them,
which is w
I defined a function to raise a 2x2 matrix to nth power:
def matrix_power(m, n):
result = m[:]
print result is m
for i in range(n - 1):
result[0][0] = result[0][0] * m[0][0] + result[0][1] * m[1][0]
result[0][1] = result[0][0] * m[0][1] + result[0][1] * m[1][1]
result[1][0] = re
That's it. I am calling my own program and not coreutils' sort, what
explains the unrequested output. Many thanks.
Cheers,
Kay
On 16 Jun., 22:16, Piet van Oostrum wrote:
> > kmw (k) wrote:
> >k> Hi,
> >k> I wanted to write a simple script (in 5 minutes or so) which replaces
> >k> the option
> kmw (k) wrote:
>k> Hi,
>k> I wanted to write a simple script (in 5 minutes or so) which replaces
>k> the option '+1' given to the command 'sort' by '-k 2' and than runs
>k> 'sort' with the modified argument list. After two hours I am giving up
>k> and ask you for help. This is what I tried
kmw wrote:
Hi,
I wanted to write a simple script (in 5 minutes or so) which replaces
the option '+1' given to the command 'sort' by '-k 2' and than runs
'sort' with the modified argument list. After two hours I am giving up
and ask you for help. This is what I tried (please excuse the verbose
co
Hi,
I wanted to write a simple script (in 5 minutes or so) which replaces
the option '+1' given to the command 'sort' by '-k 2' and than runs
'sort' with the modified argument list. After two hours I am giving up
and ask you for help. This is what I tried (please excuse the verbose
code, it is due
Tim Roberts wrote:
Scott David Daniels wrote:
I avoid using single-letter variables except where I know the types
from the name (so I use i, j, k, l, m, n as integers, s as string,
and w, x, y, and z I am a little looser with (but usually float or
complex).
It's amazing to me that Fortran con
Tim Roberts wrote:
> Scott David Daniels wrote:
>> I avoid using single-letter variables except where I know the types
>>from the name (so I use i, j, k, l, m, n as integers, s as string,
>> and w, x, y, and z I am a little looser with (but usually float or
>> complex).
>
> It's amazing to me tha
Scott David Daniels wrote:
>
>I avoid using single-letter variables except where I know the types
>from the name (so I use i, j, k, l, m, n as integers, s as string,
>and w, x, y, and z I am a little looser with (but usually float or
>complex).
It's amazing to me that Fortran continues to live on
On Dec 27, 8:52 am, David Lemper wrote:
> I'm a newbee trying 3.0 Please help with math.sqrt()
math.sqrt() is not the problem.
> At the command line this function works correctly
> >>> import math
> n = input("enter a number > ")
> s = math.sqrt(n)
> An e
En Fri, 26 Dec 2008 19:52:24 -0200, escribió:
I'm a newbee trying 3.0 Please help with math.sqrt()
At the command line this function works correctly
>>> import math
n = input("enter a number > ")
s = math.sqrt(n)
An entry of 9 or 9.0 will yield 3.0
Y
On Fri, Dec 26, 2008 at 1:52 PM, wrote:
> I'm a newbee trying 3.0 Please help with math.sqrt()
>
> At the command line this function works correctly
> >>> import math
> n = input("enter a number > ")
raw_input() was renamed input() in Python 3.0, and it returns a
*string*, n
David Lemper wrote:
I'm a newbee trying 3.0 Please help with math.sqrt()
At the command line this function works correctly
>>> import math
n = input("enter a number > ")
s = math.sqrt(n)
An entry of 9 or 9.0 will yield 3.0
Yet the same code in a sc
I'm a newbee trying 3.0 Please help with math.sqrt()
At the command line this function works correctly
>>> import math
n = input("enter a number > ")
s = math.sqrt(n)
An entry of 9 or 9.0 will yield 3.0
Yet the same code in a script gives an error mess
Guy Doune <[EMAIL PROTECTED]> wrote:
>Ok, didn't show the whole problem...
>
>I will read the doc anyway, but why "questions.html" keep it "t"??
>
> >>> test=['03.html', '06.html', 'questions.html', '04.html',
>'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html']
> >>> test[4]
>'toc
Guy Doune wrote:
Guy Doune a écrit :
Ok, didn't show the whole problem...
I will read the doc anyway, but why "questions.html" keep it "t"??
>>> test=['03.html', '06.html', 'questions.html', '04.html',
'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html']
>>> test[4]
'toc.html
On Fri, 5 Dec 2008 at 07:54, Mark Tolonen wrote:
> > import re
> > re.split('[,.]','blah,blah.blah')
['blah', 'blah', 'blah']
Thank you. Somehow it never occurred to me that I could use that
kind of pattern that way. I guess my brain just doesn't think
in regexes very well :)
--RDM
--
htt
[EMAIL PROTECTED] wrote:
On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote:
'toc.html'
> > > test[4].strip('.html')
'oc'
Can't figure out what is going on, really.
What I can't figure out is why, when people cannot figure out what is
going on with a function (or methods in this case), they
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote:
[snip]
I have often wished that in 'split' I could specify a _set_ of characters
on which the string would be split, in the same way the default list
of whitespace characters causes a s
On Thu, 4 Dec 2008 at 20:54, Terry Reedy wrote:
'toc.html'
> > > test[4].strip('.html')
'oc'
Can't figure out what is going on, really.
What I can't figure out is why, when people cannot figure out what is going
on with a function (or methods in this case), they do not look it up the doc.
"Guy Doune" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Ok, didn't show the whole problem...
I will read the doc anyway, but why "questions.html" keep it "t"??
>>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',
'01.html', '05.html', '07.html', '02.html'
Guy Doune a écrit :
Ok, didn't show the whole problem...
I will read the doc anyway, but why "questions.html" keep it "t"??
>>> test=['03.html', '06.html', 'questions.html', '04.html',
'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html']
>>> test[4]
'toc.html'
>>> test[4].stri
Ok, didn't show the whole problem...
I will read the doc anyway, but why "questions.html" keep it "t"??
>>> test=['03.html', '06.html', 'questions.html', '04.html',
'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html']
>>> test[4]
'toc.html'
>>> test[4].strip('.html')
'oc'
>>> tes
Guy Doune wrote:
Hi everybody,
Could it be a bug?
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> test=['03.html', '06.html', 'questions.html', '04.html',
'toc.html',
Guy Doune wrote:
Hi everybody,
Could it be a bug?
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> test=['03.html', '06.html', 'questions.html', '04.html',
'toc.html',
On Fri, Dec 5, 2008 at 9:35 AM, Guy Doune <[EMAIL PROTECTED]> wrote:
test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',
'01.html', '05.html', '07.html', '02.html', '08.html']
test
> ['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html',
> '05.htm
In article <[EMAIL PROTECTED]>, Guy Doune <[EMAIL PROTECTED]>
wrote:
> Could it be a bug?
>
> Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
> [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> test=['03.html', '06.h
Guy Doune wrote:
Hi everybody,
Could it be a bug?
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> test=['03.html', '06.html', 'questions.html', '04.html',
'toc.html',
Hi everybody,
Could it be a bug?
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> test=['03.html', '06.html', 'questions.html', '04.html',
'toc.html', '01.html', '05.html
Steve Holden <[EMAIL PROTECTED]> writes:
> Arnaud Delobelle wrote:
>> Jason Scheirer <[EMAIL PROTECTED]> writes:
>>> Python is pass-by-reference, not pass-by-value.
>>
>> It's certainly not pass-by-reference, nor is it pass-by-value IMHO.
>>
> Since no lists are being passed as arguments in thes
The issue is exhausted in Python Library Reference, Chapter 3.6, so I
should apologize for initial posting. All comments were helpful,
though Arnaud and Steve are right that pass-by-anything is off the
point.
Thanks All!
--
http://mail.python.org/mailman/listinfo/python-list
Arnaud Delobelle wrote:
> Jason Scheirer <[EMAIL PROTECTED]> writes:
>
>> On Nov 24, 10:34 pm, [EMAIL PROTECTED] wrote:
>>> Hi Python experts! Please explain this behavior:
>>>
>> nn=3*[[]]
>> nn
>>> [[], [], []]
>> mm=[[],[],[]]
>> mm
>>> [[], [], []]
>>>
>>> Up till now, 'mm' and
On Tue, Nov 25, 2008 at 9:23 AM, Arnaud Delobelle <[EMAIL PROTECTED]>wrote:
> Jason Scheirer <[EMAIL PROTECTED]> writes:
>
> > On Nov 24, 10:34 pm, [EMAIL PROTECTED] wrote:
> >> Hi Python experts! Please explain this behavior:
> >>
> >> >>> nn=3*[[]]
> >> >>> nn
> >> [[], [], []]
> >> >>> mm=[[],[
1 - 100 of 173 matches
Mail list logo