Another advantage is that you can catch all the unhandled exceptions of
the entire program (it they occurs) by doing something like this:
def another_call():
raise SomeUnexpectedException # it will be catched in '__main__'
def call():
another_call()
def run():
call()
in __name__ =
Tim Chase wrote:
> > I have a list AAA = [1, 2, 3] and would like to subtract one from list
> > AAA
> > so AAA' = [0, 1, 2]
> >
> > What should I do?
>
>
> Sounds like a list comprehension to me:
Also the built in function 'map' would work:
>>> a = [1,2,3]
>>> b = map(lambda x: x-1, a)
>>> b
[0,
Ben Finney schrieb:
> Leif K-Brooks <[EMAIL PROTECTED]> writes:
>
Ben Finney wrote:
> So long as you're not distributing some or all of Python itself,
> or a derivative work, the license for Python has no legal effect
> on what license you choose for your own work.
>
>> I was rep
>>
>> I think '__metaclass__ = whatever' affects only the creation of
>> classes that
>> would otherwise be old-style classes?
>
> Wrong.
>
> If you set __metaclass__ = type, every class in that module will be
> new-style.
>
> If you set __metaclass__ = MyClass, and MyClass inherits from , eve
>>> __metaclass__ = whatever
>>>
>>> at the top of each module whose classes are to get the new behavior.
>>
>> I think '__metaclass__ = whatever' affects only the creation of classes
>> that would otherwise be old-style classes?
>
> Wrong.
>
> If you set __metaclass__ = type, every class in th
Diez B. Roggisch wrote:
>>>
>>> I think '__metaclass__ = whatever' affects only the creation of
>>> classes that
>>> would otherwise be old-style classes?
>>
>> Wrong.
>>
>> If you set __metaclass__ = type, every class in that module will be
>> new-style.
>>
>> If you set __metaclass__ = MyCla
> > SQLAlchemy looks pretty good, but unfortunately apparently requires
> > shell access for installation (or at least, I have not found any other
> > solution covered in the docs), which I can not use.
>
> It doesn't use binaries AFAIK, so just copying should work as well.
Indeed, from browsing t
Trying to load a C++ module that is wrapped with boost_python and get
the error
ImportError: Don't know how to import XYZ (type code 3)
I think type code 3 is means that it is a C++ wrapped .pyd.
I have know idea what that means or how to fix it.
Any ideas?
D.
--
http://mail.python.org/m
Fredrik Lundh wrote:
> this article
>
> http://effbot.org/zone/python-objects.htm
>
> may be useful for those who haven't already seen it.
I don't know how many times I've referred to, or paraphrased,
that article. Shouldn't it be incorporated into the standard
tutorial? I think it's very he
Hello, folks!
Script I am creating has to format a device - USB flash drive. I have
tried using regular DOS "format" through "os.system" - did not work
well, because DOS format requires input from user. And the script
should run without user interference.
I have taken a look at ActivePython "win32.
Magnus Lycka schrieb:
> > http://effbot.org/zone/python-objects.htm
> > may be useful for those who haven't already seen it.
>
>Shouldn't it be incorporated into the standard tutorial?
>I think it's very helpful for people who are used
> to the way C etc handles variables.
That would also be
On 9/19/06, Magnus Lycka <[EMAIL PROTECTED]> wrote:
> Fredrik Lundh wrote:
> > this article
> >
> > http://effbot.org/zone/python-objects.htm
> >
> > may be useful for those who haven't already seen it.
>
> I don't know how many times I've referred to, or paraphrased,
> that article. Shouldn't
this may help, you need ctypes module.
##
from ctypes import *
fm = windll.LoadLibrary('fmifs.dll')
def myFmtCallback(command, modifier, arg):
print command
return 1# TRUE
FMT_CB_FUNC = WINFUNCTYPE(c_int, c_int, c_int, c_void_p)
FMIFS_HARDDISK = 0x0C
fm
Diez B. Roggisch wrote:
> Ben Finney schrieb:
> Ben Finney wrote:
> > So long as you're not distributing some or all of Python itself,
> > or a derivative work, the license for Python has no legal effect
> > on what license you choose for your own work.
> >
[SNIP]
> > My claim (and
[EMAIL PROTECTED] wrote:
> Others have already told you the most important things.
>
> There is another secondary advantage: the code inside a function runs
> faster (something related is true for C programs too). Usually this
> isn't important, but for certain programs they can go 20%+ faster.
On 9/19/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
> I totally fail to see why that should be the case - for python as well as
> for C.
If you put your code into a main() function, all the names that it
binds are in the function's local scope, whereas if the code is in the
module's top level
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
> Ben Finney schrieb:
> > My claim (and IANAL) is that it doesn't matter *what* license
> > Python is distributed under; unless you do something with Python
> > that is a right of the copyright holder, such as distributing part
> > or all of Python, t
"Diez B. Roggisch" wrote:
>> There is another secondary advantage: the code inside a function runs
>> faster (something related is true for C programs too). Usually this
>> isn't important, but for certain programs they can go 20%+ faster.
>
> I totally fail to see why that should be the case - fo
Diez B. Roggisch wrote:
> [EMAIL PROTECTED] wrote:
>
>> Others have already told you the most important things.
>>
>> There is another secondary advantage: the code inside a function runs
>> faster (something related is true for C programs too). Usually this
>> isn't important, but for certain p
Hi,
I need to write a software that allow to see the desktop and hear the
microphone capture of a remote PC across a network. I need to do that
for a unviresity assignement. The software must run on Windows. Since
I like Python very much I am thinking to write that software in
Python. Do you thin
weir wrote:
> this may help, you need ctypes module.
>
> ##
> from ctypes import *
>
> fm = windll.LoadLibrary('fmifs.dll')
>
> def myFmtCallback(command, modifier, arg):
> print command
> return 1 # TRUE
>
> FMT_CB_FUNC = WINFUNCTYPE(c_int, c_int, c_int, c_voi
Hi there,
I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise
Server 10) on an AMD Opteron 64-Bit machine.
I have to use Python 2.3.5.
Do I need a special source archive or can I use "Python-2.3.5.tgz" from
http://www.python.org/ftp/python/2.3.5/Python-2.3.5.tgz ?
Is there
Hi,
I would like to compile an AST to bytecode, so I can eval it later. I
tried using parse.compileast, but it fails:
>>> import compiler, parser
>>> ast = compiler.parse("42")
>>> parser.compileast(ast)
Traceback (most recent call last):
File "", line 1, in ?
TypeError: compilest() argument 1
Nico Grubert wrote:
> Is there anything special I have to care about or is installing Python
> on a 64 Bit OS just as easy as installing it on a 32-Bit OS?
It is as easy. Look around, you'll probably find a pre-built binary
package for your OS.
--
http://mail.python.org/mailman/listinfo/python
On 2006-09-18, Calvin Spealman <[EMAIL PROTECTED]> wrote:
> Just once, I would like to see a programming contest that was
> judged on the quality of your code, not the number of bytes you
> managed to incomprehensively hack it down to.
Check out the ICFP Functional Programming Contest. Most of the
Ant wrote:
> Tim Chase wrote:
>
>>>I have a list AAA = [1, 2, 3] and would like to subtract one from list
>>>AAA
>>>so AAA' = [0, 1, 2]
>>>
>>>What should I do?
>>
>>
>>Sounds like a list comprehension to me:
>
>
> Also the built in function 'map' would work:
>
>
a = [1,2,3]
b = map(la
Steve Holden wrote:
> And statements like that are probably going to annoy me ;-)
>
> >>> t = timeit.Timer("b = map(lambda x: x-1, a)", setup="a=[1,2,3]")
> >>> t.timeit()
> 2.4686168214116599
> >>> t = timeit.Timer("b = [x-1 for x in a]", setup="a=[1,2,3]")
> >>> t.timeit()
> 0.99302453244756
Fredrik Lundh wrote:
> Steve Holden wrote:
>
>
>>And statements like that are probably going to annoy me ;-)
>>
>> >>> t = timeit.Timer("b = map(lambda x: x-1, a)", setup="a=[1,2,3]")
>> >>> t.timeit()
>>2.4686168214116599
>> >>> t = timeit.Timer("b = [x-1 for x in a]", setup="a=[1,2,3]")
>> >>>
It's been nearly 20 months since the last major release
of Python (2.4), and 5 months since the first alpha
release of this cycle, so I'm absolutely thrilled to be
able to say:
On behalf of the Python development team
and the Python community, I'm happy to
announce the FINAL release of
Nico Grubert wrote:
> Hi there,
>
> I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise
> Server 10) on an AMD Opteron 64-Bit machine.
> I have to use Python 2.3.5.
>
> Do I need a special source archive or can I use "Python-2.3.5.tgz" from
> http://www.python.org/ftp/python
"Rob De Almeida" <[EMAIL PROTECTED]> wrote:
> I would like to compile an AST to bytecode, so I can eval it later. I
> tried using parse.compileast, but it fails:
>
import compiler, parser
ast = compiler.parse("42")
parser.compileast(ast)
> Traceback (most recent call last):
> Fil
Steve Holden wrote:
> Nico Grubert wrote:
>
>>Hi there,
>>
>>I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise
>>Server 10) on an AMD Opteron 64-Bit machine.
>>I have to use Python 2.3.5.
>>
>>Do I need a special source archive or can I use "Python-2.3.5.tgz" from
>>http://
> More recent versions of Python have incorporated much more support for
> 64-bit architectures. 2.5 is about to be released (I believe it should
> be out in the next 24 hours), and I'd recommend that over the older
> version you are considering.
If by "24 hours" you mean "20 minutes ago", this is
Steve Holden wrote:
> Fredrik Lundh wrote:
> > Steve Holden wrote:
> >
...
> """if performance is *really* important, you
> need to benchmark both options"""
Fair point.
--
http://mail.python.org/mailman/listinfo/python-list
Nico Grubert wrote:
> I'd like to install Python 2.3.5. on a 64-Bit OS (Suse Linux Enterprise
> Server 10) on an AMD Opteron 64-Bit machine.
> I have to use Python 2.3.5.
>
> Do I need a special source archive or can I use "Python-2.3.5.tgz" from
> http://www.python.org/ftp/python/2.3.5/Python-2
OK, it worked. Obviosly, quick format was a bad choice.
Thanks a lot for your help!
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On 18 Sep 2006 15:43:31 -0700, Daniel Mark <[EMAIL PROTECTED]> wrote:
> Hello all:
>
> I have a list AAA = [1, 2, 3] and would like to subtract one from list
> AAA
> so AAA' = [0, 1, 2]
You've had some excellent suggestions as to how to go about this
assuming that by "efficient" you mean in terms
Duncan Booth wrote:
> > I would like to compile an AST to bytecode, so I can eval it later.
> I'm not sure there are any properly documented functions for converting an
> AST to a code object, so your best bet may be to examine what a
> pycodegen class like Expression or Module actually does.
Than
Hi, I'm new in Python and I'm learning with "Learning Python" oreilly's
book which is very good written and explanatory.
Now, that I know a bit of Python, I want to make some simple project, I
thought something like a menu, just like "kxdocks" menu or something
like that, with transparency and all
Anthony Baxter wrote:
>>More recent versions of Python have incorporated much more support for
>>64-bit architectures. 2.5 is about to be released (I believe it should
>>be out in the next 24 hours), and I'd recommend that over the older
>>version you are considering.
>
>
> If by "24 hours" you m
Hi,
I have a testservice.py (see below). I installed the Windows-Service
successfully. (via commandlineoption install)
The problem is that it runs only when it is in c:\windows\system32 or in
the python path.
I added the desired path (Y:\) to the PYTHONPATH environment variable
for the system acco
Ilias Lazaridis wrote:
> I understand that I can use __metaclass__ to create a class which
> modifies the behaviour of another class.
>
> How can I add this metaclass to *all* classes in the system?
>
> (In ruby I would alter the "Class" class)
I got confused from the discussion about __metaclass_
Hi all. Just curious, before I do it myself, about the best way to
install 2.5 if it's the only version I want to use. Should I uninstall
2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install
2.5, does that mean I need to reinstall all the extensions I had for 2.4
again, or does
Hi everybody, i` m new in this group, and python so.., my greetings to
everybody here.
I wrote a little program, in wich i do this:
(I have several "Select File" buttons, one for each file (in this case,
an image) wich has an text_entry, so i can add a comment for each
picture.)
def on_button1_cli
John Salerno wrote:
> Hi all. Just curious, before I do it myself, about the best way to
> install 2.5 if it's the only version I want to use. Should I uninstall
> 2.4 first?
if you don't plan to use it anymore, yes.
> Does 2.5 replace 2.4?
no.
> I doubt the latter, but if I install 2.5, does
Ilias Lazaridis wrote:
> Ilias Lazaridis wrote:
>> I understand that I can use __metaclass__ to create a class which
>> modifies the behaviour of another class.
>>
>> How can I add this metaclass to *all* classes in the system?
>>
>> (In ruby I would alter the "Class" class)
>
> I got confused fr
John Salerno wrote:
> Hi all. Just curious, before I do it myself, about the best way to
> install 2.5 if it's the only version I want to use. Should I uninstall
> 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install
> 2.5, does that mean I need to reinstall all the extensions I h
Diez B. Roggisch wrote:
> John Salerno wrote:
>
>> Hi all. Just curious, before I do it myself, about the best way to
>> install 2.5 if it's the only version I want to use. Should I uninstall
>> 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install
>> 2.5, does that mean I need to
Fredrik Lundh wrote:
> "Diez B. Roggisch" wrote:
>
>>> There is another secondary advantage: the code inside a function runs
>>> faster (something related is true for C programs too). Usually this
>>> isn't important, but for certain programs they can go 20%+ faster.
>>
>> I totally fail to see w
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
> > Python stores local variables in an indexed array, but globals in a
> > dictionary. Looking things up by index is faster than looking them up by
> > name.
>
> Interesting. How is the index computed? I would have assumed that locals()
> is somehow
Pipiten wrote:
> Hi everybody, i` m new in this group, and python so.., my greetings to
> everybody here.
> I wrote a little program, in wich i do this:
> (I have several "Select File" buttons, one for each file (in this case,
> an image) wich has an text_entry, so i can add a comment for each
> p
In <[EMAIL PROTECTED]>, Paul Rubin wrote:
> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>> > Python stores local variables in an indexed array, but globals in a
>> > dictionary. Looking things up by index is faster than looking them up by
>> > name.
>>
>> Interesting. How is the index computed
Diez B. Roggisch wrote:
> Interesting. How is the index computed? I would have assumed that locals()
> is somehow used, which is a dicht.
>
> I can imagine enumerating left-hand-side names and trying to replace their
> occurence with the index, falling back to the name if that is not
> possible/t
On Tue, Sep 19, 2006 at 09:46:13PM +1000, Ben Finney wrote:
> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>
> > Ben Finney schrieb:
> > > My claim (and IANAL) is that it doesn't matter *what* license
> > > Python is distributed under; unless you do something with Python
> > > that is a right of
Hello all,
I recently ran across a situation in which sax.saxutils.quoteattr did not
work as I expected. I am writing Leo outlines as opml files
http://en.wikipedia.org/wiki/OPML
which forces me to write python code in xml attributes rather than xml
elements (as is done in .leo files).
The pro
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
>> I think I read a suggestion somewhere to wrap the code where a Python
>> script starts in a main() function, so one has
>>
>> def main():
>> print "hi"
>>
>> main()
>>
>> instead of
>>
>> print "hi"
>>
>> What are the advantages of doing this?
>
Gregor Horvath wrote:
> Hi,
>
> I have a testservice.py (see below). I installed the Windows-Service
> successfully. (via commandlineoption install)
> The problem is that it runs only when it is in c:\windows\system32 or in
> the python path.
> I added the desired path (Y:\) to the PYTHONPATH envi
Rob De Almeida wrote:
> Duncan Booth wrote:
> > > I would like to compile an AST to bytecode, so I can eval it later.
> > I'm not sure there are any properly documented functions for converting an
> > AST to a code object, so your best bet may be to examine what a
> > pycodegen class like Expressio
Ilias Lazaridis wrote:
> How do I do this?
It's easy:
def writeDebug(msg):
print "I do not debug things, I _evaluate_ with professionals on the
industries! See ticket 547!\n" \
"Oh yeah, and %s" % msg
...
class Foo:
writeDebug("how can I configure the interpreter for understand
Klingo
[EMAIL PROTECTED] wrote:
> I'm attempting to write a faily simple threaded app that fires off a
> thread to select() on a FIFO while the main loop handles data read from
> that pipe and a few other tasks. For some reason, calls to
> time.sleep() seem to block until the first time data is dumped i
Hi All,
Pydev and Pydev Extensions 1.2.3 have been released
Details on Pydev Extensions: http://www.fabioz.com/pydev
Details on Pydev: http://pydev.sf.net
Details on its development: http://pydev.blogspot.com
Release Highlights in Pydev Extensions:
--
John Salerno wrote:
> Diez B. Roggisch wrote:
> > John Salerno wrote:
> >
> >> Hi all. Just curious, before I do it myself, about the best way to
> >> install 2.5 if it's the only version I want to use. Should I uninstall
> >> 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install
>
Edward K. Ream wrote:
> - Does anyone know whether this is guaranteed to be a general solution? That
> is, are sax parsers *obliged* to ignore newlines in attributes?
http://www.w3.org/TR/REC-xml/#AVNormalize
> - If sax parsers are indeed obliged to ignore newlines in attributes, would
>
> PyGame is in it, right?
Python comes with a basic GUI toolkit called Tk with basic stuff such
as buttons, text and graphics widgets, menus, etc.
PyGame is a seperate package that you can download that makes it fairly
easy to create games. There are also additional libraries that make
PyGame pro
Diez B. Roggisch wrote:
> Ilias Lazaridis wrote:
> > Ilias Lazaridis wrote:
> >> I understand that I can use __metaclass__ to create a class which
> >> modifies the behaviour of another class.
> >>
> >> How can I add this metaclass to *all* classes in the system?
> >>
> >> (In ruby I would alter th
MonkeeSage wrote:
> Ilias Lazaridis wrote:
> > How do I do this?
>
> It's easy:
>
> def writeDebug(msg):
> print "I do not debug things, I _evaluate_ with professionals on the
> industries! See ticket 547!\n" \
> "Oh yeah, and %s" % msg
where do I place this function...
> ...
> class F
If you're going to need win32 system access use the win32all python
extension (very, very good extension). Do you need single frame image
capture, or constant video stream? PIL can be used for the first, it
might also be usable for video, I'm not sure. For sound, python comes
with some built in li
We are pleased to announce version 1.4.3 of our software tools
including: PMV, ADT and VISION.
Binary (LINUX, Mac OS X and Windows) and Source distributions can be
downloaded from:
http://mgltools.scripps.edu/downloads
NEW FEATURES:
--
PMV:
- added support for renderin
Hi,
I want to integrate into an GUI a activeX component that generate
some events.
What i have done is :
- Create the activeX component ( DispatchWithEvents method )
- create the GUI
- app.mainloop()
My pb is that i don't know how to take into account the events
generated by the activeX co
Hi,
I have some simple code - which works...kind of..here's the code:
[code]
import os
def print_tree(start_dir):
for f in os.listdir(start_dir):
fp = os.path.join(start_dir, f)
print fp
if os.path.isfile(fp): # will return false if use f here!
if os.path.
Thanks, Fredrik, for the reference to the attribute normalization algorithm.
> I guess it's too late to fix OPML.
It's too late for OPML 1. I'll check with Dave Winer about OPML 2.
Edward
Edward K. Ream email: [EMAIL PROTEC
dutche wrote:
> Now, that I know a bit of Python, I want to make some simple project, I
> thought something like a menu, just like "kxdocks" menu or something
> like that, with transparency and all with xml. But I dont know what
> things I have to know.
>
Start with some simple non-gui apps firs
Larry Bates schrieb:
> I believe that your problem is that services run under Local
> System account. Normally Local System account would not have
> a drive mapping Y:\. You can change the account that a service
You are absolutly correct.
I moved the script to a local drive instead of a mapped
Ilias Lazaridis wrote:
> where do I place this function...
The place where you want it to be.
> ...thus it becomes available within class "Foo" and all other Classes?
Anything defined in the top-level (i.e., the sys.modules['__main__']
namespace) is accessible in every scope...but I assume you a
codefire wrote:
> As above it all works as expected. However, on the marked line, if I
> use f instead of fp then that condition returns false! Surely,
> isfile(f) should return true, even if I just give a filename, rather
> than the full path?
try printing both "f" and "fp", and see if you can
Dear Tony,
You're not in that directory (start_dir) when the isfile() function is
called. See function os.path.curdir() and os.chdir(). Also, you may be
confusing the behavior of os.path.walk(), in which the function called will
happen once you have been chdired to the directory it is examining.
codefire wrote:
> Hi,
>
> I have some simple code - which works...kind of..here's the code:
>
> [code]
> import os
>
> def print_tree(start_dir):
> for f in os.listdir(start_dir):
> fp = os.path.join(start_dir, f)
> print fp
> if os.path.isfile(fp): # will return fal
codefire wrote:
> As above it all works as expected. However, on the marked line, if I
> use f instead of fp then that condition returns false! Surely,
> isfile(f) should return true, even if I just give a filename, rather
> than the full path?
Hi Tony,
Actually the file is in a different directo
> [code]
> import os
>
> def print_tree(start_dir):
> for f in os.listdir(start_dir):
> fp = os.path.join(start_dir, f)
> print fp
> if os.path.isfile(fp): # will return false if use f here!
> if os.path.splitext(fp)[1] == '.html':
>
Ah of course, isfile(f) can only return true if it can find f! :)
I'm going to investigate those other functions too :)
Thanks a lot guys!
Tony
--
http://mail.python.org/mailman/listinfo/python-list
I'm reading the "What's New" section of the 2.5 docs, and I'm a little
confused by the last section of "Absolute and Relative Imports":
---
For example, code in the A.B.C module can do:
from . import D # Imports A.B.D
from .. import E
John Machin wrote:
> I'd suggest that you uninstall 2.4 later if at all. Ensure that you
> have got all the extensions you want/need for 2.5 before you burn your
> boats. As Diez says in effect, there is no guarantee that any
> particular extension is available for 2.5 on Windows right now.
>
Tha
Ilias Lazaridis wrote:
> MonkeeSage wrote:
>
>>Ilias Lazaridis wrote:
>>
>>>How do I do this?
>>
>>It's easy:
>>
>>def writeDebug(msg):
>> print "I do not debug things, I _evaluate_ with professionals on the
>>industries! See ticket 547!\n" \
>>"Oh yeah, and %s" % msg
>
>
> where do I p
John Salerno wrote:
> I'm reading the "What's New" section of the 2.5 docs, and I'm a little
> confused by the last section of "Absolute and Relative Imports":
>
> ---
> For example, code in the A.B.C module can do:
>
> from . import D
"Seymour" <[EMAIL PROTECTED]> writes:
> Somehow I had the notion that Mechanize was a Pearl script.
mechanize the Python module started as a port of Andy Lester's Perl
module WWW::Mechanize (in turn based on Gisle Aas' libwww-perl), and
on some very high level has "the same" conceptual interface,
Running my Verilog parser tests, I get a 5-10% slowdown with Python 2.5 vs.
Python 2.4.1 (See http://pyparsing.wikispaces.com/News.)
I apologize for not running performance tests sooner, I only ran regression
tests on the release candidates, and those were all okay.
I'll look through the "What'
Nico Grubert schrieb:
> Is there anything special I have to care about or is installing Python
> on a 64 Bit OS just as easy as installing it on a 32-Bit OS?
Despite what everybody else said: most likely, special care is
necessary. However, nobody probably knows what precisely you need
to be aware
"Seymour" <[EMAIL PROTECTED]> writes:
[...]
> one program, MaxQ, that records web surfing. It seems to work great.
[...]
There are lots of such programs about (ISTR twill used to use MaxQ for
its recording feature, but I think Titus got rid of it in favour of
his own code, for some reason). How
Robert Kern wrote:
> What is ambiguous about A.B.D, A.E, and A.F.G? But if you like:
I guess maybe I was looking at it backwards. From the way it was worded,
I thought the only information we had to use was the structure A.B.C,
and then given a statement like:
from . import D
we just had to f
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear lovely moderator, please allow me to spread this information,
> somebody might need it, please forgive me if you are bothered
>
> Dear All, this might be useful for you and your family
>
Does it also predict earthquakes?
For yo
Forgive my excitement, especially if you are already aware of this, but
this seems like the kind of feature that is easily overlooked (yet could
be very useful):
Both 8-bit and Unicode strings have new partition(sep) and
rpartition(sep) methods that simplify a common use case.
The find(S) meth
codefire wrote:
> Ah of course, isfile(f) can only return true if it can find f! :)
>
> I'm going to investigate those other functions too :)
>
> Thanks a lot guys!
> Tony
By the way, an easier way to deal with paths is the path.py module
(http://www.jorendorff.com/articles/python/path/). Your ex
> A better solution would be to extract cookies from headers in the
> request method and return them with response (see the code below). I
Full solution! Wow! Thank you very much. I certainly do not deserve such
kindness. Thanks a lot Filip!
--
Milos Prudek
--
http://mail.python.org/mailman/l
John Salerno wrote:
> Robert Kern wrote:
>
> > What is ambiguous about A.B.D, A.E, and A.F.G? But if you like:
>
> I guess maybe I was looking at it backwards. From the way it was worded,
> I thought the only information we had to use was the structure A.B.C,
> and then given a statement like:
>
>
sweet thanks for the heads up.
John Salerno wrote:
> Forgive my excitement, especially if you are already aware of this, but
> this seems like the kind of feature that is easily overlooked (yet could
> be very useful):
>
>
> Both 8-bit and Unicode strings have new partition(sep) and
> rpartition(s
John Salerno wrote:
> Robert Kern wrote:
>
>> What is ambiguous about A.B.D, A.E, and A.F.G? But if you like:
>
> I guess maybe I was looking at it backwards. From the way it was worded,
> I thought the only information we had to use was the structure A.B.C,
> and then given a statement like:
>
I'm confused.
What's the difference between this and string.split?
John Salerno wrote:
> Forgive my excitement, especially if you are already aware of this, but
> this seems like the kind of feature that is easily overlooked (yet could
> be very useful):
>
>
> Both 8-bit and Unicode strings have n
Hello,
I am trying to parse some files so that if a postal code exists, but is
longer than five digits it will return me only the first five digits:
...
for insDict in insureDict:
insDict['postalcode'] = insDict.get('postalcode')[:5]
...
This works, except for when I get a blank postalcod
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> What's the difference between this and string.split?
>>> ('http://www.python.org').partition('://')
('http', '://', 'www.python.org')
>>> ('http://www.python.org').split('://')
['http', 'www.python.org']
--
Lawrence - http://www.oluyede.org/blog
[EMAIL PROTECTED] wrote:
> I'm confused.
> What's the difference between this and string.split?
>>> s = 'hello, world'
>>> s.split(',')
['hello', ' world']
>>> s.partition(',')
('hello', ',', ' world')
split returns a list of the substrings on either side of the specified
argument.
partit
1 - 100 of 171 matches
Mail list logo