Interesting socket behavior

2014-10-07 Thread Christian Calderon
I noticed that if I make a listening socket using SOCK_STREAM | SOCK_NONBLOCK, that the sockets I get after calling listener.accept() don't have the O_NONBLOCK flag set, but checking the result of gettimeout() on the same sockets gives me 0.0, which means they are non blocking. Why is this the case

Flask and Django

2014-10-10 Thread Juan Christian
So, I'm already familiar with Flask and I fell comfortable using it, but I see that no one uses it in "real business", everywhere I look regarding jobs and web dev, people always talk about Django, no one mentions Flask, no one uses Flask. I'm coding a personal tool using Flask but I feel the need

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread Christian Gollwitzer
/ize-ise-or-yse Being a non-native English speaker/writer, I myself stick to the recommendations of the Oxford dictionary. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Flask and Django

2014-10-12 Thread Juan Christian
Anyone? On Fri, Oct 10, 2014 at 7:22 PM, Juan Christian wrote: > So, I'm already familiar with Flask and I fell comfortable using it, but I > see that no one uses it in "real business", everywhere I look regarding > jobs and web dev, people always talk about Django, no

Re: Is there an easy way to control indents in Python

2014-10-14 Thread Juan Christian
Using PyCharm is easy: File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste > choose "Reformat Block" On Tue, Oct 14, 2014 at 11:13 PM, ryguy7272 wrote: > I'm just learning Python. It seems like indents are EXTREMELY important. > I guess, since there are no brackets, everyt

Re: Is there an easy way to control indents in Python

