how to debug when "Segmentation fault"

2005-10-04 Thread Maksim Kasimov
p. Python 2.2.3 FreeBSD -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to debug when "Segmentation fault"

2005-10-04 Thread Maksim Kasimov
there are a lot of packeges under suspicion: cPickle, select, threading, logging, socket, struct Michael Ekstrand wrote: > On Tuesday 04 October 2005 11:13, Maksim Kasimov wrote: > >>my programm sometime gives "Segmentation fault" message (no matter >>how long the

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Maksim Kasimov
m crashed using gbd : > > $ gdb --core=core. > > Then, depending on the debug information you have in your executables > you may (or may not) be able to know what happened :) > > Pierre -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent logging warning?

2005-10-05 Thread Maksim Kasimov
ogger "comtypes.client"' when the > script runs? > > I would like to setup the logging so that there is no logging when > nothing is configured, and no warning messages are printed. > > Thomas -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Maksim Kasimov
any output >>> dir(code) ['__class__', '__cmp__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__repr__', '__setattr__', '__str__'

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Maksim Kasimov
\Python24/python.exe foo.py > > Program received signal SIGSEGV, Segmentation fault. > 0x1e027b23 in ?? () > (gdb) bt > #0 0x1e027b23 in ?? () > #1 0x00977240 in ?? () > #2 0x1e1a82b8 in ?? () > Cannot access memory at address 0x7 > (gdb) > > How ca

Re: can we save print msg into a file when script running ?

2005-10-12 Thread Maksim Kasimov
rection ? > > one million tks~ > script.py >> script.log 2>&1 -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: select.select() on windows

2005-10-26 Thread Maksim Kasimov
waiting for more > bytes. So what I would like is to timeout...and select.selec() seems > to be what I need. Except I don't have a socket, i have stdout. > > Any suggestions on how to do a timeout like select.select with stdout? > > Thanks > -- Best regards, Ma

Re: Pickle to source code

2005-10-26 Thread Maksim Kasimov
heel, I wonder if anyone knows of a > library which could do what I want? > > Thanks, > Gabriel Genellina > Softlab SRL > -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: select.select() on windows

2005-10-27 Thread Maksim Kasimov
yes, i missed, sorry Dennis Lee Bieber wrote: > On Wed, 26 Oct 2005 11:29:17 +0300, Maksim Kasimov > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>you have to use non-block readining. >> >>http://docs.python.org/lib/module-sel

Re: Splitting a string into groups of three characters

2005-08-08 Thread Maksim Kasimov
ello World",3) > > Returns: > > ['Hell','o W','orl','d'] > > > Any reply would be truly appreciated. > > Thank You, > -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

don't understand instanse creation

2005-08-09 Thread Maksim Kasimov
[2005, 8, 9, 16, 25, 18, 1, 221, 1] >>> >>> >>> m2 = my.my() __data1: [] __data2: [2005, 8, 9, 16, 25, 18, 1, 221, 1] __data1: [2005, 8, 9, 16, 25, 18, 1, 221, 1, 2005, 8, 9, 16, 25, 25, 1, 221, 1] __data2: [2005, 8, 9, 16, 25, 18, 1, 221, 1, 2005, 8, 9, 16, 25, 25, 1,

Re: don't understand instanse creation

2005-08-09 Thread Maksim Kasimov
i see, thaks you very match! Dan Sommers wrote: > On Tue, 09 Aug 2005 16:39:51 +0300, > Maksim Kasimov <[EMAIL PROTECTED]> wrote: > > >>Hello, > > >>i have a class, such as below. >>when i try to make instances of the class, >>fields __data1 an

logging into one file problem

2005-09-05 Thread Maksim Kasimov
very inconvenient, because in main script, i'm not importing all the modules (some modules imported by other modules). thanks for help. Python 2.2.3 FreeBSD -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

signal.SIGHUP handling

2005-09-09 Thread Maksim Kasimov
ted system call": # all i need to do it is reopen log-file. # It was opened at the time of pragramm start def myHandler(signum, frame): sys.stdout = sys.stderr = open("mylog.log", "a+") signal.signal(signal.SIGHUP, myHandler) -- Best regards, Maksim Kasimov mailto: [EMA

python equivalent of php implode

2005-04-26 Thread Maksim Kasimov
uot;.implode(", ", array_keys($query_param)).") VALUES ('".implode("','", $query_param)."')"; how it can be done, using python (elegantly, without cycles)? -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: python equivalent of php implode

2005-04-27 Thread Maksim Kasimov
... but not in the case when integers are in a dictionary (please, try to execute your example by yourself first) "Ola Natvig" <[EMAIL PROTECTED]> wrote: news:[EMAIL PROTECTED] > Maksim Kasimov wrote: > > > > in php-scripts, to insert data t

Re: python equivalent of php implode

2005-04-27 Thread Maksim Kasimov
done. thanks Try another paramstyle (see http://python.org/peps/pep-0249.html), e. g. ",".join(["%s"] * len(keys)) ... instead of ",".join(["?"] * len(keys)) ... Peter -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Can .py be complied?

2005-04-27 Thread Maksim Kasimov
ble), the jar-files are also necessary for processing by obfuscators -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive web graphics

2005-04-28 Thread Maksim Kasimov
is a > wide-spread browser plugin with interactive and multimedia capabilities. > But how to do it in flash I've no idea - after all I'm a pythoneer. > > Alternatively, SVG might be an option - but I'm not sure if its mature and > powerful enough. > > -- &g

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Maksim Kasimov
o. as far i know, it is depends on implementation of method "__iter__" of the object that "open()" returns, so another question: where i can find such an information (about how does such a functions works)? -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: large dictionary creation takes a LOT of time.

2005-04-30 Thread Maksim Kasimov
sorry for my question, but i've read the documentation, and can't find where is the explanation of how it is exactly works (but of course i do believe you). If it is buit in function, can i see the source code of the method to find it out? Kent Johnson wrote: Maksim Kasimov wrote: Ke

Re: Subclassing socket

2005-12-20 Thread Maksim Kasimov
conn, addr = socket.accept() > > return ( conn, addr ) > > Does anyone have any suggestions on how to do the above? > -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

BaseHTTPRequestHandler: how to read/write until diconnected

2006-07-13 Thread Maksim Kasimov
rfile.read( contentLength ) ... self.wfile.write( respContent ) many thanks for help. -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

How set the source IP adress

2006-10-27 Thread Maksim Kasimov
Hi, how to set source ip-address when do __socket.connect((host, port)) on a machine that have a several ip-adresses? many thanks for advice. __socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) __socket.connect((host, port)) -- Maksim Kasimov -- http://mail.python.org/mailman

Re: Iterating over several lists at once

2006-12-13 Thread Maksim Kasimov
s: > > for x1 in l1, x2 in l2, x3 in l3: > print "do something with", x1, x2, x3 > > However, this code obviously doesn't work... > > > I'd be very happy to receive ideas about how to do this in one loop and > with minimal initialization (if at all required). > > Thanks in advance, > Gal > -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

Re: How to manage two (different) sockets without using threads?

2006-12-13 Thread Maksim Kasimov
yncore/asynchat > modules. > FTP tipically got two different channels: command and data. > I'm succesfully managing command channel through asynchat framework, > but I'm not sure about how to manage data channel without using a > thread/subprocess. > Is there an optimal

Re: Non greedy regex

2006-12-14 Thread Maksim Kasimov
27; ) [EMAIL PROTECTED] wrote: > Can someone please explain why these expressions both produce the same > result? Surely this means that non-greedy regex does not work? > > print re.sub( 'a.*b', '', 'ababc' ) > > gives: 'c' >

