Re: I keep getting this error message when i try to run a program in Python

2018-03-22 Thread Damjan Stojanovski
i am sorry but i can not find a way to attach an image here so you can see what i mean. Please someone tell me how to add an image here. Thanks Dan -- https://mail.python.org/mailman/listinfo/python-list

I keep getting this error message when i try to run a program in Python

2018-03-22 Thread Damjan Stojanovski
Dear all I am totally new in learning Python and i am learning from a beginner's book called automate the boring stuff with Python and i downloaded the Python 64 bit version for Windows and i started writing some examples from the book. At the end whenever i try to run the program i keep gettin

Re: Confusing datetime.datetime

2012-07-08 Thread Damjan
good references of using good times in Python? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: why greenlet, gevent or the stackless are needed?

2012-07-07 Thread Damjan
a much larger memory address space footprint. There's one function, called the gevent hub, that waits for any I/O event and then switches to the function that "blocked" on that I/O. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Confusing datetime.datetime

2012-07-05 Thread Damjan
I recommend you report it as a bug against the pytz module. It returns True, so it seems to be changed in the datetime object?? I tried both 2.7 and 3.2 -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Confusing datetime.datetime

2012-07-05 Thread Damjan
On 05.07.2012 16:10, Damjan wrote: I've been struggling with an app that uses Postgresql/Psycopg2/SQLAlchemy and I've come to this confusing behaviour of datetime.datetime. Also this: #! /usr/bin/python2 # retardations in python's datetime import pytz TZ = pytz.timezone

Confusing datetime.datetime

2012-07-05 Thread Damjan
strftime('%s') '1341453600' -- TZ=Asia/Tokyo python >>> from datetime import datetime >>> import pytz >>> tz = pytz.timezone('Europe/Skopje') >>> dt = datetime.fromtimestamp(1341446400, tz) >>> dt datetime.datetime(2012, 7, 5, 2, 0, tzinfo=CEST+2:00:00 DST>) >>> dt.strftime('%s') '1341421200' Python 2.7.3, pytz 2012c -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 405 vs 370

2012-05-27 Thread Damjan Georgievski
e response, it seems my NNTP server doesn't relay all messages. I might need to switch. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

PEP 405 vs 370

2012-05-25 Thread Damjan Georgievski
ser the same without pip -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I read streaming output of a subprocess

2012-05-02 Thread Damjan Georgievski
I want to read the stream of an external process that I start with Python. From what I've seen that's not possible with the subprocess module? I want to read the output of "ip monitor neigh" which will show changes in the ARP table on my Linux computer. Each change is a new line printed by "ip"

How can I read streaming output of a subprocess

2012-05-02 Thread Damjan Georgievski
new line printed by "ip" and the process continues to run forever. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Async IO Server with Blocking DB

2012-04-06 Thread Damjan Georgievski
uchdbkit and Psycopg2 in their documentation. > can someone suggest some solutions or is async-io is not at the prime- > time yet. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: The original command python line

2012-03-03 Thread Damjan Georgievski
e imports are a bad idea. How come? I'm using explicit relative imports, I thought they were the new thing? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: The original python command line

2012-03-03 Thread Damjan Georgievski
> How can I get the *really* original command line that started my python > interpreter? > > Werkzeug has a WSGI server which reloads itself when files are changed > on disk. It uses `args = [sys.executable] + sys.argv` to kind of > recreate the command line, and the uses subprocess.call to run th

The original command python line

2012-03-03 Thread Damjan Georgievski
_.py --config instead of:: python -m mypackage --config the difference in the 2 cases is what the current package is, and whether you can use relative imports. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k s***s