2014-10-20 Thread Juan Christian
Ok, new code using ?: import sqlite3 db = sqlite3.connect('db.sqlite') def create_db(): db.execute(''' CREATE TABLE TOPICS( ID INT PRIMARY KEY NOT NULL, URL VARCHAR NOT NULL, AUTHOR VARCHAR NOT NULL, MESSAGE VARCHAR NOT NULL ); ''') def insert_db(_id, url, auth

Re: Is there an easy way to control indents in Python

2014-10-20 Thread Juan Christian
Sorry guys, my post about SQL was not meant to be here!!! On Mon, Oct 20, 2014 at 5:43 PM, MRAB wrote: > On 2014-10-20 20:04, Juan Christian wrote: > >> Ok, new code using ?: >> >> import sqlite3 >> >> db = sqlite3.connect('db.sqlite') >> >

Re: Need some experience

2011-09-13 Thread Christian Heimes
Am 13.09.2011 22:52, schrieb Tim Hanson: > That's not a bad idea. From the past I know that bug fixing is a great way > to > learn a language. If you know a specific site to key in on, feel free to > send > me there. Otherwise I'll poke around the Python site and find it. It's a great idea.

help for the parse of encrypted excel

2011-09-19 Thread Christian Ren
I used xlrd library for the parse of excel before. But now, I encounter a problem that the file has been encrypted for some security reason. On the official website, i found "xlrd will not attempt to decode password-protected (encrypted) files. " :(( And I also tried another library called pyExcele

Re: Python 2.5 zlib trouble

2011-09-23 Thread Christian Heimes
l last): > File "", line 1, in > ImportError: No module named zlib Are you running a self-compiled installation of Python 2.5 on recent Debian or Ubuntu? Check out my blog http://lipyrary.blogspot.com/2011/05/how-to-compile-python-on-ubuntu-1104.html Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 zlib trouble

2011-09-24 Thread Christian Heimes
re is a big chance that the installer doesn't understand multiarch. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 zlib trouble

2011-09-24 Thread Christian Heimes
enough for old versions of Python. Anything older than Python 2.7.2 requires a tweak in order to make Python find the shared libraries. It's all explained in my blog posting. Debian's new multiarch features has broken Python's main setup.py because it tries to find the libraries it

Re: Memory

2011-10-07 Thread Christian Heimes
Am 07.10.2011 21:39, schrieb Frank Ruiz: > Quick question, > > What is the best way for pulling resource information for a system > running linux? Was wondering if there was a python only way. > > Methods I am aware of are: > > 1. Parsing contents of /proc > 2. Running a system command like free

os.startfile: Why is there no arguments option?

2011-10-12 Thread Christian Wutte
ut arguments of limited use. [1] http://docs.python.org/library/os.html?highlight=startfile#os.startfile Thanks, Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: os.startfile: Why is there no arguments option?

2011-10-12 Thread Christian Wutte
On Oct 12, 11:27 am, Thomas Rachel wrote: > Am 12.10.2011 10:22 schrieb Christian Wutte: > > > Hello all, > > as stated in the docs [1] os.startfile relies on Win32 ShellExecute(). > > So maybe someone can explain it to me, why there is no support for > > progra

Re: os.startfile: Why is there no arguments option?

2011-10-12 Thread Christian Wutte
. Then on error it is more comfortable that os.startfile already throws an WindowsError. [1] http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading: Method trigger after thred finished

2011-10-20 Thread Christian Heimes
w thread, not the new thread. Just the run() is executed in the new thread. I suggest that you acquire and close the connection inside the run() method protected by an try/finally or with block. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception Handling (C - extending python)

2011-10-23 Thread Christian Heimes
initialized in Objects/exceptions.c SimpleExtendsException(PyExc_StandardError, TypeError, "Inappropriate argument type."); SimpleExtendsException() is a macro that defines a PyTypeObject and stores a cast to PyObject in PyExc_TypeError. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: __dict__ attribute for built-in types

2011-10-28 Thread Christian Heimes
Am 28.10.2011 10:01, schrieb Steven D'Aprano: hasattr(int, '__dict__') # Does the int class/type have a __dict__? > True hasattr(42, '__dict__') # Does the int instance have a __dict__? > False Also __dict__ doesn't have to be an instance of __dict__. Builtin types usually have a dictp

Re: guppy

2011-11-09 Thread Christian Heimes
o my application. > > I am using Cygwin. Please show us the full error message with context. Are you using a Cygwin build of Python or a native Windows build? What GCC version and flavor are you using? I'm not sure if Cygwin is even supported. I recommend that you use MinGW with GC

Re: guppy

2011-11-09 Thread Christian Heimes
Am 09.11.2011 20:38, schrieb Juan Declet-Barreto: > I am using Cygwin build of Python2.6. This Cygwin install has both a Cygwin > gcc (versions 3.4.4 and 4.5.3) and mingw32 (3.4.4), as listed in lib/gcc/. > > I also tried the mingw32 shell separately, but I get the same results even > when I p

Re: The python implementation of the "relationships between classes".

2011-11-10 Thread Christian Heimes
Am 10.11.2011 17:09, schrieb Tim Wintle: >> Meanwhile, I have a ZODB running, which stores all the living >> objects. > > The ZODB is append only and stores all objects. Deleting references to > an object (which would causes deletion of standard python objects) won't > delete it from the zodb, it

Re: Py2.7/FreeBSD: maximum number of open files

2011-11-14 Thread Christian Heimes
Why do you need more than 32k file descriptors anyway? It's an insanely high amount of FDs. Most programs need less than 100 and the default value of 1024 on my Linux servers is usually high enough. I've never increased the fd limit over 8192 and our biggest installation servers more th

Re: Py2.7/FreeBSD: maximum number of open files

2011-11-14 Thread Christian Heimes
ystem is able and configured to handle more than 32k FDs but you hit an artificial limit because some C code or API has a overflow. This seems to be a known bug in FreeBSD http://lists.freebsd.org/pipermail/freebsd-bugs/2010-July/040689.html Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2.7/FreeBSD: maximum number of open files

2011-11-14 Thread Christian Heimes
built-in file type is developed around the file pointer API, not the file descriptor API. Luckily Python 2.7 has a backport of Python 3.x new IO library. The new IO API doesn't use file pointers at all and implements its own layer around file descriptors. Good luck! Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2.7/FreeBSD: maximum number of open files

2011-11-14 Thread Christian Heimes
t log files, you might want to overwrite the _open() method of logging.FileHandler and its subclasses. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2.7/FreeBSD: maximum number of open files

2011-11-14 Thread Christian Heimes
write unicode to a binary file and str to a text file. See it as an opportunity! You are taking the first step towards Python 3 compatibility. :) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: can't decompress data; zlib not available

2011-11-14 Thread Christian Heimes
sr/bin/python. Would this be the one I > reconfigure for zlib? You might have run into this [1] issue with Ubuntu 11.04+ and Python before 2.7.2. Christian [1] http://lipyrary.blogspot.com/2011/05/how-to-compile-python-on-ubuntu-1104.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple threads

2011-11-16 Thread Christian Heimes
nt approach: use a queue [1] and create two worker threads that consume the queue. You don't need multiprocessing because you are already using multiple processes here (one Python and two ffmpeg processes). Christian [1] http://docs.python.org/library/queue.html -- http://mail.python.org/mailman/listinfo/python-list

Re: try - except. How to identify errors unknown in advance?

2011-11-16 Thread Christian Heimes
or("test") ... except Exception: ... log.exception("some message") ... ERROR:mymodule:some message Traceback (most recent call last): File "", line 2, in ValueError: test Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Announcing Mii (My) Chat

2011-11-20 Thread Christian Heimes
s glossary a Mii is a player's avatar. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Server Questions (2 of them)

2011-11-20 Thread Christian Heimes
Am 20.11.2011 22:44, schrieb Hrvoje Niksic: > Andrew writes: > >> How to do you create a server that accepts a set of user code? > [...] > > Look up the "exec" statement, the server can use it to execute any code > received from the client as a string. > > Note "any code", though; exec runs in

Re: Choosing a Windows C compiler for use with Cython and 32-bit Python 2.7

2011-11-23 Thread Christian Heimes
etail. Summary: You can use the free VS 2088 Express Edition if you don't need PGO or AMD64 builds. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: memory leaks - tools and docs

2011-11-24 Thread Christian Heimes
ck down regressions more easily, too. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python crashes on segmentation error

2011-11-30 Thread Christian Heimes
that is causing the segfault. The segfault occurs either inside or during the import of the cv module. initcv() is the init function of the cv module that is called automatically during the import. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: How to install Python on Debian GNU/Linux (Python-2.7.2.tar.bz2)

2011-12-05 Thread Christian Heimes
uild-dep python2.7 Done ;) However there are additional pitfalls if you have multiarch support or Kernel 3.x. Both are well documented in my blog http://lipyrary.blogspot.com/ Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: How to install Python on Debian GNU/Linux (Python-2.7.2.tar.bz2)

