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
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
good references of using good times in Python?
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
ser
the same without pip
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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"
new line printed
by "ip" and the process continues to run forever.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
> 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
_.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
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
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
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
> 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
>> 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
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
(and grey) when in the reflective outdoor mode.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
ther *nix-es, and on Windows this will surelly not work
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
>
> 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
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
> 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
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
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
ther hand Twisted probably supports more protocols right
now.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
>> 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
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
> 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
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
:
> 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
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
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
Then I got back to the Twisted book.
I think it needs more work.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
'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
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
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
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
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
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
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
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
; 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
"]
>
> (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
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
> 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
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
ite = (feed_title)
> AttributeError: 'file' object attribute 'write' is read-only
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
e same
room with your software 100-fold if you release it under.. say GPL.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
n.3F
Now that it's GPL AppArmor seems to get a lot of supporters.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
> I also recommend psycopg.
But make sure you use psycopg2
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
> The odbc module is part of the Python Standard Library.
Since when?
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
> 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.
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
ave 100 items in the slice... 300, 301,... 399 that's 100 items.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
jsp?thread=158191
[3] http://www.owlfish.com/software/wsgiutils/
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
d there are a lot of other projects that install custom
scripts.
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
TurboGears?
www.turbogears.com
--
http://mail.python.org/mailman/listinfo/python-list
> 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
> Because you wrote curentText - note the missing t.
:)
You mean the missing 'r'
:)
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
> 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
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
>> 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
>>> 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
>> 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
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
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
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
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
> ... 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
;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
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
.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 - 100 of 138 matches
Mail list logo