Re: __getattr__ possible loop

2006-12-28 Thread Maksim Kasimov
def __getattr__(self, x): if x == '__members__': return ('method1', 'field1', ) -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__ possible loop

2006-12-28 Thread Maksim Kasimov
[EMAIL PROTECTED] wrote: > Maksim Kasimov: >> how to improve the situation depends on what do you expect to get by calling >> "T().method()" > > You are right, sorry for being cryptic. I think that's a kind of bug of > Python (produced maybe by an inf

Re: __getattr__ possible loop

2006-12-28 Thread Maksim Kasimov
f __getattr__(self, attr): >raise SystemExit, "Don't call me, again, ever" > > f = Foo() > f.method() #dies correctly > dir(f) #continues happily can't understand - what kind of problem you tried to fix in that way? if __getattr__ just raise some exception, it

Re: Manipulating mailboxes

2005-05-23 Thread Maksim Kasimov
o clumsy. Is there a way to delete/add messages to > mailboxes of different users, directly? > > Thanks, > > Laci 2.0 > -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to import a module from a arbitraty path?

2005-05-26 Thread Maksim Kasimov
Andy Leszczynski wrote: > I have a program which is going to dynamicly load components from some > arbitrary defined paths. How to do that? > > A. import sys sys.path.append('/yourpath/libs') -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.pytho

