a regex question

2019-10-25 Thread Maggie Q Roth
Hello There are two primary types of lines in the log: 60.191.38.xx/ 42.120.161.xx /archives/1005 I know how to write regex to match each line, but don't get the good result with one regex to match both lines. Can you help? Thanks, Maggie --

graphics with python

2019-10-24 Thread Maggie Q Roth
Hello Can you show me the correct way to programming with graphics? I want to take some action detection, for instance, recognize dancing etc. Thanks, Maggie -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread John Q Hacker
Sorry, delete string "n't". I mean that you would strcuture your code with that architecture. Hate that. marxos On 1/1/18, John Q Hacker <zonderv...@gmail.com> wrote: >>> I don’t use gotos in C code. Why should it be “harder” in a higher-level >>> language?

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread John Q Hacker
>> I don’t use gotos in C code. Why should it be “harder” in a higher-level >> language? > > Good for you. > > Looking at 14 million lines of Linux kernel sources, which are in C, > over 100,000 of them use 'goto'. About one every 120 lines. Most use of goto's implies a lack of understanding of

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Q
Q added the comment: PS. I'm not sure if that is a systemd/journald issue, or indeed a Python bug. However, it would be nice to clear one possibility. For a StreamHandler, it all works as it should. -- ___ Python tracker <rep...@bugs.python.

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Q
Q added the comment: Attaching the other file mentioned. -- Added file: http://bugs.python.org/file46680/good.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29675] SysLogHandler does not seem to always expand %(loglevel)s properly

2017-02-28 Thread Q
New submission from Q: On Ubuntu LTS 16.04, SysLogHandler with a custom formatter does not seem to expand loglevel/levelno fields properly, when there are square brackets ( see the attached examples ). Instead, it seems to replace '[%(loglevel)s]' with a '[pid]', and '%(loglevel)s

Re: mix-in classes

2015-06-16 Thread Dr. John Q. Hacker
On Sun, May 24, 2015 at 6:11 AM, Steven D'Aprano st...@pearwood.info wrote: On Sun, 24 May 2015 11:53 am, Dr. John Q. Hacker wrote: But, frankly, what you describe is more likely to be a weakness of multiple inheritance and mixins, one which should be avoided. One attempt to avoid

mix-in classes

2015-05-23 Thread Dr. John Q. Hacker
The post on different types of inheritence... brought up a thought. Let's say, I'm adding flexibility to a module by letting users change class behaviors by adding different mix-in classes. What should happen when there's a name collision on method names between mix-ins? Since they're mix-ins,

code blocks

2015-05-03 Thread Dr. John Q. Hacker
Hello, I'm thinking how interesting it would be to add code blocks to Python, so that arbitrary strings of code can be passed around. It would open up some interesting possibilities for self-modifying code and generic programming. Since Python has already a plethora of ambiguous string

[issue14823] Simplify threading.Lock.acquire() description

2012-05-18 Thread Q
Q abon...@gmail.com added the comment: My bad. That's indeed what I did. Won't repeat the mistake, sorry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14823

[issue14823] Simplify threading.Lock.acquire() description

2012-05-16 Thread Q
Q abon...@gmail.com added the comment: Well, as threading is a Python wrapper, this could easily be fixed. (I am not certain whether it *should* be fixed or not -- perhaps things are fine just as they are, at least with that particular detail. ) But this is good to know, thank you

[issue14823] Simplify threading.Lock.acquire() description