2008-04-16 Thread Damjan
ftware, at the same time suffocating the old software, and denying anyone the oportunity to maintain that old software (part because it's closed-source, part because MS will sue you if try anything close to that). -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread Damjan
eed to install the "build-essential" pacakge group on Ubuntu so that you can compile programs. apt-get install build-essential > limits.h: No such file or directory This is probably /usr/include/linux/limits.h part of the kernel headers. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Beta testers needed for a high performance Python application server

2008-03-25 Thread Damjan
like to bash up on the GIL, > within Apache it is not necessarily as big a deal as people make out. BTW nginx now has a mod_wsgi too, if someone is looking for an Apache replacement. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: TheSchwartz in Python?

2008-02-06 Thread Damjan
> Cool, but sched saves job in memory... > > cron can't be an option. It's just a scheduler not a job queue. You could probably make lpd do what you want to do. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: virtualpython / workingenv / virtualenv ... shouldn't this be part of python

2008-01-15 Thread Damjan
>> My question is, shoudn't it be enough to set PYTHONPATH and everything >> automagically to work then? Is there some work done on this for python >> 3.0 or 2.6 perhaps? > > I'm working on a PEP for a per user site dir for 2.6 and 3.0 great .. can&#

virtualpython / workingenv / virtualenv ... shouldn't this be part of python

2008-01-11 Thread Damjan
gically to work then? Is there some work done on this for python 3.0 or 2.6 perhaps? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: OPLC purchase period extended

2007-11-25 Thread Damjan
(and grey) when in the reflective outdoor mode. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Low-overhead GUI toolkit for Linux w/o X11?

2007-11-06 Thread Damjan
source today?? Isn't that what maemo uses. I don't know about the X11 libraries, but the xcb libraries are pretty much small too (126kb on i386 here) - there are additional libraries depending on which features you want: render, shape, screensaver, shm, randr, dri etc.. Shame the toolki

Re: annoying stdin/stdout + pipes problem

2007-09-23 Thread Damjan
ther *nix-es, and on Windows this will surelly not work -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problems

2007-08-29 Thread Damjan
> > is there a way to sort this string properly (sorted()?) > I mean first 'a' then 'à' then 'e' etc. (sorted puts accented letters at > the end). Or should I have to provide a comparison function to sorted? After setting the locale... locale.strcoll

Python IMAP web-access

2007-08-01 Thread Damjan
Is there some project that implements web access to an IMAP store? Maybe something AJAXy like http://roundcube.net/?? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a Python app with Mozilla

2007-07-10 Thread Damjan
> Last I looked (3.1-ish), Qt didn't use the Aqua widgets Qt is now up to 4.3 and they use native Aqua -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread Damjan
t money is all > about but becauce they released Qt under GPL they simply cannot > prevent anyone from gaining money using it. That is a mistake, the oposite of libre software is non-libre or proprietary. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: I18n issue with optik

2007-04-02 Thread Damjan
n. Although directly executing > "chcp 1252" works. Maybe try to use http://sourceforge.net/projects/console it's claimed to be muc better than the sucky CDM (I don't have windows to try it). -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: frame of Qt program

2007-04-02 Thread Damjan
ther hand Twisted probably supports more protocols right now. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

PyPy for dummies

2007-03-29 Thread Damjan
succed and suprise (NOBODY expects the Spanish Inquisition!). So that's how I see PyPy ... at the same time an interesting - let's call it - academic experiment, but also something very close to beeing usefull at the level of the current CPython. -- damjan -- http://mail.python.org/mai

Re: socket read timeout

2007-03-29 Thread Damjan
>> So set a long timeout when you want to write and short timeout when you >> want to read. >> > > Are sockets full duplex? > > I know Ethernet isn't. Both are full duplex. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Approaches of interprocess communication

2007-02-17 Thread Damjan
the loopback > interface anyway, invariably regardless of host network implementation? On linux at least, this is true, yes. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Wing IDE 2.1.4 Released

2007-02-09 Thread Damjan
> This is a bug fix release that among other things fixes handling of > UTF-8 byte order marks, What are UTF-8 byte order marks ?!? There's only one order in the UTF-8 bytes! -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with pyzeroconf and linux

2007-01-27 Thread Damjan
rn ''.join(out) if __name__ == '__main__': import time, sys, locale for each in sys.argv[1:]: name = unicode(each, locale.getpreferredencoding()) publish_cname(name) try: while 1: time.sleep(60) except KeyboardInterrupt: print "Exiting" -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about docutils

2007-01-25 Thread Damjan
: > http://docutils.sourceforge.net/docs/howto/rst-roles.html > > Hope it helps. Thanks, it looks to be exactly what I need... I'm reading it now, and will try to implement it. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: The reliability of python threads

2007-01-24 Thread Damjan
ocumentation describes the right way to handle thread > synchronization in Python, and that module implements traditional > locking approaches without reference to the GIL. And we all hope the GIL will one day die it's natural death ... maybe... probably.. hopefully ;) -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Question about docutils

2007-01-24 Thread Damjan
I'm using docutils 0.4. Is it possible to define special custom 'tags' (or something) that will invoke my own function? The function would then return the real content in the ReST document. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there any python-twisted tutorial or texts?

2006-12-21 Thread Damjan
Then I got back to the Twisted book. I think it needs more work. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Mod_python vs. application server like CherryPy?

2006-12-08 Thread Damjan
's already WSGI middleware that's more flexible than the Apache modules for most of the features you mention. It's not that I think mod_python doesn't have uses.. I just think it's not practical to make python web applications targeted solely to mod_python. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml/ElementTree and .tail

2006-11-19 Thread Damjan
ave been sold all the expensive proprietary tools > so it's simply not fair when others are cheating. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Damjan
like not in CGI) so: s = wsgiref.simple_server.make_server('',8080, app) s.server_forever() More info at http://wsgi.org/wsgi/Learn_WSGI > 3. Using IIS at all for that matter, does WSGI work on IIS, do any > frameworks? There's an IIS server gateway (WSGI server) but you can always run WSGI applications with CGI, as seen above. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