2011-12-05 Thread Christian Heimes
and packages are missing if you install Python manually. Unless you *really* know what you are doing you shouldn't install Python manually. Debian's backports should provide a well integrated Python 2.7 package. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Verbose and flexible args and kwargs syntax

2011-12-11 Thread Christian Heimes
lass that subclasses both list and dict? Will it get the >> positional args, the keyword args, or both? > > Irrelevant, you can't subclass both list and dict: But you can fake it with __instancecheck__ and __subclasscheck__ methods. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Localhost client-server simple ssl socket test program problems

2011-12-15 Thread Christian Heimes
ssl..c:347: error:140B0002:SSL > routines:SSL_CTX_use_PrivateKey_file:system lib This error is most likely caused by an encrypted private key. Python's SSL lib doesn't support encrypted private keys for sockets. You can encrypt the private key with openssl rsa -in /etc/home/ckyan

Re: Localhost client-server simple ssl socket test program problems

2011-12-15 Thread Christian Heimes
valid CA cert chain. Python 2.x's SSL module doesn't support cert directories so you have to provide a chain file. The certs in the chain file must be in the right order, too. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Test None for an object that does not implement ==

2011-12-25 Thread Christian Heimes
ypes are not subclass-able on purpose. The feature isn't available to heap types. http://docs.python.org/c-api/typeobj.html#Py_TPFLAGS_BASETYPE Most people have never noticed the deliberate limitation because only a few special types are sub-classable. Christian -- http://mail.python.org