date and time range checking

2005-06-02 Thread Maksim Kasimov
n periods range? something like xrange: >>> a = xrange(1,5) >>> b = 3 >>> if b in a: ... print "OK" thanks -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

different time tuple format

2005-06-07 Thread Maksim Kasimov
right", "credits" or "license" for more information. >>> import time >>> time.strptime("2005-06-07 21:00:00", "%Y-%m-%d %H:%M:%S") (2005, 6, 7, 21, 0, 0, 6, 1, 0) >>> time.localtime() (2005, 6, 7, 21, 2, 39, 1, 158, 1) >>

Re: different time tuple format

2005-06-07 Thread Maksim Kasimov
;%Y-%m-%d %H:%M:%S %Z") > (2005, 6, 7, 15, 7, 12, 1, 158, 1) does not work at all: "ValueError: format mismatch" i've check the value of time.tzname: ('EET', 'EEST') and get the following (again): >>> time.strptime("2005-06-07 15:07:12 EE

Re: different time tuple format

2005-06-08 Thread Maksim Kasimov
TECTED]:~ $ python > ** Python 2.4.1 (#2, Mar 30 2005, 21:51:10) > ** [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 > ** Type "help", "copyright", "credits" or "license" for more > information. > ** >>> import time > ** >>> print time.tzname > ** ('CET', 'CEST') > ** >>> time.strptime("2005-06-07 15:07:12 CET", "%Y-%m-%d %H:%M:%S %Z") > ** (2005, 6, 7, 15, 7, 12, 1, 158, 0) > ** >>> time.strptime("2005-06-07 15:07:12 CEST", "%Y-%m-%d %H:%M:%S > %Z") > ** (2005, 6, 7, 15, 7, 12, 1, 158, 1) > ** >>> > -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: different time tuple format

2005-06-08 Thread Maksim Kasimov
information. > *** >>> import time > *** >>> print time.tzname > *** ('W. Europe Standard Time', 'W. Europe Daylight Time') > *** >>> > -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: different time tuple format

2005-06-09 Thread Maksim Kasimov
:%M:%S")) > > print time.ctime(t) > > offset = time.timezone > if time.daylight: > offset = time.altzone > t += offset > print time.ctime(t) > -- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: just a bug

2007-05-25 Thread Maksim Kasimov
r than encoding and then splitting, > it needs to split first and then encode, or take some other measures to > make sure that it doesn't leave incomplete multibyte sequences at the > end. > > HTH, > -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

Re: just a bug

2007-05-25 Thread Maksim Kasimov
ent can not be converted to unicode until reciever program will get all parts of the utf-string from sender. the xml in iMessage is absolutely correct. Please read my previous posts. thanks. -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

Re: just a bug

2007-05-25 Thread Maksim Kasimov
me on a contradiction in my message. Isn't it. Try to browse any file with garbage with "xml" extension. If you do, then you will see error message of XML-parser. I insist - my message is correct and not contradicts no any point of w3.org xml-specification. -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

Re: just a bug

2007-05-25 Thread Maksim Kasimov
i know it :)) can you propose something to solve it? ;) -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

Re: just a bug (done)

2007-05-25 Thread Maksim Kasimov
uot;ISO-8859-1" (but using the lib it is another problem: to recode/retest/redoc/re* a lot of things) the project homepage: http://www.garshol.priv.no/download/software/xmlproc/ and another thing: I've open my xml-message in Mozilla again, in pop-up menu select "Pag

is it bug or feature in xml.dom.minidom?

2007-03-02 Thread Maksim Kasimov
properly way, but IMHO it looks like a bug. My question is how to avoid the "iSourseTag" changes while iterate its nodes? And, of course, how to append all child nodes to "iTargetTag"? Thank for any help. -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list

__getattr__ equivalent for a module

2007-01-15 Thread Maksim Kasimov
;anyattribute" is not actually defined in the module, but gives some attribute of the module so my question is: how to tune up a module get default attribute if we try to get access to not actually exists attribute of a module? (python 2.4 or 2.2) many thanks for help. -- Maksim Kasimov

Re: __getattr__ equivalent for a module

2007-01-15 Thread Maksim Kasimov
Hi Leif, many thanks - it works Leif K-Brooks wrote: > Maksim Kasimov wrote: >> so my question is: how to tune up a module get default attribute if we >> try to get access to not actually exists attribute of a module? > > You could wrap it in an object, but that's a