this sort will take? It will sound weird, but I
actually have 12 different key maps and I want to sort this with
respect to each map, so I will have to sort 12 times.
Paul
--
http://mail.python.org/mailman/listinfo/python-list
I really do need to sort. It is complicated and I haven't said why, but
it will help in finding similar keys later on. Sorry I can't be more
precise, this has to do with my research.
Your two other suggestions with itertools and operator are more useful,
but I was mostly wondering about
The reason I am not telling you much about the data is not because I am
afraid anyone would steal my ideas, or because I have a non-disclosure
agreement or that I don't want to end up pumping gas.
It is just that it is pretty freaking damn hard to even explain what is
going on. Probably a bit
untested, ugly, but something like this would sort all the files in the
directory on os.path.getctime (not using os.walk() though). I'm sure
there is probably better ways to do it :)
filelist = []
def walkdir(currdir):
for files in os.listdir(currdir):
path = os.path.join(currdir,
Another option is to implement the needed python code in COM server and
call that from C#. A simple example of python COM server can be seen
about halfway down the page here
http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html
--
http://mail.python.org/mailman/listinfo/python-list
with Python, related discussions on type
safety, private/protected/public, using Python in Mozilla, and the
disappearance of the Bastion module notwithstanding.
Paul
--
http://mail.python.org/mailman/listinfo/python-list
,
if only to avoid the framework proliferation that people keep
complaining about.
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I am trying to make up a catalogue of my books.
I found tools on isbntools.com in python. YAY i thought.
Something happens! But I cant seem to get the part to download the books
information from amazon.com working correctly. It connects, but I think the
regular expressions used in the
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Larry Bates schrieb:
paul wrote:
Maryam Saeedi schrieb:
Hi,
I was wondering if you know how can I run a python code once every five
minutes for a period of time either using python or some other program
like
a bash script.
See the sched module in the standard library or here:
http
. It's an event based notification
mechanism for linux kernel 2.6.13 and up. It has python bindings
available (google for pyinotify).
You will receive events like IN_OPEN,IN_CLOSE,etc. and keep track of
opened files this way.
hth
Paul
--
http://mail.python.org/mailman/listinfo/python-list
class User(object):
def __init__(self, uid):
self.uid = uid
self.__dict__.update(yaml.load(str('uid')+'.yaml'))
def save(self):
f=open(str(self.uid)+'.yaml')
yaml.dump(self.__dict__, f)
is there a better way to persist using Yaml
Paul
http://bidegg.com
) use of Components and
Interfaces. Very lightweight and modular. You can start reading here:
http://trac.edgewall.org/browser/trunk/trac/core.py
cheers
Paul
That's one reason why my interfaces grow fast.
On Apr 3, 1:51 am, Carl Banks pavlovevide...@gmail.com wrote:
On Apr 2, 8:02 am, 一首诗
]
self.type = IBM029
errs = self.(self.type).findall(aCardImage)
same here, or use a class/module-level dict like
symbol_table = {
'IBM029': re.compile([^...]),
'IBM026': re.compile([^...])
}
and symbol_table[self.type].findall(something)
cheers
Paul
--
http://mail.python.org/mailman
syntax elements.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
, [] ).append( v )
In Perl, the code looks like this:
$h{ $key } = $value ;
Whats wrong with:
mytable[key] = value
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Dave Challis schrieb:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ah thanks, vars(...) was exactly what I was after. I'd come across
dir() before, but this returns more than I need.
It seems vars() misses class attributes tho...
cheers
Paul
--
http://mail.python.org/mailman/listinfo
Have you shown this stuff to the google AppEngine folks!
Thats being touted as the thing that'll make web-2 easy
but you have to write code (Python) which will turn off 99% of
possible users.
What made Hypercard really great (and Supercard on DOS, and the new
clones like Revolution) is that it
Something like this?
class User:
def __init__(self, name):
self.name = name
def __str__(self):
return self.name
n = 10
users = []
for i in range(n):
users.append(User('user%d' % i))
print users[9]
print users[4]
Cheers,
Paul
On Sat
javascript security
restriction enforced by the browser. That is, the origin of your
javascript is file://... and you're trying to access
http://localhost:8765. This is not allowed.
hth
Paul
--
http://mail.python.org/mailman/listinfo/python-list
how code benefits from interfaces wrt. structuring and
documentation.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
' and 'list' objects
then you have to examine the traceback and hope the real error is
visible somewhere (an argument not conforming to the specification of
the function prototype, or the lack thereof).
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
and whatnot.
Don't get me wrong, I'm not defending PHP but from a deployment POV
python is definitely more complex.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] schrieb:
Hello,
I'm new to Python. I have a small task to do. I need to be able to
find a running app (preferrably by name) and kill it. This is for the
XP environment. What is best way to do this?
Thanks,
import os
os.system('taskkill /IM explorer.exe')
cheers
Paul
/~dkuhlman/#generateDS
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
covered in any documentation that i could find.
Whats wrong with this page?
http://www.cherrypy.org/wiki/StaticContent
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
something
Pythonic?
I'd say so. In a function/method body I do reuse generic names like
data,counter,etc. but I never change say an instance variable to another
type (except from None). Principle of least surprise applies here.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
()
None
I mean, why ls is empty after assignment?
That's what in-place means, [].reverse() changes the list in-place and
does not return the list to the caller.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
: If you like XML, use genshi. If you plan
to generate something else than HTML, use cheetah. Use google or
whatever search engine you prefer to find those packages.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
some IPC method (socket, xmlrpc, corba).
I really like Python for a number of reasons, and would like to avoid
Java.
Have you looked at jython?
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
like unicode string and you always need to think about when to
encode() your unicode objects. However, this will change in py3k...,
what's the new rule of thumb?
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
greg schrieb:
paul wrote:
However, this will change in py3k...,
what's the new rule of thumb?
[snipp]
So you won't be able to get away with ignoring encoding
issues in py3k. On the plus side, it should all be handled
in a much more consistent and less error-prone way. If
you mistakenly
Paul
BTW: are type annotations to be backported to 2.x?
--
http://mail.python.org/mailman/listinfo/python-list
Chris Mellon schrieb:
On Dec 6, 2007 5:52 AM, paul [EMAIL PROTECTED] wrote:
function or method. I hope type annotations in py3k will allow for
something like constraints in C# where you can tell the caller right
away she's doing something wrong.
[language rant snipped]
On a more pragmatic
Andrew schrieb:
Hello Everyone
[snipped stuff]
Sorry not being helpful, but I suggest you post a minimal sample of your
code demonstrating your program.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
, but my radical idea is that
lists of dictionaries fit the relational model
perfectly, so why not allow some kind of native SQL
syntax in Python that allows you to manipulate those
data structures more naturally?
LINQ?
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
compactLogin
...do something with compactLogin.dvlogin...
reload(compactLogin)
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
it without any error but nothing changes?)
AFAIK you can't. If the terminal is limited to ascii it won't be able to
display anything else; it might not even have the right font, so how are
you supposed to fix that? The .encode(encoding, replace) ensures safe
downgrades though.
cheers
Paul
--
http
Greg Copeland schrieb:
On Aug 21, 9:40 pm, Bikal KC [EMAIL PROTECTED] wrote:
Greg Copeland wrote:
I'm having a brain cramp right now. I can't see to recall the name of
Is your cramp gone now ? :P
I wish. If anyone can remember the name of this module I'd realy
appreciate it.
I need to do to get this to work?
Many thanks,
Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 26, 5:20 pm, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
paul wrote:
If I put these back in and try to run the daemon, the script fails
when I try to connect to the serial port, with this error:
serial.serialutil.SerialException: Could not open port: [Errno 13]
Permission
scripter.getvalue()
I'm still curious what all this StringIO stuff is for ;)
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
terminated.
This has nothing to do with wx, you just don't use self if you're
_calling_ a method. So:
def create_grid():
win = Grid_MegaExample.MegaTable(data, colnames, pugins)
win.Show(True)
should get you to the next error ;)
cheers
paul
--
http://mail.python.org/mailman/listinfo
table where value in (?,?,?,?,?)'
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
do so or you'll get fired.
Use chalk so you can wipe it off the case if your boss changes his/her
mind. Disclaimer: I haven't tested this and the DC might get unstable or
crash...
scnr
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Jean-Paul Calderone schrieb:
It could ask the application. On the other hand, maybe asyncore remains in
a perfectly consistent state even after it raises this exception, and it is
already asking by letting this exception propagate up: if the application
is free to start the loop again after
you mean by that? I just use the 2.5 icons with 2.4 and all my
scripts are happy ;)
thanks
Paul
--
http://mail.python.org/mailman/listinfo/python-list
and further ignore some of his drivel.
I have version 1.2.5.
I use Eclipse 'cos it's simply great!!
If somebody could tell me some alternative...
The author of pydev-extension provides pydev FOR FREE!! If you want
pydev-extension you should by a license.
cheers
Paul
--
http
debtor where key
is not null )
FROM sqlite_master SELECT name WHERE type='table';
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Paul McGuire schrieb:
What does Python have that C++ doesn't?
- The biggie: dynamic typing (sometimes called duck typing).
Dynamic typing is a huge simplifier for development:
. no variable declarations
. no method type signatures
. no interface definitions needed
. no templating
Phillip B Oldham schrieb:
Are there any FOSS Python Single-Sign-on Servers?
[snip]
I've searched around but can only seem to find OpenID servers, which
will probably be too open for our needs.
So if it is not OpenID, which protocol are you going to implement?
cheers
Paul
--
http
and the endless
repetition of the greatest of all after-the-fact theories ever duck
typing.
cheers
Paul
BTW: Back to Java? No, not really.
--
http://mail.python.org/mailman/listinfo/python-list
version and is highly experimental. Let me
know if it works for you and whether you have any problems.
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 10, 7:37 am, Tim Roberts t...@probo.com wrote:
PJ pauljeffer...@gmail.com wrote:
I have a simple web server using BaseHTTPServer, and the def do_POST
(self) function works fine for regular forms that are submitted to it,
but when I send anAJAXPOST to it it does nothing (I've tried to
hints/tips for speeding it up?
Thanks,
Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 15, 8:46 pm, Steve Holden st...@holdenweb.com wrote:
Paul wrote:
Hi,
I currently have a webserver using BaseHttpServe that serves images
like this:
if self.path.endswith(.jpg):
print(curdir + sep + self.path)
f = open(curdir + sep + self.path,b
I have been experiencing strange thread behavior when I pass a message
received via a Queue to a wx.PostEvent method (from wxPython). The
relevant code in the thread is:
def run(self):
while self.is_running:
task = self.queue.get()
wx.PostEvent(self.app.handle_task, task)
On Dec 3, 2:03 pm, Mike Driscoll kyoso...@gmail.com wrote:
On Dec 3, 3:42 pm, paul phart...@gmail.com wrote:
I have been experiencing strange thread behavior when I pass a message
received via a Queue to a wx.PostEvent method (from wxPython). The
relevant code in the thread is:
def
and then Py_DECREF'd in the desctuctor
Anyone else had issues of this kind? My next try will be to use
sub-interpreters per thread.
Thanks,
Paul.
--
http://mail.python.org/mailman/listinfo/python-list
more. Can anyone shed any further light?
Regards,
Paul.
On Tue, Feb 2, 2010 at 11:59 AM, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
En Mon, 01 Feb 2010 18:21:56 -0300, Paul goblado...@gmail.com escribió:
I'm extending some old Visual Studio 6 code to add embedded python
scripting
better than the competition. From there
on, they had more ressources (developer time) and grew fast and beyond
the original problem domain. Now you can write GUI apps in PHP, great!
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
://www.cnn.com').getPageText()
cheers
Paul
and following is orginal source until i was found in internet.
from BeautifulSoup import BeautifulSoup
from PAM30 import PAMIE
url = 'http://www.cnn.com'
ie = PAMIE(url)
bs = BeautifulSoup(ie.pageText())
if possible i really want to make it work
elca schrieb:
Hi,
thanks a lot.
studying alone is tough thing :)
how can i improve my skill...
1. Stop top-posting.
2. Read documentation
3. Use the interactive prompt
cheers
Paul
paul kölle wrote:
elca schrieb:
Hello,
Hi,
following is script source which can beautifulsoup
uid through sudo. This does not affect the parent
process.
hth
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Krishnakant schrieb:
On Thu, 2009-07-23 at 13:50 +0200, paul wrote:
If the user running python program is allowed to call setuid() then yes.
NO, i don't think i can do that. I am getting opperation not permitted.
Any ways I think probably subprocess will have to sort it out.
Did you try
)
b = bytes ( ord(c) for c in rawinput)
self.sockfd.send(b);
And the error is? Doesn't Flash use http as transport?
cheers
Paul
--
http://mail.python.org/mailman/listinfo/python-list
quite popular in the scientific community and for
system administration these days.
Heard that python is similar to lisp. But both python and AS 3.0 is
almost identical. Which is more similar to lisp are powerful?
If python is 100m away from lisp, than it's 102.32m for AS3.
cheers
Paul
I have a problem with threading using the Python/C API. I have an
extension that implements a timer, and the C++ timer callback function
calls a Python function. The relevant code looks like this:
static PyObject *timer_setmodname( PyObject *pSelf, PyObject *pArgs )
{
char *b;
Thanks, Thomas. The answer to most of your questions is that I'm very
new at this!
I'm asking this on the forums you suggested.
- Paul
On Thu, 01 Jul 2010 19:23:53 +0200, Thomas Jollans
tho...@jollans.com wrote:
On 06/30/2010 09:28 PM, p...@mail.python.org wrote:
I have a problem
replaced it with a imap.search to get the thing
working.
These are probably very simple things, but I've not tried this library
before so am a bit stuck so any help wwould be very gratefully
received.
Thanks,
Paul
Code:
# -*- coding: cp1252 -*-
import imaplib,email
# you want to connect
-four thousand, five hundred and
sixty-seven'
Installation: pip install inflect or easy_install inflect
PyPi: http://pypi.python.org/pypi/inflect
Bug Tracker: http://github.com/pwdyson/inflect.py/issues
Source Code: http://github.com/pwdyson/inflect.py
Cheers,
Paul Dyson
--
http
Thomas Jollans, 15.07.2010 18:41:
On 07/15/2010 01:00 PM, Paul wrote:
I'm pleased to announce the release of inflect.py v0.1.8, a module that
correctly generates:
* the plural of singular nouns and verbs
* the singular of plural nouns
* ordinals
* indefinite articles
* present
I have a problem with embedding Python into a C extension in Windows
Vista. I have implemented a timer routine in C as an extension, which
I can import into Python 2.6.5 and run. Each timer interval, the
extension calls a C CALLBACK function. I want to be able to have this
CALLBACK function call a
The python-announce-list-ow...@python.org suggested you might have a
solution to my problem.
Please help if you can.
Thanks,
Paul
Original Message
Subject: Re: [ANN] Pyjamas 0.5 Web Widget Set and python-to-javascript
Compiler released
Date: Thu, 10 Jun 2010 17:43:48
not able to understand exactly what is going
on here.
Can anyone offer some assistance?
Thank you,
Paul
--
http://mail.python.org/mailman/listinfo/python-list
We found a quick workaround to make import work with paths. We just
append the folder we want to the system's path:
sys.path.append( moduleFolder )
If anyone has a better solution, that would be great. Until then, this
is ugly, but it works.
--
gert schrieb:
I would like to read the following from a text file
Hi gert,
I'm puzzled, what is wrong with using wsgi as advertised? Just import
your code and insert it in the wsgi chain no?
cheers
Paul
from json import loads
from gert.db import Db
def application(environ, response
*
see something of this form. If not, you'd instead
see the name of the process that has stolen the
com port.
virtualbox.exe pid: 1234 ComputerName\UserID
E0: File (---) \Device\VCP0
HTH,
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Adam wrote:
Paul nos...@needed.com wrote in message
news:jseu9c$sp3$1...@dont-email.me...
Adam wrote:
John Nagle na...@animats.com wrote in message
news:jse604$1cq$1...@dont-email.me...
On 6/26/2012 9:12 PM, Adam wrote:
Host OS:Ubuntu 10.04 LTS
Guest OS:Windows XP Pro SP3
I am able
COM port,
to a COM port number, like COM3 and COM4 in this case.
Paul
--
http://mail.python.org/mailman/listinfo/python-list
! :)
Basti
signature.asc
1KViewDownload
Hi,
If you are trying to digitize data from the graph, you could try
Dagra: http://www.BlueLeafSoftware.com/Products/Dagra/
There is a Python library for reading the files it produces.
hth
paul
--
http://mail.python.org/mailman/listinfo/python-list
I'm wondering what the best solution for this problem is.
I've got a wxpython app, in one part a user makes some selections then opens a
dialog to select where to output. At which point the app starts a thread
processing their selection while they're choosing an output location, hopefully
Tim Golden mail at timgolden.me.uk writes:
On 07/10/2011 09:29, Paul wrote:
I'm wondering what the best solution for this problem is.
I've got a wxpython app, in one part a user makes some selections then
opens
a
dialog to select where to output. At which point the app starts
Basically there can be quite a big job to do based on the user selection and
I've pipelined it so after the user selects the output location the next job
can
get started so long as the first job (preparing the data) has been running for
5
or so seconds roughly. Its just a lot nicer to have
Tim Golden mail at timgolden.me.uk writes:
On 07/10/2011 11:15, Paul wrote:
My first thought was to use a flag but wouldn't the new thread see the
cancel
flag and stop as well? I could set it back but then any other threads might
have
been busy and not seen it while the flag
Hello. I converted doctests into DocTestSuite() to use with unittest. And try
it under Python 3.
And, sure, I get errors with unmatched exceptions details (mismatched name of
exception class: a.b.c.MyError instead of MyError). So, I have 2 questions:
1) how to turn on option
class FontSpec:
Wrapper for something like 'Arial 10 bold #red'
tkf = None # Tk Font
spec = # specification
tkspec = # specification for Tk
family = None
size = 0
color = black
weight = normal
slant = roman
underline = 0
overstrike = 0
New submission from Paul:
Trying to compile Plone (3.0.2) on a Sun V880 (SunOS genome 5.10
Generic_125100-05 sun4u sparc SUNW,Sun-Fire-880). Plone is a web
application which runs on the Zope framework. What fails is the python
(2.4.4) which is distributed with Zope.
During the configure step
Paul paul.bauer.spearst...@gmail.com added the comment:
This is a problem with python2.7 as well. A change in struct between python2.6
and 2.7 raises an exception on overflow instead of silently allowing it. This
prevents zipping any file larger than 4.5G. This exception concurs when
Paul paul.bauer.spearst...@gmail.com added the comment:
I attempted to re-allow overflow in the struct(...) call by replacing
`zinfo.file_size` with `ZIP64_LIMIT % zinfo.file_size` in zipfile.py, and
successfully produced a compressed file from a 10G file, but the resulting
compressed file
New submission from Paul:
In Python 2.6, pdb doesn't show exception strings properly:
#somecode.py
import pdb
pdb.set_trace()
raise Exception('This is a message that contains a lot of characters and is
very long indeed.')
#terminal
somecode.py
- raise Exception('This is a message
New submission from Paul A. p...@freeshell.org:
Shouldn't configure be able to arrive at that without me adding manually?
Anyway, after the build finishes thing soon come crashing down; my stack trace
is at the end...
running build_scripts
creating build/scripts-2.7
copying and adjusting /usr
Changes by Paul A. p...@freeshell.org:
--
type: - crash
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14524
___
___
Python-bugs-list mailing list
New submission from Paul A. p...@freeshell.org:
I can't help thinking that configure should be able to figure out the need for
this -- Modules/termios.c won't compile without adding -D_TERMIOS_INCLUDED by
hand. This is far from new, all 2.5+ versions I've tried to compile are like
New submission from Paul A. p...@freeshell.org:
Perhaps I'm not interpreting something happening earlier, but `make test' here
only seems to run a short time but doesn't actually finish. It appears not to
be using any cpu, or waiting for input, so I'm not sure what's happening
New submission from Paul A. p...@freeshell.org:
I trying to build python using an external libffi package I have installed --
is there some trick in directing --with-system-ffi to the path where it's
located. I don't see clues in config.log or anywhere to help.
--
messages: 157776
Paul A. p...@freeshell.org added the comment:
On Sun, Apr 08, 2012 at 02:01:05AM +, R. David Murray wrote:
R. David Murray rdmur...@bitdance.com added the comment:
Is this a bug report about configure, or a bug report about a crash during
compilation after you've adjusted
Paul A. p...@freeshell.org added the comment:
On Sun, Apr 08, 2012 at 02:06:46AM +, R. David Murray wrote:
R. David Murray rdmur...@bitdance.com added the comment:
Can you suggest a patch? As I said on the other issue I don't believe any
core developers have access to hpux.
Sure
Paul A. p...@freeshell.org added the comment:
On Sun, Apr 08, 2012 at 02:13:39AM +, R. David Murray wrote:
R. David Murray rdmur...@bitdance.com added the comment:
Oh, wait, I see you are testing the security RC. Is this a new problem, or
does it also occur with the previous
Paul A. p...@freeshell.org added the comment:
On Sun, Apr 08, 2012 at 05:58:29AM +, Ross Lagerwall wrote:
Ross Lagerwall rosslagerw...@gmail.com added the comment:
If it is in a non-standard location, try setting the environment variables:
LDFLAGS linker flags, e.g. -Llib dir
1 - 100 of 12932 matches
Mail list logo