Re: Which libraries for Python 2.5.2

2011-12-27 Thread Christian Heimes
om/ to track down missing DLLs. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Using an OrderedDict for __dict__ in Python 3 using __prepare__

2012-01-08 Thread Christian Heimes
PyDict_Type subclass and always returns a PyDictObject. However you can use the __prepare__ hook to *remember* the order of insertion, see http://docs.python.org/py3k/reference/datamodel.html#customizing-class-creation Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: How to remove ellipses from long paths in traceback?

2012-01-12 Thread Christian Heimes
#x27;t look like an ellipses to me. An ellipses has three dots "...". It might be an unnormalized path. In paths two dots mean parent directory, so the path references C:/Python26/bin/tk85.dll. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Hash stability

2012-01-16 Thread Christian Heimes
Am 16.01.2012 09:18, schrieb Peter Otten: > I've taken a quick look into the suds source; the good news is that you have > to change a single method, reader.Reader.mangle(), to fix the problem with > hash stability. > > However, I didn't see any code to deal with hash collisions at all. It sme

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Christian Heimes
t that command as a package name. It usually works. Much easier: $ apt-get build-dep python In general the 'build-essential' package provides almost every part of the build chain (compilers, make, autotools, yacc & friends): $ apt-get install build-essential Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: subclassable types

2013-02-22 Thread Christian Heimes
Am 22.02.2013 10:35, schrieb Wolfgang Maier: > Also: can you use introspection to find out whether a type is valid as a > base type? I don't think so. For CPython the information is stored in the type's structure. When type->tp_flags & Py_TPFLAGS_BASETYPE is true then subclassing is allowed. But I

Re: python 3 problem: how to convert an extension method into a class Method

2013-02-26 Thread Christian Heimes
Am 26.02.2013 21:19, schrieb Ethan Furman: > Dumb question, but have you tried just assigning it? In Py3 methods are > just normal functions... > > 8<-- > class A(): > pass > > A.method = c_method > 8<-- That doesn't work with builtin functions

Re: Python newbie trying to embed in C++

2013-02-27 Thread Christian Gollwitzer
Am 27.02.13 09:51, schrieb Marwan: And I'd appreciate it if you could give me pointers to how to easily call Python from C++. Maybe you can use boost::python? http://www.boost.org/doc/libs/1_53_0/libs/python/doc/ Cave: I haven't used it and don't know if it is up-to-date.

Re: Python Speed

2013-02-27 Thread Christian Heimes
00 loops, best of 3: 0.663 usec per loop ./python -R -m timeit -n 1000 '{};{};{};{};{};{};{};{};{};{}' 1000 loops, best of 3: 0.382 usec per loop (./python is a patched 3.3 dev version) Christian [1] http://www.python.org/dev/peps/pep-0412/ [2] http://bugs.python.org/issue16465 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script not working on windows 7 but works fine on linux

2013-03-04 Thread Christian Gollwitzer
ctually reading that error message? You have an absolute path in script! This /home/io... would something like C:/btc_trading/... on Windows. This is not a Python question, it is a Linux/Windows question. Ask your local IT guy. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting list() un-optimization

2013-03-07 Thread Christian Heimes
ome optimizations and preallocations, too. >>> i = iter(range(10)) >>> i.__length_hint__() 10 See http://www.python.org/dev/peps/pep-0424/ Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Christian Gollwitzer
line with the error, and it looks a little odd. Yes, the second line is supposed to add the text. Think about it. "delete" is not going to add text. You want "insert" instead. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Excel column 256 limit

2013-03-18 Thread Christian Gollwitzer
r instance. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter: invisible PanedWindow "sashes" on OS X

2013-03-21 Thread Christian Gollwitzer
ls are small and have no visible border. Try using e.g. a text widget instead (or maybe relief=SUNKEN) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Surrogate pairs in new flexible string representation

