I would to convert the first string to upper case. But this regular
expression is not matching the first string between quotes.
re.sub("'(?P\w+)': [^{]", "\gFOO", str)
# string to non-matching
'foo': {
# strings to matching
'bar': 'bar2'
'bar': None
'bar': 0
'bar': True
So, i.e., from the fir
How to escape the first '}' in the next string?
s = "}\n{0}".format('foo')
--
http://mail.python.org/mailman/listinfo/python-list
What does a slice as [N::-1] ?
It looks that in the first it reverses the slice and then it shows
only N items, right?
Could you add an example to get the same result without use `::` to
see it more clear?
Thanks in advance
--
http://mail.python.org/mailman/listinfo/python-list
On 26 feb, 12:35, Ben Finney wrote:
> Joan Miller writes:
> > I use a function in 'setupy.py' to get automatically the description
> > from the package's docstring, but there is a problem when you import a
> > module that has to be built by cython (because it
On 26 feb, 10:57, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > When a package is imported, it gets the dosctring to store it in
> > *__doc__*.
>
> > Does that funcion is built in python? because I would want use it to
> > get the docstring wi
On 26 feb, 10:51, Ben Finney wrote:
> Joan Miller writes:
> > When a package is imported, it gets the dosctring to store it in
> > *__doc__*.
>
> Joan, in this message and numerous others you've been following the
> widespread convention of using asterisks ‘*’ t
When a package is imported, it gets the dosctring to store it in
*__doc__*.
Does that funcion is built in python? because I would want use it to
get the docstring without import a package
--
http://mail.python.org/mailman/listinfo/python-list
On 23 feb, 20:16, "D'Arcy J.M. Cain" wrote:
> On Tue, 23 Feb 2010 20:30:03 +0100
>
> Olof Bjarnason wrote:
> > Even if this is "Off Topic" (which I think it really isn't in any open
> > source / free software-oriented mailing list), I want to agree with
> > Joan.
>
> It isn't about the Python pro
On 23 feb, 10:54, Joan Miller wrote:
> *Sorry by this message off topic, but this is too important*
>
> Fascism is coming fastly to Internet because is the only communication
> way that governements (managed by the bank and multinationals) cann't
> control
>
> http://www
*Sorry by this message off topic, but this is too important*
Fascism is coming fastly to Internet because is the only communication
way that governements (managed by the bank and multinationals) cann't
control
http://www.boingboing.net/2010/02/21/acta-internet-enforc.html
--
http://mail.python.o
On 16 feb, 08:40, alex23 wrote:
> On Feb 16, 6:16 pm, Joan Miller wrote:
>
> > Is possible to get a third class with the class variables of another
> > two classes?
>
> >
> > class A:
> > foo = 1
>
> > class B:
> >
On 15 feb, 10:11, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > Does `raw_input` uses internally `sys.stdout.write`?
>
> You can test this yourself without reading the C source:
>
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on li
Does `raw_input` uses internally `sys.stdout.write`?
--
http://mail.python.org/mailman/listinfo/python-list
On 8 feb, 21:13, Vinay Sajip wrote:
> On Feb 7, 11:22 am, Joan Miller wrote:
>
>
>
> > I would want to get the output from `logging.exception` but with
> > traceback from the caller function (I've already all that
> > information).
>
> > T
I would want to get the output from `logging.exception` but with
traceback from the caller function (I've already all that
information).
This would be the error with logging.exception:
ERROR:
PipeError('/bin/ls -l | ', 'no command after of pipe')
Traceback (most recent call
On 3 feb, 10:54, Tim Golden wrote:
> [News123]
>
> >>> I wondered what IPC library might be best simplest for following task?
>
> ...
>
> >>> xmlrpc seems to be a little heavy for such tasks.
>
> >>> signals don't allow to exchange data
>
> >>> a shared memory message queue would probably a good s
On 3 feb, 09:34, Vinay Sajip wrote:
> On Feb 3, 8:32 am, News123 wrote:
>
>
>
> > Hi,
>
> > I wondered what IPC library might be best simplest for following task?
>
> > I'm having a few python scripts all running on the same host (linux or
> > win), which are started manually in random order. (no
On 2 feb, 16:55, Arnaud Delobelle wrote:
> Joan Miller writes:
> > I've a main function called i.e. *foo()* which has a block of code
> > that is repetead several times (for the error catching code and error
> > reporting), but that code has a return to exit of *foo()*
I've a main function called i.e. *foo()* which has a block of code
that is repetead several times (for the error catching code and error
reporting), but that code has a return to exit of *foo()*
---
foo():
...
if self.background:
_log.exception(str(error))
return Retu
On 1 feb, 12:45, Steven D'Aprano wrote:
> On Mon, 01 Feb 2010 02:19:39 -0800, Joan Miller wrote:
> > Which is the best way to create user-defined exceptions since that
> > *BaseException.message* is deprecated in Python 2.6 ?
>
> Inherit from an existing exception.
>
Which is the best way to create user-defined exceptions since that
*BaseException.message* is deprecated in Python 2.6 ?
--
http://mail.python.org/mailman/listinfo/python-list
On 29 ene, 05:44, Dennis Lee Bieber wrote:
> On Thu, 28 Jan 2010 11:24:28 -0800 (PST), Joan Miller
> declaimed the following in
> gmane.comp.python.general:
>
> > On 28 ene, 19:16, Josh Holland wrote:
> > > On 2010-01-28, Joan Miller wrote:
>
> > > &g
On 28 ene, 22:57, John Posner wrote:
> On 1/28/2010 3:45 PM, Joan Miller wrote:
>
>
>
> > On 28 ene, 20:34, Joan Miller wrote:
> >> On 28 ene, 20:20, Peter wrote:
>
> >>> On Jan 29, 6:58 am, John Posner wrote:
>
> >>>> On 1/28/2010
On 28 ene, 23:36, Jonathan Gardner
wrote:
> On Jan 28, 2:16 pm, Joan Miller wrote:
>
>
>
> > There would be to make a function for each system command to use so it
> > would be too inefficient, and follow the problem with the quotes.
>
> > The best is make
On 28 ene, 21:40, Jonathan Gardner
wrote:
> On Jan 28, 10:20 am, Joan Miller wrote:
>
>
>
> > I've to call to many functions with the format:
>
> > >>> run("cmd")
>
> > were "cmd" is a command with its arguments to pa
On 28 ene, 20:34, Joan Miller wrote:
> On 28 ene, 20:20, Peter wrote:
>
> > On Jan 29, 6:58 am, John Posner wrote:
>
> > > On 1/28/2010 2:24 PM, Joan Miller wrote:
>
> > > > On 28 ene, 19:16, Josh Holland wrote:
> > > >> On 2010-01-28
On 28 ene, 20:20, Peter wrote:
> On Jan 29, 6:58 am, John Posner wrote:
>
>
>
> > On 1/28/2010 2:24 PM, Joan Miller wrote:
>
> > > On 28 ene, 19:16, Josh Holland wrote:
> > >> On 2010-01-28, Joan Miller wrote:
>
> > >>> I've
On 28 ene, 19:58, John Posner wrote:
> On 1/28/2010 2:24 PM, Joan Miller wrote:
>
> > On 28 ene, 19:16, Josh Holland wrote:
> >> On 2010-01-28, Joan Miller wrote:
>
> >>> I've to call to many functions with the format:
>
> >>>>>>
On 28 ene, 19:54, Steve Holden wrote:
> Joan Miller wrote:
> > On 28 ene, 19:16, Josh Holland wrote:
> >> On 2010-01-28, Joan Miller wrote:
>
> >>> I've to call to many functions with the format:
> >>>>>> run("cmd")
On 28 ene, 19:17, Big Stu wrote:
> I'm hoping someone on here can point me to an example of a python
> package that is a great example of how to put it all together. I'm
> hoping for example code that demonstrates:
>
> -Strict adherence to PEP 8
> -thorough use of Docstrings
> -Conventional direc
On 28 ene, 19:16, Josh Holland wrote:
> On 2010-01-28, Joan Miller wrote:
>
> > I've to call to many functions with the format:
>
> >>>> run("cmd")
>
> Check the docs on os.system().
No. I've a function that uses subprocess to run commands
I've to call to many functions with the format:
>>> run("cmd")
were "cmd" is a command with its arguments to pass them to the shell
and run it, i.e.
>>> run("pwd")
or
>>> run("ls /home")
Does anybody knows any library to help me to avoid the use of the main
quotes, and brackets?
I would to us
On 23 ene, 18:45, a...@pythoncraft.com (Aahz) wrote:
> In article
> <00eb248d-c9c9-430f-bc83-41ac865c5...@e11g2000yqe.googlegroups.com>,
> Joan Miller wrote:
>
>
>
> >There is a license approved by the OSI, the ISC License [1], which
> >should be included
There is a license approved by the OSI, the ISC License [1], which
should be included in the PyPi classifiers [2].
[1] https://www.isc.org/software/license
http://www.opensource.org/licenses/isc-license.txt
[2] http://pypi.python.org/pypi?%3Aaction=list_classifiers
--
http://mail.python.org/mail
How the logging '%(asctime)s' [1] specifier to gets the millisecond
portion of the time if there is not a directive to get it from the
time module [2] ?
"The date format string follows the requirements of strftime()"
[1] http://docs.python.org/library/logging.html#basic-example
[2] http://docs.p
On 10 ene, 13:10, Joan Miller wrote:
> On 10 ene, 12:36, Peter Otten <__pete...@web.de> wrote:
>
>
>
> > Joan Miller wrote:
> > > On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote:
> > >> Joan Miller wrote:
> > >> >
On 10 ene, 12:36, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote:
> >> Joan Miller wrote:
> >> > How to prepend anything to a logging message? Is possible to do it
> >> >
On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > How to prepend anything to a logging message? Is possible to do it
> > from the dictionary object (ExtraLog) or is there is that override
> > process() [1]?
>
> >
On 10 ene, 03:27, Ishwor Gurung wrote:
> Joan,
>
> 2010/1/10 Joan Miller :
>
>
>
> > How to prepend anything to a logging message? Is possible to do it
> > from the dictionary object (ExtraLog) or is there is that override
> > process() [1]?
>
> >
How to prepend anything to a logging message? Is possible to do it
from the dictionary object (ExtraLog) or is there is that override
process() [1]?
--
class ExtraLog(object):
def __getitem__(self, name):
if name == 'foo':
result = 'testing'
return
How to set local variables based on dictionary contents?
--
http://mail.python.org/mailman/listinfo/python-list
On 26 dic, 04:34, Steven D'Aprano wrote:
> On Fri, 25 Dec 2009 12:07:20 -0800, Joan Miller wrote:
> > On 25 dic, 13:24, Steven D'Aprano > cybersource.com.au> wrote:
> >> On Thu, 24 Dec 2009 05:06:48 -0800, Joan Miller wrote:
> >> > I'm trying
On 25 dic, 13:24, Steven D'Aprano wrote:
> On Thu, 24 Dec 2009 05:06:48 -0800, Joan Miller wrote:
> > I'm trying to add some extra fields to logging, I'm following this
> > information [1] but it faills in my case.
> [...]
> > I get => KeyError: 'hos
I'm trying to add some extra fields to logging, I'm following this
information [1] but it faills in my case.
# module logger.py
import logging
class ExtraInfo(object):
def __getitem__(self, name):
if name == 'host':
result = 'foo'
def __iter__(self
44 matches
Mail list logo