RE: CGI -> mod_python

2006-10-03 Thread Damjan
t of WSGI servers (server gateways) http://wsgi.org/wsgi/Servers Start from here to learn more: http://wsgi.org/wsgi/Learn_WSGI Then come back, we'll discuss -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't use regular expressions to "validate" email addresses (was: Ineed some help with a regexp please)

2006-09-22 Thread Damjan
mplement some limiting features. Try two times from the same IP address in less than 10 minutes and you are banned for the day. Or some such. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: naming objects from string

2006-09-20 Thread Damjan
manstey wrote: > Hi, > > But this doesn't work if I do: > > a=object() > x='bob' > locals()[x] = a > > How can I do this? try sys.modules[__name__].__dict__[x] = a But what's the point? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Damjan
ss B(UserDict): ... pass >>> type(B) It seems that NOT every class in my module will be a new style class, especially those that inherit from other old-style classes in other modules. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-17 Thread Damjan
ich you don't control or create in your code. I remeber I've seen an implementation of import_with_metaclass somewhere on IBM's developerworks. I didn't quite undersntad it though. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to find IP address?

2006-09-17 Thread Damjan
; address is not possible change. I can setup my browser to always send you a fake HTTP_X_FORWARDED_FOR header. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to find IP address?

2006-09-17 Thread Damjan
"] > > (but that can easily be spoofed, and is mostly meaningless if the user > uses local IP addresses at the other side of the proxy, so you should > use it with care) Yep, you should only use "HTTP_X_FORWARDED_FOR" if you trust the proxy and you check that the request

Re: BaseHTTPServer weirdness

2006-09-11 Thread Damjan
viron and then provide that (either in os.environ or in a custom environ dictionary). BUT why don't you use WSGI? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: egg and modpython

2006-09-11 Thread Damjan
> I applaud you for studying the traceback in more depth than I can find > the motivation for, Bruno. ;-) However, this looks like a program using > some package installed by setuptools/easy_install needs to unpack that > package when running. See news:[EMAIL PROTECTED] -- dam

Re: get the en of a program running in background