2013-03-29 Thread Christian Heimes
compatibility. The APIs expect a pointer to an existing and shared block of memory. They don't take ownership of the memory block and therefore don't free() it. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing soap result

2013-04-17 Thread Christian Heimes
Am 17.04.2013 19:55, schrieb darnold: > On Apr 17, 8:50 am, Ombongi Moraa Fe > wrote: > >> how do I use xml.etree.ElementTree to print the parameters address and >> deliveryStatus? Or is there a better python method? >> > > > I'm sure there are prettier ways to do this, but you can use XPath >

Re: Confusing Algorithm

2013-04-22 Thread Christian Gollwitzer
wer is the "convex hull" of the set of points given by the tower height. The convex hull can be computed for this 1D problem by initializing with line segments between every point and repeatedly pulling up every non-convex piece, if I'm not mistaken. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Drag and drop in Windows

2013-04-29 Thread Christian Gollwitzer
n. Usual events store the MouseWheel distance in this field; so maybe you can get it from the field event.delta. I can't test it now, but I am a bit skeptical whether this works with the guts of TkInter. If not, you'd need to do some more forwarding from the Tcl side. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Drag and drop in Windows

2013-04-30 Thread Christian Gollwitzer
Hi Robert, Am 30.04.13 10:39, schrieb Robert Flintham: Thanks Christian. I've tried the following code: import Tkinter root = Tkinter.Tk() root.title("DICOM Opener") root.tk.eval('lappend auto_path {K:/Python27/Lib/site-packages/tkdnd2.6}') root.tk.ev

Re: Drag and drop in Windows

2013-05-01 Thread Christian Gollwitzer
suspicious that Tk/Tkinter has its own library somewhere. Does it do a "package require?" In that case, check your auto path tk.eval('set auto_path') Tcl looks for the libs in the folders listed there. Christian - you were right. The TkDND DLL looks to be for x64.

Re: Red Black Tree implementation?

2013-05-02 Thread Christian Heimes
e for academic research in order to study the properties of a rbtree. If you need something production ready then you have to use an implemetation with an optimized backend like a C code, PyPy or Cython. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Please enlighten me about PyPy

2005-12-25 Thread Christian Tismer
nce to produce a small, useful tool for the ambitioned developer. Not making his task trivial, as PyPy will, but considerably simpler than writing C. merry christmas -- chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a

Re: Please enlighten me about PyPy

2005-12-25 Thread Christian Tismer
Christian Tismer wrote: > This is not trying to split apart from PyPy, or to short-cut its > goals. I'm completely with PyPy's goals, and it will do much > more than RPython translation ever will, this is out of question. Of course I meant "this is beyond question&qu

Re: How to avoid "f.close" (no parens) bug?

2005-12-25 Thread Christian Tismer
e user by sticking with parentheses(). Caling the suqresum() method should not be turned into a property, since such a thing isn't cheap in most cases. Not to speak of functions which have side-effects. merry christmas - chris -- Christian Tismer :^) <mailto:[EMA

Re: python coding contest

2005-12-25 Thread Christian Tismer
clearly make the results more enjoyable... cheers - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A :*Starship* http://starship.python.net/ 14109 Berlin

Re: python coding contest

2005-12-25 Thread Christian Tismer
aving this said, I'm trashing my one-liner :-)) if-it-doesn't-look-like-Python-it-is-not-Python - ly y'rs -- chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-W

Re: Please enlighten me about PyPy

2005-12-25 Thread Christian Tismer
ies productive in using PyPy, we will create enough funding for the time after 2006 to make PyPy survive for a long time, and creating tools like this will become a self-running motor for PyPy. A matter of good balancing :-) merry christmas -- chris -- Christian Tismer :^) <mailto:

Re: python coding contest

2005-12-25 Thread Christian Tismer
Tim Hochberg wrote: > Christian Tismer wrote: ... >> - Squeezing many lines into one using semicola does not help, >>the program will be expanded to use one statement per line >> >> - blank lines are allowed and not counted if they are not >>needed a

Re: python coding contest

