Greetings!
Just in time for the holidays and on behalf of the CherryPy team I am
happy to announce the release of CherryPy 3.0.0.
Here are some highlights of the new version:
* As much as 3 times faster than CherryPy 2.
* Much improved WSGI support.
* Powerful enhanced configuration
Phebe 0.1 has been released and uploaded to the Python package index.
From README.txt:
=
Phebe comprises a Python package and a number of executable scripts to
operate a mobile phone connected to your computer.
The
4Suite XML 1.0.2 is now available from Sourceforge and ftp.4suite.org.
Thanks to all the testers, there are a number of important fixes and
improvements
since 1.0.1, and we recommend upgrade from all previous versions.
Changes include:
* Fixed TypeError when multiple interpreters are used (should
Lad schrieb:
On my website I allow users to upload files. I would like a user to see
how much time is left before a file is uploaded. So, I would like to
have a progress bar during a file uploading. Can Python help me with
that?Or how can be a progress bar made?
Thank you for ideas.
La.
On Tue, 26 Dec 2006 15:49:10 +0800, [EMAIL PROTECTED] wrote:
Hi,
I'm writing a program which imports an external module writing in C and
calls a function provided by the module to do my job. But the method
produces
a lot of output to the stdout, and this consumes most of the running time.
On Tuesday, 26.12.06 at 21:28, Steven D'Aprano wrote:
# WARNING: untested
def run_without_stdout(*args, **kwargs):
function = args[0]
args = args[1:]
savestdout = sys.stdout
sys.stdout = cStringIO.StringIO()
result = None
try:
result = function(*args,
I have an application where I need to take a query from an existing
database and send it to a web api.
Here's a cut down version of my existing code:
for foo in mssql.fetch_array();
bar = foo[2] #trims the first result which we don't use
for x in bar:
for y in
many_years_after wrote:
Carsten Haese wrote:
On Sun, 2006-12-24 at 22:55 -0800, many_years_after wrote:
Hi, pythoners:
There is a problem I couldn't dispose. I start a thread in the my
program. The thread will do something before executing time.sleep().
When the user give
Hi,
I'm creating a python script that can take a string and print it to the
screen as a simple multi-columned block of mono-spaced, unhyphenated
text based on a specified character width and line hight for a column.
For example, if i fed the script an an essay, it would format the text
like a
John Nagle wrote:
I've been parsing existing HTML with BeautifulSoup, and occasionally
hit content which has something like Design Advertising, that is,
an instead of an amp;. Is there some way I can get BeautifulSoup
to clean those up? There are various parsing options related to
Peter Machell wrote:
I have an application where I need to take a query from an existing
database and send it to a web api.
[...]
There are always 5 values, but some are blank and some are 'None'.
I'd like to split the lines so I get something resembling XML, like this:
FNAMEFrank/FNAME
Steven D'Aprano wrote:
Try something like this:
# WARNING: untested
def run_without_stdout(*args, **kwargs):
function = args[0]
args = args[1:]
savestdout = sys.stdout
sys.stdout = cStringIO.StringIO()
result = None
try:
result = function(*args, **kwargs)
Hello,
I'm trying to write a program to send python statements to a python
server via tcp and then get back results via a tcp connection. It
nearly works ... but I'm totally lost with the embedded dictionary (I'm
quite new to python).
The first part of the server start the python interpreter via
For people that will read the posts in the future, there is a little
bug (it doesn't change the output of this program):
items = alist[:]
Has to be:
alist = alist[:]
Sorry,
bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Leon wrote:
Hi,
I'm creating a python script that can take a string and print it to the
screen as a simple multi-columned block of mono-spaced, unhyphenated
text based on a specified character width and line hight for a column.
For example, if i fed the script an an essay, it would format
On 25 Dec 2006 21:50:15 -0800, many_years_after wrote
While , there is something wrong in my expression. What I mean is the
thread will wait some time after doing some tasks. I want to know is
there any method to end the thread or make it out of execution of
waiting. I use time.sleep() to let
[EMAIL PROTECTED] wrote:
Steven D'Aprano wrote:
Try something like this:
# WARNING: untested
def run_without_stdout(*args, **kwargs):
function = args[0]
args = args[1:]
savestdout = sys.stdout
sys.stdout = cStringIO.StringIO()
result = None
try:
[EMAIL PROTECTED] wrote:
I have tried your method, but I found it didn't work as expected.
The output produced by the external function couldn't be depressed,
but the print statement i wrote in python is depressed. It seems
make cStringIO.StringIO() as a temporary replacement of sys.stdout
I need a function (blocking or non-blocking) that tells me if a key has
been pressed (even before it has been released etc.). Also, I would of
course like to know _which_ key has been pressed.
I know that this probably does not exist in the Python library already
as a platform-independant
Hi Luis,
Luis Armendariz wrote:
There's no need for savestdout. There's a backup copy in sys.__stdout__
Depending on the code that ran before the call to the
function run_without_stdout, sys.stdout may not be
the same as sys.__stdout__ . Of course, you also have
to be careful regarding threads
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote
[EMAIL PROTECTED] wrote:
I have tried your method, but I found it didn't work as expected.
The output produced by the external function couldn't be depressed,
but the print statement i wrote in python is depressed. It seems
make
Leon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I'm creating a python script that can take a string and print it to the
screen as a simple multi-columned block of mono-spaced, unhyphenated
text based on a specified character width and line hight for a column.
For example,
On 26 Dec 2006 04:14:27 -0800, Leon [EMAIL PROTECTED] wrote:
I'm creating a python script that can take a string and print it to the
screen as a simple multi-columned block of mono-spaced, unhyphenated
text based on a specified character width and line hight for a column.
Hi, Leon,
For
Thanks, Paul. I didn't know about textwrap, that's neat.
Leon,
so in my example change
data1= [testdata[x:x+colwidth] for x in range(0,len(testdata),colwidth)]
to
data1 = textwrap.wrap(testdata,colwidth)
data1 = [x.ljust(colwidth) for x in data1]
oh and I made a mistake that double spaces it.
On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote:
So do you want to remove or replace them with amp; ? If you want
to replace it try the following;
I think he wants to replace them, but just the invalid ones. I.e.,
This this amp; that
would become
This amp; this amp; that
Paul McGuire [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
gettysburgAddress = Four score and seven years ago...
snip
By the way, this variable contains only 3 (very long) lines of text, one for
each paragraph. (Not immediately obvious after Usenet wraps the text.)
-- Paul
--
PySchool Phase II
I just wanted to thank everyone for filling out the survey a few months
back for my PySchool graduate school project. I was able to capture a
lot of good information from the community. For the people who
mentioned to me that I should expand the What Linux Operating System
do
Paul McGuire [EMAIL PROTECTED] wrote:
By the way, this variable contains only 3 (very long) lines of text,
one for each paragraph. (Not immediately obvious after Usenet wraps
the text.)
Usenet doesn't wrap text, all it has is a convention which suggests that
people posting to usenet should
Osiris wrote:
what is a usefull IDE for Python on Windows ?
I saw Eric mentioned.. is that WinXP or Linux ?
What does everybody use ?
I was considering using old and very stable C-code in a new web
application via Python/Plone/Zope.
I like pyscripter, available here:
Hey,
I'm a noob at python so..
I just want to know, is there a function to type text global not in the
program but in other programs(like you where typing it).
For example in a textbox, in a program like cmd.exe or notebook.exe.
I'm using windows xp.
Thanks! :)
/Scripter47
--
Felipe Almeida Lessa [EMAIL PROTECTED] wrote:
On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote:
So do you want to remove or replace them with amp; ? If you
want to replace it try the following;
I think he wants to replace them, but just the invalid ones. I.e.,
This this
On Dec 26, 8:53 am, Larry Bates [EMAIL PROTECTED] wrote:
Osiris wrote:
what is a usefull IDE for Python on Windows ?
I am a happy user of jEDIT.
--
http://mail.python.org/mailman/listinfo/python-list
Hey gang-
I just ran into the fabled Secure Sockets not enabled in ActivePython,
and the ActiveState FAQ says I should just grab _ssl.pyd from
somewhere, offering up the python.org distribution as a possible
source.
I'm on 2.4 at this time, and python.org has what appears to be a
considerably
Dave Borne [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
Thanks, Paul. I didn't know about textwrap, that's neat.
Leon,
so in my example change
data1= [testdata[x:x+colwidth] for x in
range(0,len(testdata),colwidth)]
to
data1 = textwrap.wrap(testdata,colwidth)
data1 =
Felipe Almeida Lessa wrote:
On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote:
So do you want to remove or replace them with amp; ? If you want
to replace it try the following;
I think he wants to replace them, but just the invalid ones. I.e.,
This this amp; that
I'm looking for a module to do fuzzy comparison of strings. I have 2
item master files which are supposed to be identical, but they have
thousands of records where the item numbers don't match in various
ways. One might include a '-' or have leading zeros, or have a single
character missing, or
Duncan Booth skrev:
Felipe Almeida Lessa [EMAIL PROTECTED] wrote:
On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote:
So do you want to remove or replace them with amp; ? If you
want to replace it try the following;
I think he wants to replace them, but just
Steve Bergman wrote:
I'm looking for a module to do fuzzy comparison of strings. [...]
Check module difflib, it returns difference between two sequences.
--
http://mail.python.org/mailman/listinfo/python-list
Dan Jacobson wrote:
Can I feel even better about using perl vs. python, as apparently
python's dependence of formatting, indentation, etc. vs. perl's
(){}; etc. makes writing python programs perhaps very device
dependent. Whereas perl can be written on a tiny tiny screen, and can
withstand
Ben Sizer wrote:
I've installed several different versions of Python across several
different versions of MS Windows, and not a single time was the Python
directory or the Scripts subdirectory added to the PATH environment
variable. Every time, I've had to go through and add this by hand, to
Andreas Lysdal [EMAIL PROTECTED] wrote:
P.S. apos is handled specially as it isn't technically a
valid html entity (and Python doesn't include it in its entity
list), but it is an xml entity and recognised by many browsers so some
people might use it in html.
Hey i fund this site:
Hi,
I created a Google Custom Search Engine for searching on:
Software / Compilers / Optimization
This is basically a regular full Google search giving preference to
technical sites such as IEEE, ACM, citeseer, the Universities,
news-group (this one included), commercial sites such as Intel,
[EMAIL PROTECTED] wrote:
I need a function (blocking or non-blocking) that tells me if a key has
been pressed (even before it has been released etc.). Also, I would of
course like to know _which_ key has been pressed.
I know that this probably does not exist in the Python library already
as
Hi,
It is possible to get bytecode from code object.
Reversely, is it possible to create code object from bytecode?
ex.
## python code (not a module)
pycode = '''\
print ul\n
for item in items:
print li%s/li\n % item
print /ul\n
'''
## compile it and get bytecode
code =
In my web application I use Apache and mod_python.
I allow users to upload huge files( via HTTP FORM , using POST method)
I would like to store the file directly on a hard disk and not to
upload the WHOLE huge file into server's memory first.
Can anyone suggest a solution?
Thank you
LB
--
[EMAIL PROTECTED] wrote:
It is possible to get bytecode from code object.
Reversely, is it possible to create code object from bytecode?
ex.
## python code (not a module)
pycode = '''\
print ul\n
for item in items:
print li%s/li\n % item
print /ul\n
'''
##
On Tue, 2006-12-26 at 11:15 -0800, [EMAIL PROTECTED] wrote:
Hi,
It is possible to get bytecode from code object.
Reversely, is it possible to create code object from bytecode?
ex.
## python code (not a module)
pycode = '''\
print ul\n
for item in items:
print li%s/li\n %
On Tue, 2006-12-26 at 14:48 -0500, Carsten Haese wrote:
* Code objects come in two flavors: statements and expressions.
* exec can execute a 'statement' flavored code object.
* eval can evaluate an 'expression' flavored code object.
* Your code snippet is a statement, actually, a suite of
ZeD wrote:
Peter Machell wrote:
I have an application where I need to take a query from an existing
database and send it to a web api.
[...]
There are always 5 values, but some are blank and some are 'None'.
I'd like to split the lines so I get something resembling XML, like this:
At Monday 25/12/2006 21:24, Paul McGuire wrote:
For example, for all the complexity in writing Sudoku solvers, there are
fewer than 3.3 million possible permutations of 9 rows of the digits 1-9,
and far fewer permutations that match the additional column and box
constraints. Why not just
Peter Machell wrote:
ZeD wrote: An excellent response providing code
Thanks very much ZeD. This will do what I need to.
The next step is to do some regex on the phone number to ensure it's
local and correct. How can I split these up so each value has a key?
Well, you should try that,
On 12/26/06, Gabriel Genellina [EMAIL PROTECTED] wrote:
At Monday 25/12/2006 21:24, Paul McGuire wrote:
For example, for all the complexity in writing Sudoku solvers, there are
fewer than 3.3 million possible permutations of 9 rows of the digits 1-9,
and far fewer permutations that match the
Thanks Fredrik and Carsten,
I'll try marshal module.
* Your code snippet is a statement, actually, a suite of statements. You
need to exec it, not eval it.
* You seem to think that eval'ing or exec'ing a code object will
magically capture its output stream. It won't.
Oh, it's my mistake.
On Tue, 2006-12-26 at 17:39 -0300, Gabriel Genellina wrote:
At Monday 25/12/2006 21:24, Paul McGuire wrote:
For example, for all the complexity in writing Sudoku solvers, there are
fewer than 3.3 million possible permutations of 9 rows of the digits 1-9,
and far fewer permutations that match
Wojciech Mula wrote:
Steve Bergman wrote:
I'm looking for a module to do fuzzy comparison of strings. [...]
Check module difflib, it returns difference between two sequences.
and it's intended for comparing text files, and is relatively slow.
Google python levenshtein. You'll probably find
This, which is from a real web site, went into BeautifulSoup:
param name=movie value=/images/offersBanners/sw04.swf?binfot=We offer
fantastic rates for selected weeks or days!!blinkt=Click here
linkurl=/Europe/Spain/Madrid/Apartments/Offer/2408 /
And this came out, via prettify:
addresssnippet
At Tuesday 26/12/2006 10:25, [EMAIL PROTECTED] wrote:
I need a function (blocking or non-blocking) that tells me if a key has
been pressed (even before it has been released etc.). Also, I would of
course like to know _which_ key has been pressed.
On Windows you can listen to the messages
At Tuesday 26/12/2006 13:57, Andreas Lysdal wrote:
I'm a noob at python so..
I just want to know, is there a function to type text global not in the
program but in other programs(like you where typing it).
For example in a textbox, in a program like cmd.exe or notebook.exe.
I'm using windows
Ross Ridge wrote:
Ben Sizer wrote:
I've installed several different versions of Python across several
different versions of MS Windows, and not a single time was the Python
directory or the Scripts subdirectory added to the PATH environment
variable.
Personally, I hate Windows
On Tue, 2006-12-26 at 13:08 -0800, John Machin wrote:
Wojciech Mula wrote:
Steve Bergman wrote:
I'm looking for a module to do fuzzy comparison of strings. [...]
Check module difflib, it returns difference between two sequences.
and it's intended for comparing text files, and is
At Tuesday 26/12/2006 18:08, John Machin wrote:
Wojciech Mula wrote:
Steve Bergman wrote:
I'm looking for a module to do fuzzy comparison of strings. [...]
Check module difflib, it returns difference between two sequences.
and it's intended for comparing text files, and is relatively
Scott David Daniels wrote:
Peter Machell wrote:
ZeD wrote: An excellent response providing code
Thanks very much ZeD. This will do what I need to.
The next step is to do some regex on the phone number to ensure it's
local and correct. How can I split these up so each value has a key?
Found out a quite fun way to store persistent variables in functions in
python.
def doStuff():
try:
#Will throw exception if not set
doStuff.timesUsed
##
#Insert stuff to do each time the function is called here
##
doStuff.timesUsed+=1
print Function call!
except
Carsten Haese wrote:
On Tue, 2006-12-26 at 13:08 -0800, John Machin wrote:
Wojciech Mula wrote:
Steve Bergman wrote:
I'm looking for a module to do fuzzy comparison of strings. [...]
Check module difflib, it returns difference between two sequences.
and it's intended for
Gabriel Genellina [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
At Monday 25/12/2006 21:24, Paul McGuire wrote:
For example, for all the complexity in writing Sudoku solvers, there are
fewer than 3.3 million possible permutations of 9 rows of the digits 1-9,
and far fewer
Peter Machell wrote:
I can almost do it this way:
for x in bar:
fname = x[0]
if fname == :
fname == None
sname = x[1]
if sname == :
sname == None
print FNAME+fname+/FNAME+SNAME+sname+/SNAME
At Tuesday 26/12/2006 18:57, Peter Machell wrote:
for x in bar:
fname = x[0]
if fname == :
fname == None
sname = x[1]
if sname == :
sname == None
print FNAME+fname+/FNAME+SNAME+sname+/SNAME
At Tuesday 26/12/2006 19:13, buffi wrote:
def doStuff():
try:
#Will throw exception if not set
doStuff.timesUsed
Is this concidered bad coding practice since I guess persistent
variables in functions are not meant to be?
I don't think so, since Python proudly says that functions
Peter Machell wrote:
Scott David Daniels wrote:
Peter Machell wrote:
ZeD wrote: An excellent response providing code
Thanks very much ZeD. This will do what I need to.
The next step is to do some regex on the phone number to ensure it's
local and correct. How can I split these up so
I don't think so, since Python proudly says that functions are
first-class objects.
CherryPy does a similar thing to mark a method as exposed.
But perhaps I'd write the code this way to avoid an unneeded and
risky recursive call:
def doStuff(some, arguments, may, *be, **required):
Found out a quite fun way to store persistent variables in functions in
python.
Is this concidered bad coding practice since I guess persistent
variables in functions are not meant to be?
I am using is in one of my recent projects. I was thinking of
it sort of like static variables in C.
John Nagle wrote:
Felipe Almeida Lessa wrote:
On 26 Dec 2006 04:22:38 -0800, placid [EMAIL PROTECTED] wrote:
So do you want to remove or replace them with amp; ? If you want
to replace it try the following;
I think he wants to replace them, but just the invalid ones. I.e.,
I've been using Python for a few days. It's such the perfect language
for parsing data!
I really like it so far, but I'm having a hard time reading a file,
reading the first few hex characters converting them to an integer.
Once the characters are converted to an integer, I'd like to write the
On Tue, 26 Dec 2006 03:21:57 -0800, Luis Armendariz wrote:
On Tuesday, 26.12.06 at 21:28, Steven D'Aprano wrote:
# WARNING: untested
def run_without_stdout(*args, **kwargs):
function = args[0]
args = args[1:]
savestdout = sys.stdout
sys.stdout = cStringIO.StringIO()
On Tue, 26 Dec 2006 15:01:40 -0800, buffi wrote:
def doStuff(some, arguments, may, *be, **required):
try:
doStuff.timesUsed += 1
except AttributeError:
doStuff.timesUsed = 1
# ... special case for first call ...
# ...common code...
True, the
gonzlobo wrote:
I've been using Python for a few days. It's such the perfect language
for parsing data!
I really like it so far, but I'm having a hard time reading a file,
reading the first few hex characters converting them to an integer.
Once the characters are converted to an integer,
On Tue, 26 Dec 2006 16:50:06 -0700, gonzlobo wrote:
I've been using Python for a few days. It's such the perfect language
for parsing data!
I really like it so far, but I'm having a hard time reading a file,
reading the first few hex characters converting them to an integer.
Once the
[EMAIL PROTECTED] wrote:
After some trials I found that put os.close(1) before calling the
function will depress the output. In fact, os.close(1) closed
standard output, but I don't know how to open it again after the function's
execution.
Try this:
fd = os.dup(1)
os.close(1)
sys.stdout =
[EMAIL PROTECTED] wrote:
Hi,
I'm writing a program which uses an external module written in C
and calls a function provided by the module to do my job. The
function produces a lot of output to the stdout.
Is there a way to suppress the output produced by the function and
hence make
Carl Banks wrote:
[EMAIL PROTECTED] wrote:
After some trials I found that put os.close(1) before calling the
function will depress the output. In fact, os.close(1) closed
standard output, but I don't know how to open it again after the function's
execution.
Try this:
fd = os.dup(1)
gonzlobo wrote:
I've been using Python for a few days. It's such the perfect language
for parsing data!
I really like it so far, but I'm having a hard time reading a file,
reading the first few hex characters converting them to an integer.
Once the characters are converted to an integer,
WaterWalk wrote:
gonzlobo wrote:
I've been using Python for a few days. It's such the perfect language
for parsing data!
I really like it so far, but I'm having a hard time reading a file,
reading the first few hex characters converting them to an integer.
Once the characters are
WaterWalk wrote:
WaterWalk wrote:
gonzlobo wrote:
I've been using Python for a few days. It's such the perfect language
for parsing data!
I really like it so far, but I'm having a hard time reading a file,
reading the first few hex characters converting them to an integer.
Osiris wrote:
what is a usefull IDE for Python on Windows ?
The Zeus IDE: http://www.zeusedit.com/python.html
Jussi
--
http://mail.python.org/mailman/listinfo/python-list
Hi.
One of the things I'd like to do with Python is find a way to
consistently implement Smalltalk's loose methods. This is a
capability whereby additional methods can be added dynamically to
existing classes.
In some respects, it's possible with Python. While object cannot be
touched, it's
I could have sworn someone was working on a module recently with a
threading-like API that used subprocesses under the covers, but 10 minutes
or so of googling didn't yield anything. Pointers appreciated.
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
I could have sworn someone was working on a module recently with a
threading-like API that used subprocesses under the covers, but 10 minutes
or so of googling didn't yield anything. Pointers appreciated.
At Wednesday 27/12/2006 01:58, [EMAIL PROTECTED] wrote:
I could have sworn someone was working on a module recently with a
threading-like API that used subprocesses under the covers, but 10 minutes
or so of googling didn't yield anything. Pointers appreciated.
Perhaps this project?
I just
On Sat, 23 Dec 2006 12:38:30 -0800, Fuzzyman wrote:
Lars Rune Nøstdal wrote:
On Fri, 08 Dec 2006 03:07:09 -0800, Mark Tarver wrote:
How do you compare Python to Lisp? What specific advantages do you
think that one has over the other?
Note I'm not a Python person and I have no axes
Bugs item #1621367, was opened at 2006-12-23 11:04
Message generated for change (Comment added) made by mark-roberts
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1621367group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1619659, was opened at 2006-12-20 12:42
Message generated for change (Comment added) made by mark-roberts
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1619659group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1622533, was opened at 2006-12-26 18:47
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1622533group_id=5470
Please note that this message will contain a full copy of
Bugs item #1621367, was opened at 2006-12-23 12:04
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1621367group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1545837, was opened at 2006-08-24 04:49
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1545837group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1622664, was opened at 2006-12-26 16:15
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1622664group_id=5470
Please note that this message will contain a full copy of
95 matches
Mail list logo