2006-09-11 Thread Damjan
ember the PIDs of the forked procesess and in your signal handler use os.wait() to see which one has died. BTW os.wait() can work in non-blocking mode . -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python newbie with a problem writing files

2006-09-04 Thread Damjan
ite = (feed_title) > AttributeError: 'file' object attribute 'write' is read-only -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Broadcast server

2006-08-31 Thread Damjan
et the stdlib docs: http://docs.python.org/lib/module-socket.html http://docs.python.org/lib/module-select.html -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Egg problem (~/.python-eggs)

2006-08-30 Thread Damjan
ctually) so that the kernel/lib-loader can map them. If your .egg package doesn't have any binary modules, then it doesn't need to unpack anything. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Persistent Session in CGI

2006-08-30 Thread Damjan
the app in the paste httpserver ... # but make some error in your python code to see it's results -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Persistent Session in CGI

2006-08-30 Thread Damjan
an run your app as CGI, in mod_python, as a standalone http server, with SCGI/FastCGI. You'll benefit from authentication and session middleware. Middleware is a great WSGI concept, there are also caching middlewares etc.. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: hide python code !

2006-08-14 Thread Damjan
e same room with your software 100-fold if you release it under.. say GPL. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a compelling argument to use Django instead of Rails

2006-08-08 Thread Damjan
n.3F Now that it's GPL AppArmor seems to get a lot of supporters. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: libclntsh.so.10.1: cannot open shared object file: Permission denied

2006-08-08 Thread Damjan
o that no environment variables are neccesseary - >> actually this is not possible, but what I have is, symbolic links >> in /usr/lib to the libraries in $ORACLE_HOME/lib, thus I don't need the >> LD_LIBRARY_PATH variable, and the only other variable I need is the >> ORACLE_HOME

Re: Which Python API for PostgreSQL?

2006-08-05 Thread Damjan
> I also recommend psycopg. But make sure you use psycopg2 -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a compelling argument to use Django instead of Rails

2006-08-05 Thread Damjan
be replaced with mod_python scripts. OTOH SCGI or FastCGI seem better sutied for python web (WSGI) applications. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs. Linux

2006-07-30 Thread Damjan
el 2.6.17, and probably you could easily make it work if you make some upgrades to Ubuntu. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to force a thread to stop

2006-07-29 Thread Damjan
e first boot the machine would reboot on exactly 2 minutes. After a bit of poking around I found that hotplug detected the WDT support and loaded the driver for it (i8xx_tco), and it seems the WDT chip was set to start ticking right away after the driver poked it. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a compelling argument to use Django instead of Rails

2006-07-25 Thread Damjan
uby (Rails or not).. and from that little I've seen from it.. I didn't like it. OTOH Ruby surelly is not that bad either. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: threading+ftp+import => block

2006-07-25 Thread Damjan
Damjan wrote: > Panard wrote: > >> Hi, >> I'm experiencing a strange problem while trying to manage a ftp >> connection into a separate thread. >> >> I'm on linux, python 2.4.3 >> >> Here is a test : >> -- ftp_thread.p

Re: threading+ftp+import => block

2006-07-25 Thread Damjan
t; > But : > $ python >>>> import ftp_thread > / > This has been documented in the blog posts titled "How well you know Python" (find it on google) The problem is that, once you run "import ftp_thread" a lock is set in the Python interpreter, so then you can't start a new thread... (this from the back of my mind). -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: libclntsh.so.10.1: cannot open shared object file: Permission denied

2006-07-20 Thread Damjan
ME, which is /usr/share/oracle on my system and it contains bin/ install/ lib/ network/ ocommon/ oracore/ rdbms/ sqlplus/ -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode html

2006-07-17 Thread Damjan
conversion: > \uc3B4 => ô '&#%d;' % ord(u'\u0430') or '&#x%x;' % ord(u'\u0430') > for all available html entities. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Chapter 9 Tutorial for Classes Not Working