2005-12-25 Thread Christian Tismer
econd challenge :-) -- chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A :*Starship* http://starship.python.net/ 14109 Berlin : PGP key -> htt

Re: python coding contest

2005-12-26 Thread Christian Tismer
th 44 chars. But I simply cant see how to get below that. And I think this is not the wanted solution at all, which is why I have no problem posting it here :-) ciao - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Tak

Re: python coding contest

2005-12-26 Thread Christian Tismer
Tim Hochberg wrote: > import test;seven_seg=test.test_vectors.get Oupps, good (being blinded after all the other from imports and __import__(...) ) -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take

Re: python coding contest

2005-12-26 Thread Christian Tismer
finitively need a new algorythm. You need a more careful reading algorithm. We were talking about cheating by imports :-) -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A

Re: python coding contest

2005-12-27 Thread Christian Tismer
btw. might be that I'm not able to win this one, due to personal blocking. I can't really force myself to go all the ridiculous paths to save one byte. My keyboard blocks as well. Maybe I don't consider myself a hacker so much any longer :-) ciao - chris -- Christian Tismer

Re: python coding contest

2005-12-27 Thread Christian Tismer
;m not sure I will > understand my own code next month. And this time I'm sure at 99% that > I'm really stuck... Don't try harder! Sit back and think of what you're doing, and what you'd like to do, instead. And then help me to setup a different contest about

Re: python coding contest

2005-12-29 Thread Christian Tismer
Duncan Booth wrote: > Christian Tismer wrote: > >> And then help me to setup a different contest about content -- chris >> > Count me in. Great! Let's find a problem small enough to solve in reasonably time and large enough to exploit Python qualities. sincere

Re: python coding contest

2005-12-31 Thread Christian Tismer
dea if this is possible: One might try to re-order the character string a bit to change moduli, trying to get one more number in (3,14,10) to be one-digit. Haven't tried, yet, and chances are small. congrats again and a happy new year - chris -- Christian Tismer :^) <m

Re: python coding contest

2005-12-31 Thread Christian Tismer
on (thought of it, too, and the list comprehension eats one char) cheers - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A :*Starship* http://starship.python.n

Re: Compressing folders in Windows using Python.

2006-01-01 Thread Christian Tismer
d for windows. You might use winzip or something else, there is a bunch of different compression tools available. ciao - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Joh

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Christian Tismer
er the other. But this is not a ref to lst any longer, the list gets dereferenced before getting at its contents, and only references to that are returned. >if i==2: > i = 4 You now have i as a reference to 4, during this cycle. ciao - chris -- Christian Tismer :^

Re: Python function with **kwargs Question

2006-01-05 Thread Christian Tismer
hon to treat '-' as a normal character but not part of > an expression? By changing the parser :-) Keywords are limited to obey Python syntax. ciao - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Ta

Re: Python function with **kwargs Question

2006-01-05 Thread Christian Tismer
27;everything' a refrence or isn't it?" thread, which has turned into anything else but help for the original poster. ciao - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's J

Re: Stackless Python

2006-01-07 Thread Christian Tismer
the site. The list works :-) ciao - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A :*Starship* http://starship.python.net/ 14109 Berlin :

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-12 Thread Christian Tismer
t gets modified should in fact only trace changes to the dict, not to elements contained in the dict. So __repr__ is probably too much, and also not the intent. I'd just overwrite __setitem__ for write access to the dict. Enforcing tracking of all contents is hard (as you showed above) and probably n

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-13 Thread Christian Tismer
element's setattr is traced, too. ciao - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A :*Starship* http://starship.python.net/ 14109 Berlin

Re: How can I make a dictionary that marks itself when it's modified?

2006-01-13 Thread Christian Tismer
Steve Holden wrote: > Christian Tismer wrote: >> Just to add a word that I forgot: >> >> Adhering to the subject line, the intent is to track modifications >> of a dict. >> By definition, modification of a member of a dict without replacing >> the value is

Re: Newbie to XML-RPC: looking for advice

