This has apparently been a problematic thing for a while now, as the
following article indicates. I first ran into the error message about
not being able to remap C:\cygwin\bin\tk84.dll to be the same address
as it's parent.
Using that information, Google helped me find this article:
http://blog.
On May 27, 6:10 pm, thebiggestbangthe...@gmail.com wrote:
> hello everyone :-),
> I am a newbie to python. I am trying to run a
> bash script from within a python program. I would greatly appreciate
> any pointers/comments about how to get around the problem I am facing.
>
On Thu, May 28, 2009 at 9:11 AM, Sean DiZazzo wrote:
> On May 27, 6:10 pm, thebiggestbangthe...@gmail.com wrote:
> > hello everyone :-),
> > I am a newbie to python. I am trying to run a
> > bash script from within a python program. I would greatly appreciate
> > any point
Dennis Lee Bieber wrote:
> On Wed, 27 May 2009 14:25:58 +0200, Jon Bendtsen
> declaimed the following in gmane.comp.python.general:
>
>> 'From: r...@laerdal.dk\nsubject: testing\nNewsgroups: test\nBody:
>> \n\n\nfoobar\n\n\n.\n\n\n'
>>
> I believe NNTP, like SMTP, requires \r\n line termina
In message <0039e83c$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
wrote:
> A good UI standard should mean that:
>
> * all functionality should be discoverable without reading the manual;
Which means no scripting languages are allowed?
--
http://mail.python.org/mailman/listinfo/python-li
On May 26, 9:07 am, Lacrima wrote:
> I am new to python.
> And now I am using trial version of Wing IDE.
> But nobody mentioned it as a favourite editor.
> So should I buy it when trial is expired or there are better choices?
I use nothing but Wing. Their support is great as well.
--
http://ma
On Thu, May 28, 2009 at 12:06:25AM EDT, Steven D'Aprano wrote:
> On Wed, 27 May 2009 22:34:45 -0400, Chris Jones wrote:
> > I'm unsure about a python editor for everyone but since acquiring
> > habits takes time, I'm in favor of sticking to one editor for
> > everything.
>
> Or use an editor whic
norseman wrote:
> Peter Otten wrote:
>> norseman wrote:
>>
>>> This was sent 5/19/09 and as yet has received no comments.
>>
>>> I'm resending just in case a new reader might have an answer.
>>
>> If you had posted two tiny scripts demonstrating your problem instead of
>> the longwinded explana
Steven D'Aprano writes:
> * if possible, all functionality should be capable of being performed by
> either the mouse or keyboard.
I'd imagine that the requirement that *all* functionality can be
performed with the mouse rules out many text editors. Almost the
defining feature of a text editor
Hi,
I'm using Python 2.5.2. I'm getting this error whenever I try to unpack less
values from a function.
ValueError: too many values to unpack
I want to know if there is a way I can unpack less values returning from a
function?
Thanks,
Rajat
--
http://mail.python.org/mailman/listinfo/python-l
Esmail wrote:
> LittleGrasshopper wrote:
>>
>> So what do you guys use, and why? Hopefully we can keep this civil.
>
> I use Emacs, just because I have been using this editor for
> all sorts of things in the last 20+ years.
>
> I haven't been able to get the python mode to work for Windows
A bug
imageguy wrote:
I have an object the I would like to use as a base class. Some of the
methods I would like to override completely, but others I would simply
like to call the base class method and use the return value in the
child method. The purpose here is to eliminate the duplication of
valua
Rhodri James wrote:
> On Tue, 26 May 2009 14:22:29 +0100, Roy Smith wrote:
>
>> My pet peeve is syntax-aware editors which get things wrong. For
>> example,
>> the version of emacs I'm using now doesn't parse this properly:
>>
>> '''A triple-quoted string. Some editors won't get this right'''
>
Op 2009-05-26, Arnaud Delobelle schreef :
> Sumitava Mukherjee writes:
>
>> On May 26, 11:39 pm, Sumitava Mukherjee wrote:
>>> Hi all,
>>> I need to randomly sample from a list where all choices have weights
>>> attached to them. The probability of them being choosen is dependent
>>> on the weigh
Rhodri James wrote:
> On Wed, 27 May 2009 16:56:12 +0100, Bruno Desthuilliers
> wrote:
>
>> Rhodri James a écrit :
>>> On Tue, 26 May 2009 14:22:29 +0100, Roy Smith wrote:
>>>
My pet peeve is syntax-aware editors which get things wrong. For
example,
the version of emacs I'm using
Tan, Yih Hung wrote:
I have a question regarding Delphi COM programming. I have a VB DLL
(ActiveX COM DLL) and this DLL contain 2 classes, one is for normal
client function calling, and the other one is events raised by this DLL
to notify the client. Now, I would like to incorporate this DLL in
Wu Zhe wrote:
I am writing a server program with one producer and multiple consumers,
what confuses me is only the first task producer put into the queue gets
consumed, after which tasks enqueued no longer get consumed, they remain
in the queue forever.
from multiprocessing import Process, Pool,
On Wed, May 27, 2009 at 9:29 AM, powah wrote:
> I want to download all mib files from the web page:
> http://www.juniper.net/techpubs/software/junos/junos94/swconfig-net-mgmt/juniper-specific-mibs-junos-nm.html#jN18E19
>
> All mib filenames are of this format:
> www.juniper.net/techpubs ... .txt
>
On Wed, May 27, 2009 at 11:06 AM, powah wrote:
> On May 27, 12:29 pm, powah wrote:
>> I want to download all mib files from the web
>> page:http://www.juniper.net/techpubs/software/junos/junos94/swconfig-net-m...
>>
>> All mib filenames are of this format:www.juniper.net/techpubs... .txt
>>
>> I
norseman wrote:
Peter Otten wrote:
norseman wrote:
This was sent 5/19/09 and as yet has received no comments.
I'm resending just in case a new reader might have an answer.
If you had posted two tiny scripts demonstrating your problem instead
of the longwinded explanation I might have tin
I'd like to resize a ctypes array. As you can see, ctypes.resize doesn't
work like it could. I can write a function to resize an array, but I wanted
to know some other solutions to this. Maybe I'm missing some ctypes trick or
maybe I simply used resize wrong. The name c_long_Array_0 seems to tell m
I found an answer to this over on Stackoverflow.
http://stackoverflow.com/questions/919369/resize-ctypes-array
On Thu, May 28, 2009 at 1:25 AM, Scott Sibley wrote:
> I'd like to resize a ctypes array. As you can see, ctypes.resize doesn't
> work like it could. I can write a function to resize an
On Thu, May 28, 2009 at 3:19 AM, wrote:
> Hi,
>
> I'm using Python 2.5.2. I'm getting this error whenever I try to unpack less
> values from a function.
>
> ValueError: too many values to unpack
>
>
> I want to know if there is a way I can unpack less values returning from a
> function?
Unpack t
On Wed, 27 May 2009 17:21:23 -0400, Terry Reedy wrote:
> super() was designed for multiple inheritance.
Surely you mean that super() was designed for *inheritance*, multiple or
singular? Working with single inheritance is part of the design, not an
accident of implementation.
> The only reaso
In message , Dennis Lee
Bieber wrote:
> On Thu, 28 May 2009 13:12:57 +1200, Lawrence D'Oliveiro
> declaimed the following in
> gmane.comp.python.general:
>
>>
>> What if the string you're searching for includes a "%" or "_" character?
>
>>>> db.literal((... "%wildcard%" ...))
>(... "'
Konrad Hinsen wrote:
/home/shr/khinsen/tmp/Python-2.6.2/Modules/_ctypes/libffi/src/x86/ffi64.c(43):
\
error: identifier "__int128_t" is undefined
__int128_t sse[MAX_SSE_REGS];
^
compilation aborted for
/home/shr/khinsen/tmp/Python-2.6.2/Modules/_ctypes/libf\
fi/src/x86/ffi64.c (code 2
On Sunday 12 April 2009 15:07:11 Gabriel wrote:
> I'm python newbie and i need to write gui for my school work in python.
> I need to write it really quick, because i haven't much time .)
Try Tkinter, which is included by default with most Python installations.
Writing simple programs is easy li
On Thu, 28 May 2009 05:44:07 -0400, Chris Jones wrote:
>> * if possible, all functionality should be capable of being performed
>> by either the mouse or keyboard.
>
> All valid points on the face of it, but doesn't the above rule out both
> vim and emacs?
Your point is?
*ducks and runs*
--
On Thu, 28 May 2009 11:08:08 +0100, Paul Rudin wrote:
> Steven D'Aprano writes:
>
>
>> * if possible, all functionality should be capable of being performed
>> by either the mouse or keyboard.
>
> I'd imagine that the requirement that *all* functionality can be
> performed with the mouse rules
On Thu, 28 May 2009 20:58:07 +1200, Lawrence D'Oliveiro wrote:
> In message <0039e83c$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
> wrote:
>
>> A good UI standard should mean that:
>>
>> * all functionality should be discoverable without reading the manual;
>
> Which means no scripting l
On Thu, May 28, 2009 at 7:09 AM, Andreas Roehler
wrote:
> Rhodri James wrote:
>> and I'll get over that. The feature that caused me to uninstall
>> python-mode.el was its bloody-minded determination to regard '_' as a word
>> character, something which caused me more typing that it ever saved.
>
On Thu, May 28, 2009 at 07:38:33AM EDT, Steven D'Aprano wrote:
> Your point is?
notepad, otoh..
> *ducks and runs*
.. likewise.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 28 May 2009 06:24:56 +0100, Paul Rudin
wrote:
"Rhodri James" writes:
The feature that caused me to uninstall python-mode.el was its
bloody-minded determination to regard '_' as a word character,
something which caused me more typing that it ever saved.
Probably you could have cha
> Your best bet is to make sudo not ask for a password. :) If you
> don't have the rights, then you can use pexpect to do what you want to
> do. http://pexpect.sourceforge.net/pexpect.html
>
> See the second example on that page.
>
> child = pexpect.spawn('scp foo myn...@host.example.com:.')
Andreas Roehler wrote:
Esmail wrote:
LittleGrasshopper wrote:
So what do you guys use, and why? Hopefully we can keep this civil.
I use Emacs, just because I have been using this editor for
all sorts of things in the last 20+ years.
I haven't been able to get the python mode to work for Windo
I use Eclipse (www.eclipse.org) with the PyDev plugin
(pydev.sourceforge.net).
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Consider these two files:
, mytest.py -
| #!/usr/bin/env python
| import unittest
|
| class myTestCase(unittest.TestCase):
| def test_foo(self):
| pass
|
| # Somehow important according to pyunit documentation
| def suite():
| return unittest.makeSuite(myTestCase)
`---
Or you can try pyscripter
http://code.google.com/p/pyscripter/
Very fast, lightwieght and powerfull python editor.
--
http://mail.python.org/mailman/listinfo/python-list
Roy Smith wrote:
> In article ,
> Lawrence D'Oliveiro wrote:
>> The right thing to do is try to ensure that all your connections are
>> properly closed at shutdown. That may not be enough (if your server crashes
>> due to bugs), so the other thing you need to do is retry the socket open,
>> say
On May 28, 5:40 am, Chris Rebert wrote:
> On Thu, May 28, 2009 at 3:19 AM, wrote:
> > Hi,
>
> > I'm using Python 2.5.2. I'm getting this error whenever I try to unpack less
> > values from a function.
>
> > ValueError: too many values to unpack
>
> > I want to know if there is a way I can unpack
In article <4a1da210$0$90265$14726...@news.sunsite.dk>,
Mark Dickinson wrote:
>
>This is getting rather long. Perhaps I should put the above comments
>together into a 'post-PEP' document.
Yes, you should. Better explanation of floating point benefits everyone
when widely available. I even lear
I need to ...
1) Truncate long unicode (UTF-8) strings based on their length in
BYTES. For example, u'\u4000\u4001\u4002 abc' has a length of 7 but
takes up 13 bytes. Since u'\u4000' takes up 3 bytes, I want truncate
(u'\u4000\u4001\u4002 abc',3) == u'\u4000' -- as compared to
u'\u4000\u4001\u4002
I use Emacs, as for the other editing activities. I like it for it is
very powerfull.
--
Linux: Choice of a GNU Generation
--
http://mail.python.org/mailman/listinfo/python-list
Andrew Fong wrote:
> I need to ...
>
> 1) Truncate long unicode (UTF-8) strings based on their length in
> BYTES. For example, u'\u4000\u4001\u4002 abc' has a length of 7 but
> takes up 13 bytes. Since u'\u4000' takes up 3 bytes, I want truncate
> (u'\u4000\u4001\u4002 abc',3) == u'\u4000' -- as
Hi!
PGSQL makes me crazy...
I port my apps to PGSQL, and I near to finish - but I got this problem...
Params: PGSQL 8.3, Windows, Pylons, PGDB, DBUTILS...
I opened the connection with DBUTILS. I have one thread (the test thread),
possible it have more in the background, I don't know...
See thi
On May 28, 5:31 am, Sebastian Wiesner wrote:
>
>
> > Your best bet is to make sudo not ask for a password. :) If you
> > don't have the rights, then you can use pexpect to do what you want to
> > do. http://pexpect.sourceforge.net/pexpect.html
>
> > See the second example on that page.
>
> > c
On May 27, 11:07 pm, Steven D'Aprano wrote:
> On Wed, 27 May 2009 12:58:02 +, Albert van der Horst wrote:
>
> >>And how is reduce() supposed to know whether or not some arbitrary
> >>function is commutative?
>
> > Why would it or need it? A Python that understands the ``par'' keyword
> > is su
On Mon, May 18, 2009 at 12:31 AM, Ulrich Eckhardt
wrote:
> Steve Ferg wrote:
> > On the one hand, there are developers who love big IDEs with lots of
> > features (code generation, error checking, etc.), and rely on them to
> > provide the high level of support needed to be reasonably productive
>
I'm trying to use py2app to package an OpenGL app, so first I tried to
build the example here
http://svn.pythonmac.org/py2app/py2app/trunk/examples/PyOpenGL/
and I get the error:
> File
> "/opt/local/lib/python2.5/site-packages/PyOpenGL-3.0.0c1-py2.5.egg/OpenGL/platform/darwin.py",
> line 24,
Nikolaus Rath wrote:
Hi,
Consider these two files:
, mytest.py -
| #!/usr/bin/env python
| import unittest
|
| class myTestCase(unittest.TestCase):
| def test_foo(self):
| pass
|
| # Somehow important according to pyunit documentation
| def suite():
| return unittest.m
I pretty much understand what they do, but what's the case of using
these modules by example? Is it something like pickle, to store the data
efficiently in files?
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 28, 2009 at 2:09 PM, Mohan Parthasarathy wrote:
>
>
> On Mon, May 18, 2009 at 12:31 AM, Ulrich Eckhardt > wrote:
>
>> Steve Ferg wrote:
>> > On the one hand, there are developers who love big IDEs with lots of
>> > features (code generation, error checking, etc.), and rely on them to
Hello,
Python 2.5.2
WinXP
I'm using CGIHTTPServer.py and want to return a response code of 400
with a message in the event that the cgi script fails for some
reason. I notice that
run_cgi(self):
executes this line of code,
self.send_response(200, "Script output follows")
which overwrites any hea
> The good thing about python is : it 'tastes' like what it was being
> advertised
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
I installed the AOPython module:
% easy_install aopython
That left an aopython-1.0.3-py2.6.egg at
C:\mystuff\python\python_2.6.2\Lib\site-packages.
I entered the interpreter:
>>> import aopython
>>>
All is well.
But I was uncomfortable, since I was used to seeing directories
of Python code
On May 27, 3:37 pm, Scott David Daniels wrote:
> powah wrote:
> > ...
> > I fixed one error, now if the filename is misspelled, how to ignore
> > the error and continue?
>
> You really should go through the tutorial. It will explain this and
> other important things well. But, since I'm feeling
Peter Otten wrote:
norseman wrote:
Peter Otten wrote:
norseman wrote:
This was sent 5/19/09 and as yet has received no comments.
I'm resending just in case a new reader might have an answer.
If you had posted two tiny scripts demonstrating your problem instead of
the longwinded explanation
On May 28, 1:53 pm, Aaron Brady wrote:
> On May 27, 11:07 pm, Steven D'Aprano
> cybersource.com.au> wrote:
> > On Wed, 27 May 2009 12:58:02 +, Albert van der Horst wrote:
>
> > >>And how is reduce() supposed to know whether or not some arbitrary
> > >>function is commutative?
>
> > > Why woul
Dave Angel writes:
> Nikolaus Rath wrote:
>> Hi,
>>
>> Consider these two files:
>>
>> , mytest.py -
>> | #!/usr/bin/env python
>> | import unittest
>> | | class myTestCase(unittest.TestCase):
>> | def test_foo(self):
>> |pass
>> | | # Somehow important according to pyunit document
On May 28, 1:43 pm, Roastie wrote:
> I installed the AOPython module:
>
> % easy_install aopython
>
> That left an aopython-1.0.3-py2.6.egg at
> C:\mystuff\python\python_2.6.2\Lib\site-packages.
>
> I entered the interpreter:
>
> >>> import aopython
>
> All is well.
>
> But I was uncomfortable,
Hendrik van Rooyen wrote:
> When ssh- ing I have been using vim, painfully. Must look at nano - sounds
> good.
> I really miss Brief.
Or try 'joe'.
--
JanC
--
http://mail.python.org/mailman/listinfo/python-list
On May 28, 3:10 pm, Mike Driscoll wrote:
> On May 28, 1:43 pm, Roastie wrote:
>
>
>
> > I installed the AOPython module:
>
> > % easy_install aopython
>
> > That left an aopython-1.0.3-py2.6.egg at
> > C:\mystuff\python\python_2.6.2\Lib\site-packages.
>
> > I entered the interpreter:
>
> > >>>
> J Kenneth King (JKK) wrote:
>JKK> I find that it does work, but unlike SLIME for lisp, it just imports the
>statement.
>JKK> It confused me at first, but basically the interpreter doesn't provide
>JKK> any feedback to emacs.
>JKK> Try opening a python source file (start python-mode if yo
In article
,
trhaynes wrote:
> I'm trying to use py2app to package an OpenGL app [...]
You might try asking on the pythonmac-sig list: more py2app users there
most likely.
http://mail.python.org/mailman/listinfo/pythonmac-sig
[or]
http://dir.gmane.org/gmane.comp.python.apple
--
Ned Deily,
Hi,
I'm trying to build python 2.6.2 on Solaris 10 (SPARC 64), using Sun
Studio 12, but I'm having a few problems getting a clean build. The
python configure options are:
with_gcc=no
with_universal_archs=64-bit
with_cxx_main="CC -m64"
The first problem I'm having is _ssl.so not building:
cc -m
Roastie writes:
> I installed the AOPython module:
>
>% easy_install aopython
>
> That left an aopython-1.0.3-py2.6.egg at
> C:\mystuff\python\python_2.6.2\Lib\site-packages.
An egg is basically a ZIP file with a specific structure (you can
inspect it with common ZIP tools). Depending on th
In message <003a5518$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
wrote:
> On Thu, 28 May 2009 20:58:07 +1200, Lawrence D'Oliveiro wrote:
>
>> In message <0039e83c$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
>> wrote:
>>
>>> A good UI standard should mean that:
>>>
>>> * all funct
In message , Thomas Bellman wrote:
> Speaking as a sysadmin, running applications for production,
> programs not using SO_REUSEADDR should be taken out and shot.
> Not using SO_REUSEADDR means forcing a service interruption of
> half an hour (IIRC) if for some reason the service must be
> restart
ks more as expected with it.
I also assume you have seen .../pythonXX/distutils and dist.pdf? Just
in case you have not - take a look. Supposed to be how to package one's
stuff for distribution.
At least with python 2.5.2
on Linux Slackware 10.2
Today is: 20090528
Steve
--
http://mail.python.org/mailman/listinfo/python-list
On May 28, 11:17 am, Igor Katson wrote:
> I pretty much understand what they do, but what's the case of using
> these modules by example? Is it something like pickle, to store the data
> efficiently in files?
For one it provides a mechanism for reading and writing arbitrary file
formats. For exam
Igor Katson wrote:
I pretty much understand what they do, but what's the case of using
these modules by example? Is it something like pickle, to store the data
efficiently in files?
Mostly it is for access to specific binary data structures.
If you know a particular file format, you can read i
On May 26, 10:07 pm, Lacrima wrote:
> I am new to python.
> And now I am using trial version of Wing IDE.
> But nobody mentioned it as a favourite editor.
> So should I buy it when trial is expired or there are better choices?
No one mentioned textmate either . a brilliant text editor with
pytho
> I think the problem is it should be built with v9.S for 64-bit, not
> v8.S. Is that correct? If so, how do I get it to use the right one?
The Solaris dynamic loader can't find it. Set LD_LIBRARY_PATH or
LD_RUN_PATH appropriately, or use crle(8).
Regards,
Martin
--
http://mail.python.org/mail
jeffFromOz wrote:
On May 26, 10:07 pm, Lacrima wrote:
I am new to python.
And now I am using trial version of Wing IDE.
But nobody mentioned it as a favourite editor.
So should I buy it when trial is expired or there are better choices?
No one mentioned textmate either . a brilliant text edi
On May 28, 11:06 am, trhaynes wrote:
> I'm trying to use py2app to package an OpenGL app, so first I tried to
> build the example here
>
> http://svn.pythonmac.org/py2app/py2app/trunk/examples/PyOpenGL/
>
> and I get the error:
>
> > File
> > "/opt/local/lib/python2.5/site-packages/PyOpenGL-3.0.
CTO wrote:
> There's a book called Foundations of Python Network Programming that
> is pretty much as good a book as you could ever ask for on the subject. I
> strongly recommend it, and I think you'll find many of the examples
> relevant.
Yeah, I can recommend that book too.
--
JanC
--
http:
I want to do a functional like pattern match to get teh first two
elements, and then the rest of an array return value.
For example, assume that perms(x) returns a list of values, and I want
to do this:
seq=perms(x)
a = seq[0]
b = seq[1]
rest = seq[2:]
Of course I can shorten to:
guthrie wrote:
I want to do a functional like pattern match to get teh first two
elements, and then the rest of an array return value.
For example, assume that perms(x) returns a list of values, and I want
to do this:
seq=perms(x)
a = seq[0]
b = seq[1]
rest = seq[2:]
Of course I
Hello
I have simple text file that I have to parse. It looks something like
this:
parameters1
key1 value1
key2 value2
end
parameters2
key1 value1
key2 value2
end
So I want to create two dictionaries parameters1={key1:value1,
key2:value2} and the same for parameters2.
I woud
On May 28, 5:43 pm, guthrie wrote:
> I want to do a functional like pattern match to get teh first two
> elements, and then the rest of an array return value.
>
> For example, assume that perms(x) returns a list of values, and I want
> to do this:
> seq=perms(x)
>
> a = seq[0]
> b = se
This is probably trivial, but it's driving me mad somehow. All (new
style) classes are instances of 'type' by default, unless a custom
metaclass is specified. I take this to mean that when a class
declaration is found in the code, an instance of 'type' representing
that class is created by calling
On Fri, 29 May 2009 09:04:39 +1200, Lawrence D'Oliveiro wrote:
> In message <003a5518$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
> wrote:
>
>> On Thu, 28 May 2009 20:58:07 +1200, Lawrence D'Oliveiro wrote:
>>
>>> In message <0039e83c$0$9673$c3e8...@news.astraweb.com>, Steven
>>> D'Aprano
Terry Reedy:
> >>> a,b,*rest = list(range(10))
> >>> a,b,rest
> (0, 1, [2, 3, 4, 5, 6, 7, 8, 9])
> >>> a,*rest,b = 'abcdefgh'
> >>> a,rest,b
> ('a', ['b', 'c', 'd', 'e', 'f', 'g'], 'h')
For the next few years I generally suggest to specify the Python
version too (if it's 2.x or 3.x).
This is P
LittleGrasshopper wrote:
> This is probably trivial, but it's driving me mad somehow. All (new
> style) classes are instances of 'type' by default, unless a custom
> metaclass is specified. I take this to mean that when a class
> declaration is found in the code, an instance of 'type' representing
On May 28, 4:37 pm, Christian Heimes wrote:
> LittleGrasshopper wrote:
> > This is probably trivial, but it's driving me mad somehow. All (new
> > style) classes are instances of 'type' by default, unless a custom
> > metaclass is specified. I take this to mean that when a class
> > declaration is
Marius Retegan:
>
> parameters1
> key1 value1
> key2 value2
> end
>
> parameters2
> key1 value1
> key2 value2
> end
>
> So I want to create two dictionaries parameters1={key1:value1,
> key2:value2} and the same for parameters2.
I have wasted some time trying to create a regex f
Marius Retegan wrote:
Hello
I have simple text file that I have to parse. It looks something like
this:
parameters1
key1 value1
key2 value2
end
parameters2
key1 value1
key2 value2
end
So I want to create two dictionaries parameters1={key1:value1,
key2:value2} and the same f
On May 28, 4:37 pm, Christian Heimes wrote:
> LittleGrasshopper wrote:
> > This is probably trivial, but it's driving me mad somehow. All (new
> > style) classes are instances of 'type' by default, unless a custom
> > metaclass is specified. I take this to mean that when a class
> > declaration is
On Thu, 28 May 2009 18:57:42 -0400, Terry Reedy wrote:
> >>> a,b,*rest = list(range(10))
That fails in Python 2.5 and 2.6.
>>> a,b,*rest = list(range(10))
File "", line 1
a,b,*rest = list(range(10))
^
SyntaxError: invalid syntax
--
Steven
--
http://mail.python.org/mailman/li
On Thu, 28 May 2009 10:53:17 -0700, Aaron Brady wrote:
> On May 27, 11:07 pm, Steven D'Aprano cybersource.com.au> wrote:
>> On Wed, 27 May 2009 12:58:02 +, Albert van der Horst wrote:
>>
>> >>And how is reduce() supposed to know whether or not some arbitrary
>> >>function is commutative?
>>
>
On Thu, 28 May 2009 08:50:00 -0700, Andrew Fong wrote:
> I need to ...
>
> 1) Truncate long unicode (UTF-8) strings based on their length in BYTES.
Out of curiosity, why do you need to do this?
> For example, u'\u4000\u4001\u4002 abc' has a length of 7 but takes up 13
> bytes.
No, that's wro
*How do we setup Cheetah so it runs with all templates in the templates
directory and all code in the .. directory
code.py*
production=True
if not production:
try:web.render('mafbase.tmpl', None, True, 'mafbase')
except:pass
else:
from templates import mafbase
templates/mafbase.tmpl
Many thanks to all; perfect solution!
--
http://mail.python.org/mailman/listinfo/python-list
In message <003af57e$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
wrote:
> On Fri, 29 May 2009 09:04:39 +1200, Lawrence D'Oliveiro wrote:
>
>> In message <003a5518$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
>> wrote:
>>
>>> On Thu, 28 May 2009 20:58:07 +1200, Lawrence D'Oliveiro w
You can create this modularly by :
1. parse the file and cut this into different chunks ( look for 'end' ) then
you have two chunks for param 1 & 2
2. once you have those chunks then process each chunk with your own
processing based on your parameters ( 1 or 2 )
3. then based on your individual par
I'm using Tkinter file selector to get a direcotry path. I'm using:
self.file = tkFileDialog.askdirectory(title="Please select your directory")
print file
but all it prints out is:
How would I print the directory path?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Andrew Fong gmail.com> writes:
> I need to ...
> 1) Truncate long unicode (UTF-8) strings based on their length in
> BYTES.
> 2) I don't want to accidentally chop any unicode characters in half.
> If the byte truncate length would normally cut a unicode character in
> 2, then I just want to drop
John Machin lexicon.net> writes:
> Andrew Fong gmail.com> writes:
> Are
> > there any built-in ways to do something like this already? Or do I
> > just have to iterate over the unicode string?
>
> Converting each character to utf8 and checking the
> total number of bytes so far?
> Ooooh, sloo
On Fri, 29 May 2009 14:00:19 +1200, Lawrence D'Oliveiro wrote:
> In message <003af57e$0$9673$c3e8...@news.astraweb.com>, Steven D'Aprano
> wrote:
>
>> On Fri, 29 May 2009 09:04:39 +1200, Lawrence D'Oliveiro wrote:
>>
>>> In message <003a5518$0$9673$c3e8...@news.astraweb.com>, Steven
>>> D'Aprano
On Fri, 29 May 2009 04:09:53 +, John Machin wrote:
> John Machin lexicon.net> writes:
>
>> Andrew Fong gmail.com> writes:
>
> > Are
>> > there any built-in ways to do something like this already? Or do I
>> > just have to iterate over the unicode string?
>>
>> Converting each character t
1 - 100 of 111 matches
Mail list logo