2006-06-30 Thread Damjan
gt; > This gives the following error: > > Traceback (most recent call last): > File "", line 2, in ? > TypeError: unbound method f() must be called with MyClass instance as > first argument (got nothing instead) > > Please help...this is killing me! What you a

Re: Python database access

2006-06-27 Thread Damjan
> The odbc module is part of the Python Standard Library. Since when? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyQt v4.0 Released - Python Bindings for Qt v4

2006-06-12 Thread Damjan
> QtNetwork > A set of classes to support TCP and UDP socket programming and higher > level protocols (eg. HTTP). Since QtNetwork is asynchronous how does it compare to twisted? I find Qt's signals and slots easier to understand and work with than twisted deferreds.

Re: is a wiki engine based on a cvs/svn a good idea?

2006-05-31 Thread Damjan
dea to use > it in a wiki engine. Pro: versioning / diffs, Cons: you need your own > svn/cvs repository, can pyLucene or Xapwrap index this? You can certanly index the svn checkout if nothing else. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to clear up a List in python?

2006-05-25 Thread Damjan
ave 100 items in the slice... 300, 301,... 399 that's 100 items. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate() question

2006-05-22 Thread Damjan
rint i, x, y for i, (x, y) in enumerate(coords(dots)): print i, x, y -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Dumb-as-rocks WSGI serving using standard library

2006-05-22 Thread Damjan
jsp?thread=158191 [3] http://www.owlfish.com/software/wsgiutils/ -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb - parameterised SQL - how to see resulting SQL ?

2006-05-17 Thread Damjan
ns. I wouldn't recommend that on a production machine though. The logfile is stored in /var/lib/mysql/.log -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: converting to scgi

2006-05-08 Thread Damjan
I servers: http://www.saddi.com/software/flup/ The WSGI specification: http://www.python.org/peps/pep-0333.html ps. It would be nice if others supplied some interesting WSGI resources too. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Eggs Just install in *ONE* place? Easy to uninstall?

2006-05-08 Thread Damjan
d there are a lot of other projects that install custom scripts. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a Python MVC that works just as well with just CGI, or FCGI?

2006-04-10 Thread Damjan
TurboGears? www.turbogears.com -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python + apache + winxp => nogo

2006-04-08 Thread Damjan
> to apache's httpd.conf, apache refuses to start, saying: > "cannot load c://mod_python.so into server: the specified module > could not be found" which probably means that mod_python.so is not in that directory? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt issue

2006-03-04 Thread Damjan
> Because you wrote curentText - note the missing t. :) You mean the missing 'r' :) -- http://mail.python.org/mailman/listinfo/python-list

Is there a WSGI sollutions repository somewhere

2006-03-04 Thread Damjan
It seems that WSGI support starts to flourish is there some document or a web site that tracks what's out there, some place to pick and choose WSGI components? -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE: Mod_python 3.2.7

2006-02-13 Thread Damjan
Just upgraded from 3.1.4 / Apache-2.0.55, and I can confirm that both moin-1.5 and trac-0.9.3 continued to work without problems. -- http://mail.python.org/mailman/listinfo/python-list

Python 2.4.2 and Berkeley DB 4.4.20 ?

2006-02-13 Thread Damjan
This is from the Slackware-current changelog: d/python-2.4.2-i486-1.tgz: Upgraded to python-2.4.2. The bsddb module didn't build against the new 4.4.x version of Berkeley DB. Does anyone care? Or perhaps have a patch? :-) Does anyone have a suggestion? -- http://mail.python.org/ma

Re: Problem with curses and UTF-8