2006-01-13 Thread Christian Tismer
Sorry that this is just a partial answer. I should have more knowledge about twisted than I actually have. Hinting to check the imported stuff. cheers - chris -- Christian Tismer :^) <mailto:[EMAIL PROTECTED]> tismerysoft GmbH : Have a break! Take a ride

Re: excel in unix?

2006-08-10 Thread Christian Meesters
on my Linux machine and some students to teach, who didn't know anything of Linux. (And OpenOffice was not capable of doing what I wanted it to do, btw.) So I choosed pyExelerator in combination with PreExisting EXCEL-Sheets. Cheers, Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot import a module from a variable

2006-10-15 Thread Christian Joergensen
mportError: No module named i > > But it seems that import donot know what is i ? why? Try using __import__(i) instead. -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a commas-in-between idiom?

2006-11-05 Thread Christian Joergensen
6] >>> print ','.join(map(str, list)) 1,2,3,4,5,6 -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: finding the list of the matched strings

2006-11-05 Thread Christian Joergensen
s such a function. I would have written it using a list comprehension. >>> import re >>> ll = ('a', 'b', 's1', 's2', '3s') >>> p = re.compile('^s.*') >>> newList = [s for s in ll if p.match(s)] >>> newList ['s1', 's2'] -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: sound processing modules in python - anyone?

2006-11-07 Thread Christian Aastorp
ject/showfiles.php?group_id=156455 I believe that csound is a very mature and complete toolbox for music generation and sound manipulation. -- Christian Aastorp -- http://mail.python.org/mailman/listinfo/python-list

Status of optional static typing in Python?

2006-06-22 Thread Christian Convey
Hi guys, I'm looking at developing a somewhat complex system, and I think some static typing will help me keep limit my confusion. I.e.: http://www.artima.com/weblogs/viewpost.jsp?thread=87182 Does anyone know if/when that feature may become part of Python? Thanks very much, Chri

Re: better Python IDE? Mimics Maya's script editor?

2006-06-22 Thread Christian Convey
'm aware of). So for now, I've found just a plain old text editor, plus print statements, to be the right choice for me. -- Christian Convey Computer Scientist, Naval Undersea Warfare Centers Newport, RI (401) 832-6824 [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Status of optional static typing in Python?

2006-06-22 Thread Christian Convey
m looking for something like interfaces. But even if we disagree about the wisdom of my intentions, do you know if/when Guido's planning to work that stuff into Python? The last post I noticed from him on the topic was from 2005. At least back then he sounded pretty into it. Thanks, Christi

Anonymous dynamic import

2006-08-28 Thread Christian Convey
h the names of the modules I'm importing.Thanks,Christian -- http://mail.python.org/mailman/listinfo/python-list

Problem loading true-type font with PIL

2006-09-01 Thread Christian Stapfer
to PIL in order to be able to load true-type fonts? Could someone (more knowledgeable than myself as regards PIL and this true-type font loading business) please point me in the right direction? Many thanks in advance, Christian Stapfer -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem loading true-type font with PIL

2006-09-01 Thread Christian Stapfer
Christian Stapfer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > After switching from Python 2.3 to 2.4 (Enought), ^ I mean: Python Enthought Edition--Python 2.4.3 for Windows, sorry for that. I see in the documentatio

Re: Problem loading true-type font with PIL - "solved"

2006-09-02 Thread Christian Stapfer
Christian Stapfer wrote: > After switching from Python 2.3 to 2.4 (Enought), > PIL throws an exception that did not occur formerly > (under Python 2.3) when executing > >ImageFont.truetype(font, size) > A module seems to be missing: do I have to install something >

Re: Problem loading true-type font with PIL - "solved"

2006-09-03 Thread Christian Stapfer
Robert Kern wrote: > Fredrik Lundh wrote: >> Christian Stapfer wrote: >> >>> Problem "solved" by rudely installing PIL 1.1.5 for Windows and >>> Python 2.4 from http://www.pythonware.com/products/pil/ >>> right on top of my existing "Pyth

<    5   6   7   8   9   10   11   12   13   14   >