Steven D'Aprano wrote:
On Mon, 22 Feb 2010 04:23:04 am Dayo Adewunmi wrote:
Hi all
I'm trying use regex to match image formats:
Perhaps you should use a simpler way.
def isimagefile(filename):
ext = os.path.splitext(filename)[1]
return (ext.lower() in
('.jpg', '.jpeg', '
Hello,
I am trying to write and test a function to meet the following specifications
drawFace(center,size,win),center is a point,size is an int,and win is a
GraphWin.Draws a simple face of the given size in win.
I want the function to be able to draw three differnet faces in a single
window,w
On Mon, Feb 22, 2010 at 1:06 AM, Lao Mao wrote:
> Hi,
>
> I have an html file, with xml style comments in:
>
>
>
> I'd like to extract only the comments. My sense of smell suggests that
> there's probably a library (maybe an xml library) that does this already.
Take a look at BeautifulSoup:
htt
On Mon, 22 Feb 2010 12:49:51 pm Olufemi Onanuga wrote:
> Hello,
> I am trying to write and test a function to meet the following
> specifications
> drawFace(center,size,win),center is a point,size is an int,and win is
> a GraphWin.Draws a simple face of the given size in win.
> I want the functio
On Mon, 22 Feb 2010 06:37:21 pm spir wrote:
> > It *seems* to work, because \d is left as backlash-d. But then you
> > do this, and wonder why you can't open the file:
>
> I consider this misleading, since it can only confuse newcomers.
> Maybe "lonely" single backslashes (not forming a "code" wit
Ok, thankyou.
So, in other words, i must pay attention to what i set as default value in a
function. I should NEVER set empty lists as default values.
The guide i've linked says "To learn more about this, you should read the
documentation and look for the difference between *identity* and *equali
On Mon, Feb 22, 2010 at 9:13 AM, Giorgio wrote:
> And, i have some difficulties understanding the other "strange" example in
> that howto. Just scroll down to: "However, the point is that the value
> of x is picked up from the environment at the time when the function is
> defined. How is this us
Ahah Kent this is amazing.
I was reading the ITALIAN
http://www.python.it/doc/articoli/instpy-0.html version
of that guide that is not updated. But, when i decided to post there i've
posted the link of the guide in english, but actually that's not what i've
readen.
Ok, so in the new python versio
Well, it looks very much like my stab in the dark is very much correct
( see end of msg below). I changed the name of the file in the folder
from which I copied the file to place elsewhere. When I tried to open
the file, it started searching for the file.Properties clearly shows it
pointing t
Hello There,
I got two pairs of coordinates say (4,5) and (7,9) from these two pairs i
would like to generate two lists
[4, 4, 4, 4, 4,5, 5, 5, 5, 5,6, 6, 6, 6, 6,7, 7, 7, 7, 7]
and
[5, 6, 7, 8, 9,5, 6, 7, 8, 9,5, 6, 7, 8, 9, 5, 6, 7, 8, 9]
i am actually generating all co
sorry guys, i found a solution, ignore the post
cheers
Johnson
On Mon, Feb 22, 2010 at 4:57 PM, Jojo Mwebaze wrote:
> Hello There,
>
> I got two pairs of coordinates say (4,5) and (7,9) from these two pairs i
> would like to generate two lists
>
> [4, 4, 4, 4, 4,5, 5, 5, 5, 5,6, 6, 6, 6
>>> [(i,j) for i in range(4, 5+1) for j in range(7, 9+1)]
[(4, 7), (4, 8), (4, 9), (5, 7), (5, 8), (5, 9)]
On Mon, Feb 22, 2010 at 9:33 PM, Jojo Mwebaze wrote:
> sorry guys, i found a solution, ignore the post
>
> cheers
>
> Johnson
>
>
> On Mon, Feb 22, 2010 at 4:57 PM, Jojo Mwebaze wrote:
>
>>
Norman Rieß, 19.02.2010 13:42:
> i am trying to read a large bz2 file with this code:
>
> source_file = bz2.BZ2File(file, "r")
> for line in source_file:
> print line.strip()
>
> But after 4311 lines, it stoppes without a errormessage. The bz2 file is
> much bigger though.
Could you send in
Wow, thank you Steve. This certainly answers a few questions i've had
simmering for a while.
On Mon, Feb 22, 2010 at 1:01 AM, Steven D'Aprano wrote:
> On Mon, 22 Feb 2010 05:22:10 am Sithembewena Lloyd Dube wrote:
> > Hi all,
> >
> > I'm trying to read a file (Python 2.5.2, Windows XP) as follows
@spr, thanks for the explanation, especially on representations of strings.
To think that i freely used repr(variable_x) without fully understanding the
meaning and the power of that function..
On Mon, Feb 22, 2010 at 9:37 AM, spir wrote:
> Just a little complement to Steven's excellent explan
I believe i encountered repr()in the Python tutorial, but i had not kept the
relevance of it in my memory..
On Mon, Feb 22, 2010 at 9:35 PM, Sithembewena Lloyd Dube
wrote:
> @spr, thanks for the explanation, especially on representations of strings.
> To think that i freely used repr(variable_x)
Hi everyone!
I need a simple way to encrypt and decrypt some strings with a key
someone can help me??
Thanks.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Mon, Feb 22, 2010 at 2:50 PM, Antonio Buzzelli
wrote:
> Hi everyone!
> I need a simple way to encrypt and decrypt some strings with a key
>
> someone can help me??
I'm sure someone can.
-Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe
Dear all,
I am trying to run a very simple searchlight on fMRI data via PyLab (on Mac
Leopard).
My code is as follows:
from mvpa.suite import *
import os
from matplotlib.pyplot import figure, show
from mvpa.misc.io.base import SampleAttributes
from mvpa.datasets.nifti import NiftiDataset
if __de
how about using base64? base64.encodestring(s) will do.
On Tue, Feb 23, 2010 at 2:30 AM, Wayne Werner wrote:
> On Mon, Feb 22, 2010 at 2:50 PM, Antonio Buzzelli > wrote:
>
>> Hi everyone!
>> I need a simple way to encrypt and decrypt some strings with a key
>>
>> someone can help me??
>
>
> I'
"Olufemi Onanuga" wrote
I am trying to write and test a function to meet the following
specifications
drawFace(center,size,win),center is a point,size is an int,
and win is a GraphWin.Draws a simple face of the given size in win.
I want the function to be able to draw three differnet faces
Or possibly strange list of object behaviour
IDLE 2.6.2
>>> class Player():
hand = []
>>> Colin = Player()
>>> Alex = Player()
>>>
>>> Players = [Colin, Alex]
>>>
>>> def hands():
for player in Players:
player.hand.append("A")
>>> hands()
>>>
>>> Colin.ha
>> I need a simple way to encrypt and decrypt some strings with a key.
Did you have any other requirements? Any specific algorithms or key lengths?
If you need real encryption, you might check out a 3rd party module
named 'PyCrypto'. It offers an implementation of the AES algorithm. A
less eloque
On Mon, Feb 22, 2010 at 4:10 PM, C M Caine wrote:
> Or possibly strange list of object behaviour
>
> IDLE 2.6.2
> >>> class Player():
>hand = []
>
>
> >>> Colin = Player()
> >>> Alex = Player()
> >>>
> >>> Players = [Colin, Alex]
> >>>
> >>> def hands():
>for player in Players:
>
On 23 February 2010 08:16, Benno Lang wrote:
> class Hand:
> def __init__(self):
> self.hand = []
Of course, I meant "class Player"
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/m
On Tue, 23 Feb 2010 07:50:12 am Antonio Buzzelli wrote:
> Hi everyone!
> I need a simple way to encrypt and decrypt some strings with a key
>
> someone can help me??
>
> Thanks.
I am the author of this package which might be enough for you:
http://pypi.python.org/pypi/obfuscate/
If all you want
On 23 February 2010 07:10, C M Caine wrote:
> Or possibly strange list of object behaviour
>
> IDLE 2.6.2
class Player():
> hand = []
>
>
Colin = Player()
Alex = Player()
Players = [Colin, Alex]
def hands():
> for player in Players:
>
I must be missing something simple. I have a list of lists data = "[[' 0',
' 0', '234.0', '24.0', ' 25'], [' 1', ' 0', '22428.0', '2378.1', '
25'],.." and what to make a record array from it but it gets screwed up
or I don't get it, maybe both. Notice that at this stage the items are
string
28 matches
Mail list logo