2006-02-08 Thread Damjan
I just recompiled my python to link to ncursesw, and tried your example with a little modification: import curses, locale locale.setlocale(locale.LC_ALL, '') s = curses.initscr() s.addstr(u'\u00c5 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE\n'.encode('utf-8') ) s.addstr(u'\u00f5 U+00F5 LATIN SMA

Re: SMPP implementation in python

2006-01-17 Thread Damjan
You can see some code here http://pysmpp.sourceforge.net/ but it's not complete... it need much more work. -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-15 Thread Damjan
> sorry for my ignorance, but after reading the Python tutorial on > python.org, I'm sort of, well surprised about the lack of OOP > capabilities in python. Honestly, I don't even see the point at all of > how OO actually works in Python. > For one, is there any good reason why I should ever inher

Re: SVG rendering with Python

2005-12-15 Thread Damjan
Do you want to create a SVG file or display a SVG file? SVG files are just XML so maybe you can create them easyly? -- http://mail.python.org/mailman/listinfo/python-list

Re: quick unicode Q

2005-12-15 Thread Damjan
>> Read it as a string, and then decode it with the .decode method. You >> specify what encoding it's in. > > Most probably, the OP is asking what to do with an UTF-8 encoded string. > > To decode that, just use: > > s.decode("utf-8") I prefer: unicode(s, 'utf-8') That way it's more clear that

Re: small inconsistency in ElementTree (1.2.6)

2005-12-10 Thread Damjan
>>> ascii strings and unicode strings are perfectly interchangable, with >>> some minor exceptions. >> >> It's not only translate, it's decode too... > > why would you use decode on the strings you get back from ET ? Long story... some time ago when computers wouldn't support charsets people inven

Re: small inconsistency in ElementTree (1.2.6)

2005-12-09 Thread Damjan
>> Do I need to check the output of ElementTree everytime, or there's some >> hidden switch to change this behaviour? > > no. > > ascii strings and unicode strings are perfectly interchangable, with some > minor exceptions. It's not only translate, it's decode too... probably other methods and beh

small inconsistency in ElementTree (1.2.6)

2005-12-08 Thread Damjan
Attached is the smallest test case, that shows that ElementTree returns a string object if the text in the tree is only ascii, but returns a unicode object otherwise. This would make sense if the sting object and unicode object were interchangeable... but they are not - one example, the translate

Re: Oracle 9i client for Linux

2005-11-30 Thread Damjan
This is a list of files I use to compile cx_Oracle, php-oci amd perl DB::OCI on Linux. I set ORACLE_HOME to /usr/lib/oracle and symlink the *.so files in /usr/lib so that I don't need to set LD_LIBRARY_PATH. I guess this list can be reduced some more... but I got tired of experimenting And the ins

Re: Unicode in MIMEText

2005-11-28 Thread Damjan
patch submitted... > Thanks for taking the time to improve the quality of the Python library. Do you think it would be possible to do some kind of an automatic comprehensive test of compatibility of the standard library with unicode strings? -- damjan -- http://mail.python.org/mail

Any way to change files in a ZIP archive?

2005-11-25 Thread Damjan
in it, and then send the result back. I've made the most of my script, but I can't find a way to replace (freshen) the file that's already in the archive? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode in MIMEText

2005-11-25 Thread Damjan
> ... and being concerned to improve the library you logged this patch in > Sourceforge for consideration by the developers? > > That's the only way to guarantee proper consideration of your fix. Ok I will, can you confirm that the patch is correct? Maybe I got something wr

Re: ANNOUNCE: Mod_python 3.2.5 Beta

2005-11-23 Thread Damjan
;s not true (at least in 2.3 and 2.4): >>> def f(): ... return 'a' ... >>> f.__auth__ = {1:'one'} -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode in MIMEText

2005-11-23 Thread Damjan
0 +0100 @@ -244,6 +244,8 @@ """Convert a string from the input_codec to the output_codec.""" if self.input_codec <> self.output_codec: return unicode(s, self.input_codec).encode(self.output_codec) +elif isinstance(s, unico

Unicode in MIMEText

2005-11-23 Thread Damjan
.base64MIME.body_encode(s) File "/usr/lib/python2.4/email/base64MIME.py", line 136, in encode enc = b2a_base64(s[i:i + max_unencoded]) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128) -- damjan -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >