We are looking for Python experts with strong knowledge of web
technologies, RDBMS, UNIX, object-oriented development. Experience in
django,
sqlalchemy, CORBA, memcached, jquery and development of scalable
high-prefomance applications is a plus. Compensation is above the
market.
If you are interes
me error.
I believe it's due to PyFile_FromString failing to open non-existent
file. You must check return value of it.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
ot going to use it anymore.
> I've noticed that the PyObject returned by PyInstance_New has refcount = 2,
> does this have any significance?
The code below prints 1:
PyObject *obj = PyInstance_New(PyExc_Exception, 0, 0);
std::cerr << obj->ob_refcnt << "\n&qu
a");
> dict = PyModule_GetDict(module);
> A = PyDict_GetItemString(dict, "A");
> /* FIXME: Create obj as instance of A (a = A()) */
> obj = ???
obj = PyObject_CallObject(A, NULL);
>
> foo = PyObject_GetAttrString(obj, "foo");
> args = Py_
used
%End
%PostInitialisationCode
PyDateTime_IMPORT;
%End
But I wonder why PyDateTimeAPI is declared static, and is the a better
solution?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
t output
> eg 203.199.200.0
> 203.33.20.0
>>> for ip in ('203.199.200.0', '203.33.20.0'):
... print '%15s' % ip
...
203.199.200.0
203.33.20.0
>>> for ip in ('203.199.200.0', '203.33.20.0'):
... print ip
YouExceptionClass = PyErr_NewException("YourModule.YourException", 0, 0);
2. Add it to module dictionary.
3. In wrapper for my_cpp_function use something like the following
code:
try {
my_cpp_function_impl();
} catch (YouException &exc) {
PyErr_SetString(YouExceptionClass, exc
gument 1 must be string or read-only buffer,
T> not list
Exactly as error message states: the second argument to Request must be
string, not list. You have to encode the body manually.
T> Tried the script from
T> http://fabien.seisen.org/python/urllib2_multipart.html
T> also
T> Gett
Py_DECREF(obj);
return NULL;
}
PyObject_GC_Track(obj);
return (PyObject *)obj;
}
PyTypeObject Your_Type = {
PyObject_HEAD_INIT(&PyType_Type)
# ...skipped...
offsetof(YourObject, dict), /* tp_dictoffset */
# ...skipped...
}
--
D
se "item in dict" because it's quite readable to me,
SB> and generally faster.
For me dictionary is a collection of key-value pairs, but not a
collection of keys (that's what set is).
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
quot; and "for item in dict") are related of course,
since the following should pass:
for item in d:
assert item in d
That's the reason why I always prefer to use has_key() and iteritems()
to in and iter(). Readability counts.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
t clear.
I had similar problems and solved them using some tricks with
image.info['transparency'] and image.palette. Unfortunately I can't
find this example, so if you succeed please post solution here.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
ok for modules in this
directory. See http://python.org/doc/current/api/embedding.html#l2h-40
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
t encode_base64
encode_base64(attachment)
msg.attach(attachment)
# using popen is unsafe if we can't trust fromaddr, using subprocess
from subprocess import Popen, PIPE
mailfl = Popen(['/usr/bin/nullmailer-inject', '-f', fromaddr],
stdin=PIPE)
mailfl.stdin.write(msg.as_string())
mailfl.stdin.close()
mailfl.wait()
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
de the module spam itself, what I've to
K> pass to setattr as first argument?
globals()[name] = value
or
setattr(__import__(__name__), name, value) # note, circular import here
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
default=v) alternative? Not sure whether it's
good idea to overload get() method, just an idea.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
For
positive integers you can pack keys with struct.pack('>I', value).
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
999.999.999 (something which could not
> possibly be an IPv4 address). Can re.compile be configured to filter
> results like this out?
Try this one:
re.compile(r'\b%s\b' % r'\.'.join(['(?:(?:2[0-4]|1\d|[1-9])?\d|25[0-5])']*4))
--
Denis S. Otkidach
http://www.p
logging/config.py to
> something like:
>
> import dummy_thread as thread, dummy_threading as threading
I believe it's a bug and logging/config.py should use the same approach
as logging/__init__.py do:
try:
import thread
import threading
except ImportError:
thread
most distributions:
>>> for c in u'\xb5\xba\xe4\u0430': print c.isalpha(),
...
True True True True
And in SuSE 9.2:
>>> for c in u'\xb5\xba\xe4\u0430': print c.isalpha(),
...
False False False False
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
be shipped as "python").
You are right. But isalpha behavior looks strange for me anyway: why
cyrillic character '\u0430' is recognized as alpha one for de_DE locale,
but is not for C?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
hon test_re.py
doesn't pass. $LANG doesn't matter if I don't call setlocale.
Fortunately setting any non-C locale solves the problem for all (I
believe) unicode character:
>>> re.compile(ur'\w+', re.U).findall(u'\xb5\xba\xe4\u0430')
[u'\xb5\xba
: http://www.suse.de/feedback
URL : http://www.python.org/
Summary : Python Interpreter
BTW, where have they found something with Artistic License in Python?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 10 Feb 2005 16:23:09 +0100
Daniel Dittmar <[EMAIL PROTECTED]> wrote:
> Denis S. Otkidach wrote:
>
> > On all platfroms \w matches all unicode letters when used with flag
> > re.UNICODE, but this doesn't work on SuSE 9.2:
>
> I think Python on SuSE 9.
E'
>>> re.compile(ur'\w+', re.U).match(u'\xe4')
<_sre.SRE_Match object at 0x40375560>
But I see nothing related to implicit re.L option in their patches and
the sources themselves are the same as on other platforms. I'd prefer
to find the source of problem.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 10 Feb 2005 13:00:42 +0300
"Denis S. Otkidach" <[EMAIL PROTECTED]> wrote:
> On all platfroms \w matches all unicode letters when used with flag
> re.UNICODE, but this doesn't work on SuSE 9.2:
>
> Python 2.3.4 (#1, Dec 17 2004, 19:56:48)
> [GCC 3
x27;ve looked through all SuSE patches applied, but found nothing related.
What is the reason for broken behavior? Incorrect configure options?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
>>> def consecutive_sets(l):
... for i in xrange(2, len(l)):
... for j in xrange(0, len(l)-i+1):
... yield l[j:j+i]
...
>>> list(consecutive_sets([1,2,3,4]))
[[1, 2], [2, 3], [3, 4], [1, 2, 3], [2, 3, 4]]
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
x(0, (666-255*2)-a), 256):
for c in xrange(max(0, (666-255)-a-b), min(666-a-b+1, 256)):
d = 666-a-b-c
...
I've checked these IPs with ip2cc (which can miss entries registered
last month): there are 2907248 "evil" addresses, most of them (1568430)
in U
ng parameters via shell (shell=True), than just use
os.system. Nevertheless below is correct example of subprocess usage
with stdout redirected to file:
out_fp = open('wall0.TRANS.rad', 'wb')
subprocess.call(['c:\\Radiance\\bin\\xform.exe',
'
v(os.P_WAIT, path, ('xform', args))
This corresponds to
c:\Radiancein\ '-t 0 8 0' wall0.rad '>' wall0.TRANS.rad'
command line.
> here's the cmd error message:
> xform: cannot find file ">"
Don't understand how you got t
On Wed, 08 Dec 2004 20:42:09 +1000
"Egor Bolonev" <[EMAIL PROTECTED]> wrote:
> i want to detect "'s"
Junctions are just mount points, not symbolic links. Dunno how to
detect them in Windows.
http://support.microsoft.com/default.aspx?scid=kb;en-us;
styles a given
> API supports.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278612
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
ion. The proper way is:
try:
while True:
os.waitpid(-1, 0)
except OSError, exc:
if exc.errno!=errno.ECHILD:
raise
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
zip import GzipFile
from cStringIO import StringIO
GzipFile(fileobj=StringIO(data)).read()
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
(
Is it valid? Have you tried "locale -a | grep nb_NO"?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
36 matches
Mail list logo