2012-05-15 Thread Q
New submission from Q abon...@gmail.com: Hi there, I suggest to improve the description of Lock.acquire() [ http://docs.python.org/library/threading.html#threading.Lock.acquire ] in the following way: current version Lock.acquire([blocking]) Acquire a lock, blocking or non-blocking

[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-29 Thread Q
Q abon...@gmail.com added the comment: thanks, that's rather convenient -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14671 ___ ___ Python-bugs

[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-26 Thread Q
Q abon...@gmail.com added the comment: I do not mean to reopen the bug (there are supposedly much more important things to work on in Python). But just for the record, let me state that I feel like there is some misleading inconsistency here: - by definition, a new style class is Any class

[issue14671] isinstance(obj, object) returns True for _old style_ classes

2012-04-25 Thread Q
New submission from Q abon...@gmail.com: $python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 class Old: pass class New(object): pass o = Old() n = New() isinstance(o, object) True This is it, basically. Is it a bug or a feature? More tests : isinstance(o, Old

[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-25 Thread Q
Changes by Q abon...@gmail.com: -- title: isinstance(obj, object) returns True for _old style_ classes - isinstance(obj, object) returns True for _old style_ class instances ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14671

[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-25 Thread Q
Q abon...@gmail.com added the comment: In addition: issubclass(Old, object) False -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14671

[issue14671] isinstance(obj, object) returns True for _old style_ class instances

2012-04-25 Thread Q
Q abon...@gmail.com added the comment: help(isinstance) isinstance(...) isinstance(object, class-or-type-or-tuple) - bool Return whether an object is an instance of a class or of a subclass thereof. (...) So are the old-style class instances descendants of the object? I feel

Help: how to protect the module 'sys' and 'os'

2012-03-07 Thread q q
Hi~ alls, I have to limit somebody modify the attr of 'sys''os'? e.g. you can't append sys.path. Someone has a good method? now my way: modified the source code of python ,_PyObject_GenericSetAttrWithDict, because if you want to reset the value, you need to invoke this function. --- best regards

Re: Locale bug?

2012-01-03 Thread =?ISO-8859-1?Q?Trond_Endrest=F8l?=
Marko Rauhamaa ma...@pacujo.net writes: Mysterious 8-bit characters appear in the string returned by strftime. $ python Python 2.7.2 (default, Oct 27 2011, 01:36:46) [GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2 Type help, copyright, credits or license for more

access to base class __init__

2008-03-05 Thread sambo q
I got myself in jam trying to be too fancy with threading.Thread Docs say / remind to call the base __init__ but I can't fighure out how. --- def main() . ls.listen(5) key = ' ' #while key != EXITCHARCTER: while stop_serving == False: cs, raddr

Embedding Python

2005-06-17 Thread =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
Hi, Imagine that you have a PyObject pointer 'object' pointing to a Python integer ... let's say 42. How would do you attach the variable answer to it so that the code PyRun_SimpleString(print answer); works as expected ? My current solution is: __main__ = PyImport_ImportModule(__main__);

Re: FAQ: __str__ vs __repr__

2005-06-15 Thread =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
Jan Danielsson a écrit : Sorry, but I Just Don't Get It. I did search the 'net, I did read the FAQ, but I'm too dumb to understand. As far as I can gather, __str__ is just a representation of the object. ... yep, and this representation is built for human eyes. Don't worry too much if it

Re: FAQ: __str__ vs __repr__

2005-06-15 Thread =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
Errata: str(0.1) '0.1' str(it's a bad idea) it's a bad idea repr(0.1) ' 0.10001' repr(it's a bad idea) 'it\'s a bad idea' SB -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic

2005-06-15 Thread =?iso-8859-1?Q?Fran=E7ois?= Pinard
[Michele Simionato] Having a class that returns instances of some other class is horrible, [...] don't do it! Unusual, granted. Horrible, why? I found useful, sometimes, (ab)using Python syntax for representing data having more or less complex structure. More than once, it spared me the

Re: Controlling assignation

2005-06-14 Thread =?ISO-8859-1?Q?Xavier_D=E9coret?=
Bruno Desthuilliers a écrit : Xavier Décoret a écrit : (snip) What I wanted to do is something like this: def change(x,v): x = v class A(object): def __init__(self,v): self.x = v a = A(3) print a.x # displays 3 change(a.x,4) print a.x # still displays 3 It may

Re: MySQLDBAPI

2005-06-14 Thread =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
see below On 6/10/05, Daniel Dittmar [EMAIL PROTECTED] wrote: Gregory Piñero wrote: Is that something I can install all to my home directory? If you have a similar Linux distribution at home, simply build the mysql extension on that machine and then copy it to the web server. I have

Re: MySQLDBAPI

2005-06-14 Thread =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
While waiting for answers to the above questions, I went ahead and tried the following: 1. Downloaded the RPM for the server's version of MySql: http://downloads.mysql.com/archives/mysql-3.23/MySQL-devel-3.23.57-1.i386.rpm 2. Copy file to server, and extract to a new folder i made called

Re: MySQLDBAPI

2005-06-14 Thread =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
The closest thing I found was libmysqlclient.a in /home/gpinero/rpmmysql/usr/lib/mysql/ I added that path to my library_dir in setup.py but I still get the same error message when I do python2.4 setup.py build I really appriciate your help. I really want to start web development in python.

Re: MySQLDBAPI

2005-06-14 Thread =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
Here's a list of all the files from the RPM extraction, maybe that helps too? [EMAIL PROTECTED] rpmmysql]$ dir -R .: usr ./usr: bin include lib ./usr/bin: comp_err mysql_config ./usr/include: mysql ./usr/include/mysql: chardefs.h m_ctype.hmy_net.h mysql.h

Re: MySQLDBAPI

2005-06-14 Thread =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
One other note, the few searches I've made that seem somewhat relevant talk about turning off something thread-safe? Is this something I can try even though I have very limited permissions on the server? On 6/14/05, Gregory Piñero [EMAIL PROTECTED] wrote: Here's a list of all the files from

Controlling assignation

2005-06-13 Thread =?ISO-8859-1?Q?Xavier_D=E9coret?=
I would like to know if there is for python's classes an equivalent of the operator= that can be overidden. Let's say I have a=A() and I want to write a=5 and I want this to change some internal value of a instead of making a point to a new object (an int 5) In other word, I would like to

Re: Controlling assignation

2005-06-13 Thread =?ISO-8859-1?Q?Xavier_D=E9coret?=
Xavier Décoret a écrit : I would like to know if there is for python's classes an equivalent of the operator= that can be overidden. Let's say I have a=A() and I want to write a=5 and I want this to change some internal value of a instead of making a point to a new object (an int

Re: Custom type: PyObject_IS_GC access violation

2005-06-12 Thread =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Bue Krogh Vedel-Larsen wrote: But if I call SA_PyVector_Type.tp_new = PyType_GenericNew; PyType_Ready( SA_PyVector_Type ); then, when Py_Finalize is called, PyObject_IS_GC(op) in visit_decref() in gcmodule.c causes an access violation. If I don't call PyType_Ready, then the access

Re: How to use 8bit character sets?

2005-06-12 Thread =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
copx wrote: For some reason Python (on Windows) doesn't use the system's default character set and that's a serious problem for me. I very much doubt this statement: Python does use the system's default character set on Windows. What makes you think it doesn't? Is it possible to tell Python

Re: identifying 64-bit Windows from 2.3.5?

2005-06-11 Thread =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Steven Knight wrote: Can some Windows-savvy Pythonista point me to some way to distinguish between these two? I would look at the environment variable PROCESSOR_ARCHITECTURE. On the Win64 machine I use, its value is IA64. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-11 Thread =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Philippe C. Martin wrote: I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very pragmatic - 3) I usually move forward when I get the gut feeling I am

Re: Generating HTML from python

2005-06-10 Thread =?ISO-8859-1?Q?Walter_D=F6rwald?=
Cappy2112 wrote: I looked at HTMLGen a while ago- I didn't see what the advantage was. I wrote soem code similar to the example above, to generate a page.. It worked out fine. However, I want to add HTML ouput to many of my other python programs, and I don't want to re-write this for each

Re: IMAP Proxy

2005-06-10 Thread =?ISO-8859-1?Q?Tarek_Ziad=E9?=
Alex Verstraeten wrote: Tarek Ziadé wrote: Hi, I want to write a small TCP Server in Python to make an IMAP Proxy for post-processing client requests. It is not long either complicated but needs to be very robust so... maybe someone here has already done such a thing I can use or know

XML + SOAP + Webservices

2005-06-09 Thread Johan =?iso-8859-1?Q?Segern=E4s?=
I'm put on building a system in Python and I haven't used either webservices, SOAP or Python so I'm a bit lost. This system will require callback functions, should I use Python thru Apache for this or build my own listening daemon? Use module for Apache or do I make some kind of CGI script in

Re: XML + SOAP + Webservices

2005-06-09 Thread Johan =?iso-8859-1?Q?Segern=E4s?=
On 2005-06-09 13:21 +0200 or thereabouts, Johan Segernäs wrote: I'm put on building a system in Python and I haven't used either webservices, SOAP or Python so I'm a bit lost. Addon: I will speak to .NET-stuff in the other end, does this create problems? signature.asc Description: Digital

Re: XML + SOAP + Webservices

2005-06-09 Thread Johan =?iso-8859-1?Q?Segern=E4s?=
On 2005-06-09 14:20 +0200 or thereabouts, Diez B. Roggisch wrote: a way to pass a server the necessary callback information. It basically consists of the url to talk to. That by the way is no limitation of But of course, a little slip in my thoughts. Sooo - concluding remarks could be: -

Re: MySQLDBAPI

2005-06-09 Thread =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
I didn't see anything about mysql-devel package in the release notes. Is that something I can install all to my home directory? On 6/9/05, deelan [EMAIL PROTECTED] wrote: Gregory Piñero wrote: Hey guys, (...) My first question is if there is anything built into python as far as a

Knowing the signature of a function

2005-06-08 Thread =?ISO-8859-1?Q?Xavier_D=E9coret?=
Hello, I have the following code: def foo(x,y): pass How can I query the function object foo to know the number of parameters it expects. I can find it is a function using callable(f), I can find some information (listed by dir(foo)) such as the name of the function,etc.. but

Re: Knowing the signature of a function

2005-06-08 Thread =?ISO-8859-1?Q?Xavier_D=E9coret?=
Kent Johnson a écrit : Xavier Décoret wrote: Hello, I have the following code: def foo(x,y): pass How can I query the function object foo to know the number of parameters it expects. I can find it is a function using callable(f), I can find some information (listed by dir(foo))

Re: maybe a bug in python

2005-06-05 Thread =?ISO-8859-1?Q?Tiago_St=FCrmer_Daitx?=
Just as everyone said, use ('a',) instead of ('a'). As Steve said there are lots of documentation about it. Check the Library Reference at http://www.python.org/doc/current/lib/typesseq.html#l2h-155 or to make things more clear you could read the tuples section in the tutorial at

Re: any macro-like construct/technique/trick?

2005-06-04 Thread =?iso-8859-1?Q?Fran=E7ois?= Pinard
[Georges JEGO] Mac a écrit : # do some stuff if debug: emit_dbg_obj(DbgObjFoo(a,b,c)) Assuming your debug functions always return true, you could use: assert emit_dbg_obj(DbgObjFoo(a,b,c)) and have this code executed -or not- depending on the use of -O

Re: any macro-like construct/technique/trick?

2005-06-04 Thread =?iso-8859-1?Q?Fran=E7ois?= Pinard
[Paddy] If you still must have something like the c preprocessor then unix has m4 (and it seems there is a windows version http://gnuwin32.sourceforge.net/packages/m4.htm). The difficulty of `m4' for Python source is that macro expansions should be accompanied with proper adjustment of

Re: executing a command

2005-06-04 Thread =?ISO-8859-1?Q?Tiago_St=FCrmer_Daitx?=
Hello,When you use one of the os.exec*p fnnctions python looks for the specified file in the directories refered by os.environ['PATH']. If and _only_ if your os.enviroment['PATH'] isn't set then it looks in os.defpath - you can check this at

Re:

2005-06-04 Thread =?ISO-8859-1?Q?Tiago_St=FCrmer_Daitx?=
That depends on what using a file means. You could check the thread executing a command ( http://mail.python.org/pipermail/python-list/2005-June/283963.html) and see if there's something related there, otherwise it would help if you could post what exactly you are trying to do (execute a file,

Re: Looking for help with a python-mode/pdbtrack/gdb patch

2005-06-04 Thread =?ISO-8859-1?Q?Tiago_St=FCrmer_Daitx?=
Unfortunatly the only tip I can give you is that there's a list for mode-python in http://mail.python.org/mailman/listinfo/python-mode, but you probably already know about it. Regards, Tiago S DaitxOn 6/4/05, Skip Montanaro [EMAIL PROTECTED] wrote: Can someone who uses Emacs's python-mode,

Re: Sorted List (binary tree) why no built-in/module?

2005-06-04 Thread =?iso-8859-1?Q?Fran=E7ois?= Pinard
[Alex Stapleton] Unless I've totally missed it, there isn't a binary tree/sorted list type arrangement in Python. Sometimes it might be preferable over using a list and calling list.sort() all the time ;) Well, after `some_list.sort()', `some_list' is indeed a sorted list. :-) You can use

Re: Importing and source structure troubles

2005-06-03 Thread =?ISO-8859-1?Q?Tiago_St=FCrmer_Daitx?=
The best way depends on how you have structured your program. From what you've told I believe that setting the directories like dir1 dir2 dir3 is a good approach. As for the import errors you're getting, check this section from the tutorial:

Re: compile python in release...

2005-06-03 Thread =?iso-8859-1?Q?Fran=E7ois?= Pinard
[mg] My problem is here : all the source files are compiled with the -g flag which might be the debug flag. (On the other hand, the option -DNDEBUG is defined : it's normal !) Then my question is : Is exist a flag/option to run the shell script named 'configure' allowing to remove the '-g'

Re: thread vs GC

2005-06-03 Thread =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Paul Rubin wrote: Any suggestions for the cleanest way to get rid of the thread? As Jeff explains, it is rather unlikely that GC will collect primegen objects, since the generating thread holds self as a local variable. You should make background_generator have explicit q and event arguments

Re: Newbie question: Allocation vs references

2005-06-02 Thread Stian =?iso-8859-1?Q?S=F8iland?=
On 2005-06-02 14:43:40, Jan Danielsson wrote: a = [ 'Foo', 'Bar' ] b = [ 'Boo', 'Far' ] q = [ a, b ] Or, better yet, how do I store a and b in q, and then tell Python that I want a and b to point to new lists, without touching the contents in q? There are several ways to create a copy

Re: python 2.4: tarfile tell() and seek() seem to be broeken

2005-06-02 Thread =?iso-8859-1?q?Lars_Gust=E4bel?=
On Wed, 01 Jun 2005 14:58:23 +0200, N. Volbers wrote: - subsequent calls of fd.readline() and fd.tell() will yield the correct lines but always the same value from fd.tell(). Is there a mistake on my side or does this need fixing? This is a bug. Although the pseudo file object's

Re: avl tree

2005-06-01 Thread =?utf-8?q?Berthold_H=C3=B6llmann?=
Zunbeltz Izaola [EMAIL PROTECTED] writes: On Tue, 31 May 2005 22:40:19 +0200, Berthold Hllmann wrote: You can grab it from http://starship.python.net/~bhoel/avl-2.1.0.tar.gz Thanks i will play with it. But i have realize that what i need was exactly a binary tree. I haven't used

Re: avl tree

2005-05-31 Thread =?utf-8?q?Berthold_H=C3=B6llmann?=
Zunbeltz Izaola [EMAIL PROTECTED] writes: On Mon, 30 May 2005 21:13:57 +0200, Berthold Hllmann wrote: I'm afraid you won't be happy with the code. It's very old and likely won't compile. We have an inhouse version of this module which compiles and run on Sparc solaris (32 Bit) and linux

Re: Python 2.5 CVS broken for HP-UX platform?

2005-05-31 Thread =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
mg wrote: While trying to compile Python 2.5 from the nighlty CVS image, it raises the following errors on HP-UX. This disables me the use of HP-UX for some projects: Please submit patches to sf.net/projects/python. Thanks, Martin -- http://mail.python.org/mailman/listinfo/python-list

ANN: Version 0.9 of RUR-PLE

2005-05-31 Thread =?ISO-8859-1?Q?Andr=E9_Roberge?=
Version 0.9 of RUR: a Python Learning Environment has been released. Information about RUR-PLE can be obtained at http://rur-ple.sourceforge.net Note that the project website is slightly out of date. Among the changes in this new version: ***Spanish translation added.* Changed image for