;t seem able to find where to get the noconflict module from.
Do any of you where noconflict could be downloaded/installed from ?
Thanks,
Ron.
P.S.: I use Windows XP/cygwin, Python 2.5.2, wx-2.8-msw-unicode
--
http://mail.python.org/mailman/listinfo/python-list
I'm trying to split a CamelCase string into its constituent components.
This kind of works:
>>> re.split('[a-z][A-Z]', 'fooBarBaz')
['fo', 'a', 'az']
but it consumes the boundary characters. To fix this I tried using
lookahead and lookbehind patterns instead, but it doesn't work:
>>> re.spli
In article ,
MRAB wrote:
> Ron Garret wrote:
> > I'm trying to split a CamelCase string into its constituent components.
> > This kind of works:
> >
> >>>> re.split('[a-z][A-Z]', 'fooBarBaz')
> > ['fo', 'a
In article ,
Peter Otten <__pete...@web.de> wrote:
> Ron Garret wrote:
>
> > I'm trying to split a CamelCase string into its constituent components.
>
> How about
>
> >>> re.compile("[A-Za-z][a-z]*").findall("fooBarBaz")
> [
In article ,
"andrew cooke" wrote:
> i wonder what fraction of people posting with "bug?" in their titles here
> actually find bugs?
IMHO it ought to be an invariant that len(r.split(s)) should always be
one more than len(r.findall(s)).
> anyway, how about:
>
> re.findall('[A-Z]?[a-z]*', 'fo
In article ,
Albert Hopkins wrote:
> On Thu, 2009-02-19 at 10:55 -0800, Ron Garret wrote:
> > I'm trying to split a CamelCase string into its constituent components.
> > This kind of works:
> >
> > >>> re.split('[a-z][A-Z]', 'fooBar
I'm writing a little wiki that I call µWiki. That's a lowercase Greek
mu at the beginning (it's pronounced micro-wiki). It's working, except
that I can't actually enter the name of the wiki into the wiki itself
because the default unicode encoding on my Python installation is
"ascii". So I'm
In article ,
MRAB wrote:
> Thorsten Kampe wrote:
> > * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800)
> >> I'm writing a little wiki that I call µWiki. That's a lowercase Greek
> >> mu at the beginning (it's pronounced micro-wiki).
> >
&g
I would have thought that the answer would be: the default encoding
(duh!) But empirically this appears not to be the case:
>>> unicode('\xb5')
Traceback (most recent call last):
File "", line 1, in
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb5 in position 0:
ordinal not in range(
In article <499f0cf0.8070...@v.loewis.de>,
"Martin v. Löwis" wrote:
> MRAB wrote:
> > Thorsten Kampe wrote:
> >> * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800)
> >>> I'm writing a little wiki that I call µWiki. That's a lowercase
>
In article <499f18bd$0$31879$9b4e6...@newsspool3.arcor-online.net>,
Stefan Behnel wrote:
> Ron Garret wrote:
> > I would have thought that the answer would be: the default encoding
> > (duh!) But empirically this appears not to be the case:
> >
> >>&g
In article <499f3a8f.9010...@v.loewis.de>,
"Martin v. Löwis" wrote:
> > u'\xb5'
> >> u'\xb5'
> > print u'\xb5'
> >> ?
> >
> > Unicode literals are *in the source file*, which can only have one
> > encoding (for a given source file).
> >
> >> (That last character shows up as a micron si
In article <499f397c.7030...@v.loewis.de>,
"Martin v. Löwis" wrote:
> > Yes, I know that. But every concrete representation of a unicode string
> > has to have an encoding associated with it, including unicode strings
> > produced by the Python parser when it parses the ascii string "u'\xb5'"
Hi Chris,
> -Original Message-
> From: ch...@rebertia.com [mailto:ch...@rebertia.com] On
> Behalf Of Chris Rebert
> Sent: Thursday, February 19, 2009 22:58
> To: Barak, Ron
> Cc: python-list@python.org; wxpython-us...@lists.wxwidgets.org
> Subject: Re: "metaclass
Hi Chris,
> -Original Message-
> From: Chris Rebert [mailto:c...@rebertia.com]
> Sent: Sunday, February 22, 2009 11:48
> To: Barak, Ron
> Cc: python-list@python.org; wxpython-us...@lists.wxwidgets.org
> Subject: Re: "metaclass conflict" error: where is noco
Hi Chris,
> -Original Message-
> From: ch...@rebertia.com [mailto:ch...@rebertia.com] On
> Behalf Of Chris Rebert
> Sent: Sunday, February 22, 2009 13:57
> To: Barak, Ron
> Cc: python-list@python.org
> Subject: Re: "metaclass conflict" error: where is noconf
e) capabilities to this ListControl
class.
I changed the header of this class to be:
class ListControl(wx.Frame, CopyAndPaste):
But, the addition of CopyAndPaste to the class parents got me into this
quagmire of metaclasses.
Bye,
Ron.
> -Original Message-
> From: Michele Simi
e a (non-strict)
subclass of the metaclasses of all its bases
So, obviously the line in blue is not to Python's liking.
Bye,
Ron.
> -Original Message-
> From: Hrvoje Niksic [mailto:hnik...@xemacs.org]
> Sent: Sunday, February 22, 2009 14:05
> To: python-list@python.org
&g
Hi Stef,
You can do something like (not tested):
try:
self.Brick.Par [ self.EP[2] ]['FileName'] = filename
except IndexError,e:
msg = "%s: '%s %s %s %d" %
(e.strerror,e.filename,self.EP,self.EP[2],len(self.Brick.Par))
print msg
> -Original Message-
> From: ch...@rebertia.com [mailto:ch...@rebertia.com] On
> Behalf Of Chris Rebert
> Sent: Sunday, February 22, 2009 22:12
> To: Barak, Ron
> Cc: python-list@python.org
> Subject: Re: Is there a way to ask a class what its metaclasses are ?
>
ction towards a solution.
Bye,
Ron.
$ cat -n metaclass_test01.py
1 #!/usr/bin/env python
2
3 import sys
4 import wx
5 import CopyAndPaste
6
7 #class ListControl(wx.Frame, CopyAndPaste):
8 class ListControl(wx.Frame):
on25/python.exe).
This means that pdb (and, for that matter any Python shell (like IDLE)) gets
stuck upon invocation.
I was wandering: is anybody able to use native Python on cygwin, or
alternately, to use Windows Python under cygwin in IDLE/pdb ?
Thanks,
Ron.
-Original Message-
From: D
Hello,
I have a very simple ini file that I needs parsed. What is the best way I can
parse an ini file that doesn't include sections?
As in:
person=tall
height=small
shoes=big
Thats it. Can anyone help me?
Thanks,
Ron--
http://mail.python.org/mailman/listinfo/python-list
the left and notes on the right.
Some future plans for MindTree include ReStructured Text editing, improved
text styling capabilities, Inclusion of structured text objects into
articles such as lists and tables and customizable HTML generation.
Thanks for you interest,
Ron Longo
--
View this
Hi John,
You may want to read http://nedbatchelder.com/text/python-parsers.html
Bye,
Ron.
-Original Message-
From: John Fabiani [mailto:jfabi...@yolo.com]
Sent: Tuesday, December 16, 2008 08:47
To: python-list@python.org
Subject: tutorial on parser
Hi,
I'm attempting to learn h
Hi Mr. Cain,
Mae culpa: obviously, I erroneously understood the number after the ':' as the
string length.
Thanks,
Ron.
-Original Message-
From: D'Arcy J.M. Cain [mailto:da...@druid.net]
Sent: Tuesday, December 16, 2008 15:45
To: Barak, Ron
Cc: python-list@python.org
Subj
print "|"+data[2:1]+"|"
$ python `cygpath -w /tmp/tmp.py`
F0023209006-0101
|F|
||
||
$
Thanks,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks to all who pointed my wrong understanding of how string slices are
defined.
Bye,
Ron.
From: Barak, Ron [mailto:ron.ba...@lsi.com]
Sent: Tuesday, December 16, 2008 15:35
To: python-list@python.org
Subject: String slices work only for first string character
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged, self.tree)
Bye,
Ron.
P.S.: I think you'd get better responses if you asked this question on
wxpython-us...@lists.wxwidgets.org<mailto:wxpython-us...@lists.wxwidgets.org>
From: Eric Atienza - e...
Instead, I get:
Could you tell me what I'm doing wrong (or point me to a URL that could set me
straight) ?
Thanks,
Ron.
$ cat LogManager_try.py
#!/usr/bin/env python
import gzip
import os
class LogStream():
"""
"""
def __init__
Hi Chris,
Thanks for the super fast reply.
I tried your fix (with a slight modification, namely, I changed your line to
be: line_ = generator.next())
And I got the printout I expected.
Many thanks,
Ron.
P.S.: My program looks like so, with your suggestion:
$ cat LogManager_try.py
#!/usr/bin
line 24.
Can you suggest how the generator could be changed, so it will allow me to get
the current location in the file after each yield ?
Thanks,
Ron.
$ cat -n generator.py # listing without line numbers is below
1 #!/usr/bin/env python
2
3 import gzip
4 from
Hi Gabriel,
Your remarks fixed my problem. Now my code looks as below, and behaves as
expected.
Thanks Gabriel.
Merry Christmas and Happy Hanukkah,
Ron.
$ cat generator.py
#!/usr/bin/env python
import gzip
from Debug import _line as line
class LogStream():
def __init__(self, filename
Hi Dennis,
print dir(os.system)
print os.__dict__
might help
Bye,
Ron.
From: Dennis van Oosterhout [mailto:de.slotenzwem...@gmail.com]
Sent: Thursday, December 25, 2008 12:22
To: python-list@python.org
Subject: os.system('cls')
Hi there! I was
0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Thanks,
Ron.
$ cat -n generator.py
1 #!/usr/bin/env python
2
3 import gzip
4 import sys
5 from Debug import _line as line
6
7 class LogStream():
Hi,
Problem solved when strip() is being replaced by strip('\n').
Happy holidays,
Ron.
From: Barak, Ron
Sent: Thursday, December 25, 2008 15:05
To: 'python-list@python.org'
Subject: seek() returns unexpected results
Hi,
When using seek()
I successfully installed MoinMoin as a CGI according to the instructions
on the moinmo.in site. But when I tried to switch over to running it
under wsgi it failed thusly:
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] Traceback (most
recent call last):
[Sat Dec 27 21:44:14 2008] [err
In article ,
Ron Garret wrote:
> I successfully installed MoinMoin as a CGI according to the instructions
> on the moinmo.in site. But when I tried to switch over to running it
> under wsgi it failed thusly:
>
> [Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2]
In article
,
Graham Dumpleton wrote:
> On Dec 28, 7:22 pm, Ron Garret wrote:
> > In article ,
> > Ron Garret wrote:
> >
> >
> >
> > > I successfully installed MoinMoin as a CGI according to the instructions
> > > on the moinmo.in s
So I have a MoinMoin installation running as a cgi and also under wsgi.
Since I was on a roll I decided to press my luck and try running it
under scgi. Following a suggestion in the following article:
http://www.linuxjournal.com/article/9310
I wrote this little server adapter:
from MoinMo
ll lines (ditto) ?
Thanks,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
Hi Tim,
Thanks for the solution (and effort), and for teaching me some interesting new
tricks.
Happy 2009!
Ron.
-Original Message-
From: Tim Chase [mailto:python.l...@tim.thechases.com]
Sent: Thursday, January 01, 2009 20:04
To: Sebastian Bassi
Cc: python-list@python.org
Subject: Re
ine_loc_and_contents
self.input_file.seek(-1, 2) # grab the last character
TypeError: seek() takes exactly 2 arguments (3 given)
When I run the below code.
I understand that the extra argument is the "self", but I don't know how to
change my class to make the seek(-1,2) work.
Co
Hi Mark,
I think my open_file() - that is called in __init__ - assures that
self.input_file is a regular text file,
regardless if filename is a gz or a regular text file.
My Python is Python 2.5.2.
Bye,
Ron.
-Original Message-
From: Mark Tolonen [mailto:metolone+gm...@gmail.com]
Sent
s may be a rather complete solution.
Bye,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
quot;
struct["Nebraska"]["Wabash"]["Newville"]["Math"]["Max Allowed Students"] = 20
struct["Nebraska"]["Wabash"]["Newville"]["Math"]["Current enrolled Students"] = 0
...
Have an easy Yom Kippur,
Ron.
-
anyone had this problem and how can I resolve it?
Thanks in advance.
--
Ron Reidy
--
http://mail.python.org/mailman/listinfo/python-list
m and how can I resolve it?
>>
>> Thanks in advance.
>>
>
> downloading and installing this package should fix the problem:
>
> http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en
>
--
Ron Reidy
--
http://mail.python.org/mailman/listinfo/python-list
13 ssp8400 kernel: Dump for [IB_FCP SEST] xxx=0x1592
And then go forward/backwards in the log and get data related to the error
message.
Thanks,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
her "wheels" already built that I could use and save me
"reinventing" them?
Namely, are there Python modules that could perform the above actions ?
Thanks,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
ead
self._read_gzip_header()
File "c:\Python25\lib\gzip.py", line 164, in _read_gzip_header
raise IOError, 'Not a gzipped file'
IOError: Not a gzipped file
Can you explain why the try...except in my code does not work ?
Or, back to my original problem: how do I deal
, line 19, in read1
print fl.read()
File "c:\Python25\lib\gzip.py", line 220, in read
self._read(readsize)
File "c:\Python25\lib\gzip.py", line 263, in _read
self._read_gzip_header()
File "c:\Python25\lib\gzip.py", line 164, in _read_gzip_header
raise
Thanks Gabriel,
Okay, I get it: I was under the impression that the format check would be done
on the open.
Bye,
Ron.
-Original Message-
From: Gabriel Genellina [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2008 02:06
To: python-list@python.org
Subject: Re: Why is try...except
Paste
6
7 class ListControl(wx.Frame, CopyAndPaste.CopyAndPaste):
I'm getting no more Metaclass conflict TypeError exceptions :-)
(a clear case of "The Devil Is In The ...")
Thanks so much,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
Maybe try:
p = Popen('./iodummy',stdin=PIPE, stdout=PIPE, stderr=PIPE).p
(see "18.1.3.4. Replacing the os.spawn family" in
http://docs.python.org/library/subprocess.html)
Bye,
Ron.
> -Original Message-
> From: Rüdiger Ranft [mailto:_r...@web.de]
> Sent
'
Can anyone suggest what is the correct way to implement P_NOWAIT and still be
able to communicate with the child process ?
(Or, is there a way to create a subprocess.Popen object from what I assume is
the process handle integer ?)
Thanks,
Ron.
The numbering of the scripts' lines:
Hi,
I need to read the end of a 20 MB gzip archives (To extract the date from the
last line of a a gzipped log file).
The solution I have below takes noticeable time to reach the end of the gzip
archive.
Does anyone have a faster solution to read the last line of a gzip archive ?
Thanks,
Ron
> -Original Message-
> From: MRAB [mailto:goo...@mrabarnett.plus.com]
> Sent: Thursday, May 21, 2009 19:02
> To: 'python-list@python.org'
> Subject: Re: A fast way to read last line of gzip archive ?
>
> Barak, Ron wrote:
> > Hi,
> >
ouble-left-click) and create functions/class-instances that would perform the
needed actions.
I'd suggest reading "wxPython in Action" (ISBN 1-932394-62-1) as it would give
you most of the answers you seek.
Bye,
Ron.
> -Original Message-
> From: rzzzwil...
> -Original Message-
> From: garabik-news-2005...@kassiopeia.juls.savba.sk
> [mailto:garabik-news-2005...@kassiopeia.juls.savba.sk]
> Sent: Sunday, May 24, 2009 13:37
> To: python-list@python.org
> Subject: Re: A fast way to read last line of gzip archive ?
>
acceptable to (human) users.
Bye,
Ron.
> -Original Message-
> From: David Bolen [mailto:db3l@gmail.com]
> Sent: Monday, May 25, 2009 01:58
> To: python-list@python.org
> Subject: Re: A fast way to read last line of gzip archive ?
>
> "Barak, Ron" wr
l(None, -1),2)
Any ideas what could be changed to let me pickle the class ?
Thanks,
Ron.
$ cat -n pickle_test.py
1 #!/usr/bin/env python
2
3 #import pickle
4 import cPickle as pickle
5 import wx
6
7 class ListControl(wx.Frame):
8
9 def
Hi David,
Thanks for the below solutions: most illuminating.
I implemented your previous message suggestions, and already the processing
time (on my datasets) is within acceptable human times.
I'll try your suggestion below.
Thanks again.
Ron.
> -Original Message-
> From:
I'm trying to build PyObjC on an Intel Mac running OS X 10.5.7. The
build is breaking because distutils seems to want to build extension
modules as universal binaries, but some of the libraries it depends on
are built for intel-only, i.e.:
[...@mickey:~/Desktop/pyobjc-framework-ScreenSaver-2.2
Python 2.6.2 on OS X 10.5.7:
[...@mickey:~]$ echo $LANG
en_US.UTF-8
[...@mickey:~]$ cat frob.py
#!/usr/bin/env python
print u'\u03BB'
[...@mickey:~]$ ./frob.py
ª
[...@mickey:~]$ ./frob.py > foo
Traceback (most recent call last):
File "./frob.py", line 2, in
print u'\u03BB'
UnicodeEncodeE
In article ,
Lawrence D'Oliveiro wrote:
> In message , Ron
> Garret wrote:
>
> > Python 2.6.2 on OS X 10.5.7:
>
> Same result, Python 2.6.1-3 on Debian Unstable. My $LANG is en_NZ.UTF-8.
>
> > ... I always thought one of the fundamental
> > invaria
I'm writing a little HTTP server and need to parse request content that
is mime-encoded. All the MIME routines in the Python standard library
seem to have been subsumed into the email package, which makes this
operation a little awkward. It seems I have to do the following:
1. Extract the co
In article
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> On Jul 3, 3:59 pm, Ron Garret <[EMAIL PROTECTED]> wrote:
> > I'm writing a little HTTP server and need to parse request content that
> > is mime-encoded. All the MIME routines in the Python standa
In article <[EMAIL PROTECTED]>,
Michael Ströder <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I'm writing a little HTTP server and need to parse request content that
> > is mime-encoded. All the MIME routines in the Python standard library
> > see
In article <[EMAIL PROTECTED]>,
Ron Garret <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Michael Ströder <[EMAIL PROTECTED]> wrote:
>
> > Ron Garret wrote:
> > > I'm writing a little HTTP server and need to parse reque
In article <[EMAIL PROTECTED]>,
Michael Ströder <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > Ron Garret <[EMAIL PROTECTED]> wrote:
> >
> >> In article <[EMAIL PROTECTED]>,
> >> M
sers can think of.
If you're interested in more information or trying out this app (note that it's
very immature and probably only worthy of being called an alpa) please don't
hesitate to contact me.
Thanks for reading,
Ron--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> Ron Eggler schrieb:
>> Hi,
>>
>> I would like to get the time of the most recent human activity like a
>> cursor movement or a key hit.
>> Does anyone know how I can get this back to start some action after there
>> has been no a
points 'p'. Which I wish to use to provided information
back to the user.
Thanks,
Ron--
http://mail.python.org/mailman/listinfo/python-list
ove according to display lines rather
than Paragraphs.
This widget can be found here http://tkinter.unpythonic.net/wiki/EnhancedText.
Thanks for any comments, bug reports, etc.
Ron Longo--
http://mail.python.org/mailman/listinfo/python-list
John,
This is very interesting! Please do make this available. I love
PythonCard, but I am doing mainly web programming these days.
I will mention this on my next podcast. Can you do a slider?
Ron Stephens
Python411 www.awaretek.com/python/index.html
--
http://mail.python.org/mailman/listinfo
Hello,
I am trying to parse a log file. I want to sort based on the second element
the list that is in the file.
What is the best way to do this? The sort is just on the line itself where
I want to re-organize the lines based on the second element of the csv file
Thanks,
Ron
--
http
Hello,
How would I create a dictionary that contains multiple values for one key.
I'd also like the key to be able to have duplicate entries.
Thanks,
Ron
--
FYI, my email address is changing. My rogers account will be deactivated
shortly. From now on please use:
[EMAIL PROTECTED]
--
I have another question.
How would like to be able to add the contents on the values for one key.
key['20001']:[978, 345]
How can I do this?
Thanks,
Ron
On Thu, Aug 28, 2008 at 11:56 AM, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> norseman a écrit :
>
hello,
I am trying to find the amount of values there are pertaining to one key.
For example:
- To find the average of the values pertaining to the key.
- Use the amount of values to calculate a histogram
Also, how do reference a specific value for a key in a multipart?
Thanks,
Ron
--
FYI
uot; or "license" for more information.
>>>
Has anyone else gotten this error ?
Could anyone suggest a solution ?
Thanks,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
ges\py2exe\mf.py", line 204, in
find_head_package
raise ImportError, "No module named " + qname
ImportError: No module named zipextimporter
My Setup.py (produced by GUI2Exe) is attached.
Note that I set compressed to 0 in Setup.py (options = {"py2exe":
{"compress
Hello,
I am trying to parse a shared config file which doesn't contail section
headers. Is there a way I can still use ConfigParser()? If not what is a
widely used parser available?
Thanks,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
CTypes on a 64-bit machine appears to be truncating pointers to 32 bits:
[EMAIL PROTECTED]:~]$ uname -a
Linux monster1 2.6.18-6-amd64 #1 SMP Mon Jun 16 22:30:01 UTC 2008 x86_64
GNU/Linux
[EMAIL PROTECTED]:~]$ cat foo.c
void* foo(void* x) { return x; }
[EMAIL PROTECTED]:~]$ gcc -fPIC -shared foo.c
In article <[EMAIL PROTECTED]>,
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> foolib = cdll.LoadLibrary('foo.so')
> foolib.foo(0xF)
> > 0
>
> Shouldn't you tell ctypes that the argument and the result
> of foo is a pointer?
Yeah... that's it. Default return type is int, whic
5 567 898
Can anyone see the errors of my ways?
Thanks,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
In GUI2exe, I'd like to create a project that is different from an existing
project only in a few details (e.g., the location of the 'dist' directory).
Is there a way to copy a current project - so it would serve as a basis for a
new project ?
Bye,
Ron.
--
http://mail.pyt
Fredrik Lundh wrote:
> Tim Parkin wrote:
>> Also 'Foundation' could be confused with 'beginners' or 'basic'.
>
> while "PSF" is completely incomprehensible for someone who doesn't
> already know what it is... why even keep it on the front page ?
Looks like a good place for a tool tip, PSF is o
Fredrik Lundh wrote:
> Ron Adam wrote:
>
>> I think the PSF is important enough to have a link on *every* page. It
>> doesn't need a lot of space, but it should be easy to get to from
>> anywhere on the web site.
>
> a copyright blurb at the bottom of the page
f cheese".
Now if you want silliness, then the correct establishment for that is
"The Ministry of Silly Walks". ;)
Ron
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> Hi
>
> I wonder if Python is capable of the following: define a function which
> returns its argument.
> I mean:
> def magic_function(arg):
> .. some magic code ...
>
> that behaves the following way:
>
> assert magic_funct
o clean a lot of it up. I
> wonder if there is a reformatter/pretty printer that like perl tidy
> that might help. I see i have tabnanny, but that only complains... i
> want something that fixes automagically.
>
> -kp8--
What you're looking for is in "Python24/Tools/Scripts"
eld
'hello'
>>> g.next()
after yield
before yield
'hello'
When the next() method is called the generator runs until it reaches a
yield. At which point it's rests until the next() method is called again.
Although there are times when I wish it could run (as a
t;>> g.next()
'hello'
>>> g.next()
all done
Traceback (most recent call last):
File "", line 1, in ?
StopIteration
This is the signal to indicate iteration is finished. You don't see it
when you are using generators as iterators because it's usu
Hmm. I know, I
> know, why am I sending it a 01,02, or a 010 to begin with? Like I
> said, it was an accident, but now i'm curious. I'm not a computer
> science major so please be kind with any explanations.
Number beginning with the digit '0' are octal (base 8
rue: "go ahead", False: "stop"}
answer = answers[a == "yes"]
This is also sometimes useful when you want to alternate between two values.
values = {'a':'b', 'b':'a'} # define outside loop
while 1:
v = valu
].append(1)
>>>> x
> [[0, 1], [0, 1], [0, 1]]
>
> Is there a simple way to create a list of independent lists?
Try this...
x, y, value = 3, 3, 0
L = [[value]*x for i in xrange(y)]
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
= set([4,5,6,7,8,9])
>>> s.intersection(t)
set([4, 5, 6])
>>> len(s.intersection(t))
3
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Per wrote:
> Thanks Ron,
> surely set is the simplest way to understand the question, to see
> whether there is a non-empty intersection. But I did the following
> thing in a silly way, still not sure whether it is going to be linear
> time.
> def foo():
> l = [...]
>
".
If it's hard to read and understand, then that can and should be fixed.
It probably should be moved to a position before the library reference
manual and after the tutorial. Looking over the language reference
manual will help in understanding the library reference manual I think.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
601 - 700 of 772 matches
Mail list logo