Paul Rubin wrote:
gregarican [EMAIL PROTECTED] writes:
reversed(a_string) (python)
Which version of Python offers this function? It doesn't seem to be
available in the 2.3 version I have installed...
I think it's new in 2.4.
Needs a little help, though:
print reversed(abba)
On 13 Mar 2006 10:19:05 -0800, Paul Rubin
http://phr.cx@nospam.invalid wrote:
Paul Boddie [EMAIL PROTECTED] writes:
What people don't usually understand (or rather complain about loudly)
is that Trolltech can refuse to license Qt to you under the commercial
licence, as is their right as the
Robert Dodier wrote:
Hello all,
I'm trying to find substrings that look like 'FOO blah blah blah'
in a string. For example give 'blah FOO blah1a blah1b FOO blah2
FOO blah3a blah3b blah3b' I want to get three substrings,
'FOO blah1a blah1b', 'FOO blah2', and 'FOO blah3a blah3b blah3b'.
On Monday 13 March 2006 18:31, Math wrote:
Does anybody know what I have to do to run only 1 instance of my Python
Application?
How do I check if I'm running more instances of a Application?
I would use lockfiles for that purpose. Like this:
Peter Otten [EMAIL PROTECTED] writes:
print reversed(abba)
reversed object at 0x4029454c
Darn, yes, that's the second time in the past couple weeks I've made
that exact same error in a clpy post. So what's the most concise way
of turning it back into a string?
robert [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Though mostly ignorant of threading issues, I wonder if the following would
work. Derive a class from dict. Define a backup method that sets and
unsets a private self.lock. Define setitem and delitem methods that wrap
calls
Martin P. Hellwig wrote:
While I was reading PEP 8 I came across this part:
Function and method arguments
Always use 'self' for the first argument to instance methods.
Always use 'cls' for the first argument to class methods.
Now I'm rather new to programming and unfamiliar to
[EMAIL PROTECTED] schrieb:
Install python using fink, and invoke that. Should work against X11 for
all GUI-Toolkits.
I prefer not to do this. Darwin is already a Unix, and Apple provides
a version of X11 that works well with it.
Fink seems like an
unecessary layer that I would rather
Robert Dodier wrote:
Hello all,
I'm trying to find substrings that look like 'FOO blah blah blah'
in a string. For example give 'blah FOO blah1a blah1b FOO blah2
FOO blah3a blah3b blah3b' I want to get three substrings,
'FOO blah1a blah1b', 'FOO blah2', and 'FOO blah3a blah3b blah3b'.
On 2006-03-13, Math [EMAIL PROTECTED] wrote:
Does anybody know what I have to do to run only 1 instance of
my Python Application?
Yes.
http://www.google.com/search?hl=enq=python+single+application+instance
On Unix, one creates a lock file. Typically
/var/run/appname.pid if you want a single
Since you are comfortable with HTML, you could use the browser as your
GUI, and use a lightweight python server like Karrigell (or CherryPy,
or Turbogears) to serve the pages. A little javascript to move the
highlighting around, and . . .
Well, frankly, it's still harder than it ought to be. (I
Paul Rubin wrote:
Darn, yes, that's the second time in the past couple weeks I've made
that exact same error in a clpy post. So what's the most concise way
of turning it back into a string? ''.join(list(reversed(a_string))) ?
Bleccch.
Use Ruby:
print A String.reverse
Just kidding :-)~
Paul Rubin wrote:
Paul Boddie [EMAIL PROTECTED] writes:
What people don't usually understand (or rather complain about loudly)
is that Trolltech can refuse to license Qt to you under the commercial
licence, as is their right as the owner of the copyrighted work.
What is the deal here?
Python closures are apparently very poor, but from what I can surmise
of the PyGTK2 page, instances of objects are dynamic enough to add new
methods, so you get your callbacks, at least.
It's true that Python's lambda is somewhat limited, but this is
rarely a problem because you can define
Paul Rubin wrote:
So what's the most concise way
of turning it back into a string? ''.join(list(reversed(a_string))) ?
You don't need the list(), join() can take an iterator:
''.join(reversed(a_string))
Kent
--
http://mail.python.org/mailman/listinfo/python-list
i'm pretty much a newbie, too, and have been dabbling with some gui
tools
so far, i like pythoncard pretty well
it wraps wxpython and seems to be pretty easy to use
--
http://mail.python.org/mailman/listinfo/python-list
Hi
Being a Delphi user at work, I know what you mean :)
The best python IDE I have found is Stani's Python Editor (SPE), and I
think Stani himself replied to your message as well.
It integrates wxGlade, which is nice for form-building, although I don't
really do much of that with the python
1. Try os.popen:
import os
os.popen('echo Hello World').read()
'Hello World\n'
2. Try a test environment built for testing shell commands, such as
DejaGnu:
http://www.gnu.org/software/dejagnu/
--
http://mail.python.org/mailman/listinfo/python-list
I'm pretty new to python and am trying to write a fairly small
application to learn more about the language. I'm noticing some
unexpected behavior in using lists in some classes to hold child
objects. Here is some abbreviated code to help me explain.
class
Wow! Thanks everyone. Such coherent and philisophical answers. I will
read them all over on a lazy sunday as this type ethereal stuff hurts
my head after about 30 seconds. All the gurus on the python list are so
friggin' smart. This should improve my coding after I digest it all.
Thanks Again!
BWill wrote:
and ixnay on the ubyray or else I'll tell you where to stick your
endblock delimiter :P
Umm,
Did you mean to write the above?
What has it to do with Ruby?
--
http://mail.python.org/mailman/listinfo/python-list
Apparently, the p1 instance somehow thinks that the i3 instance is in
its list. The i3 instance should instead be in the list for p2. By the
way, when I call the __str__() method of p2, I get the same results as
when I do it for p1. The list appears to be acting as if it were a
static
[EMAIL PROTECTED] wrote:
I am running Mac OS X. I have Tcl/Tk installed. I can run the Aqua
version (TkAqua) of wish by typing 'wish' at a terminal prompt. I can
run the X11 version (TkX11) of wish by typing 'wish8.4-X11' in an
x-term. If I run python and import Tkinter it always grabs the
Hello again,
I am disappointed. You are the experts, you've got to try harder ;-)
What i want is a generalisation of this tiny function:
import tokenize
import token
def magic_function(s):
readline = open(s.gi_frame.f_code.co_filename).readline
for t in
ahart wrote:
I'm pretty new to python and am trying to write a fairly small
application to learn more about the language. I'm noticing some
unexpected behavior in using lists in some classes to hold child
objects. Here is some abbreviated code to help me explain.
When I run this script, I
Michal Kwiatkowski [EMAIL PROTECTED] writes:
[...]
Return a property attribute for new-style classes. After reading a bit
about descriptors I've just assumed that property is a handy way to
create (any) descriptors. Learning that it only creates overriding
descriptors was a bit shocking. I'm
Well, there's OpenLaszlo, which handles the sounds/animation for
http:www.pandora.com, I understand. It may be overkill for a desktop
app, but it's free. It was originally written in Python, I think, but
it uses ECMAScript for scripting.
It's free, and reportedly handles sounds and animations,
2006/3/12, Fabiano Sidler [EMAIL PROTECTED]:
Is there any way to use anonymous memory mapping in python, versions
earlier than 2.5?
No idea or no way to do it?
Greetings,
F. Sidler
--
http://mail.python.org/mailman/listinfo/python-list
ahart a écrit :
I'm pretty new to python and am trying to write a fairly small
application to learn more about the language. I'm noticing some
unexpected behavior in using lists in some classes to hold child
objects. Here is some abbreviated code to help me explain.
[EMAIL PROTECTED] wrote:
Hello again,
I am disappointed. You are the experts, you've got to try harder ;-)
What i want is a generalisation of this tiny function:
Why? Maybe we can find a better way...
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Hi Kent,
My intention is to be able to retrieve any line of code in a running
program, in the following way:
def magic_funct(s):
for line in file(s.gi_frame.f_code.co_filename):
print line
magic_funct(i for i in [1,2,3])
I just find it stupid to be obliged to use a
[EMAIL PROTECTED] writes:
I don't want a better way, i just want a solution to the problem as
described!
I once did something like:
try:
raise ValueError
except ValueError, e:
pass
then get the traceback object out of e, and snarf the relevant source
line as mentioned before.
--
In [EMAIL PROTECTED], robert wrote:
* Ruby without refcounts provides no deterministic __del__ in
non-circular refs == your type finally finally finally .close .close
.close all the time
Which is what you should type in Python too as there's no guarantee that
`__del__()` will be called
Diez, Scott, and Bruno,
I thank you all for your help and suggestions. I wasn't aware that
default values were considered class (static) values. That seems a
little odd to me, but as long as I know that's the case, I'll be fine.
I initialized my list member in the __init__() method and all is
[EMAIL PROTECTED] wrote:
I don't want a better way, i just want a solution to the problem as
described!
any special reason you cannot use Python to write Python programs,
instead of demanding that someone else wastes time inventing a non-
portable solution to a braindead problem?
what's wrong
[EMAIL PROTECTED] wrote:
I agree to a certain extent, but by analogy
!DOCTYPE a [
!ELEMENT a (b | c*)+
]
a/a
is a valid SGML/XML document and their is a lot of (superficial?)
similarity between DTD content models and REs.
they're related, but they don't have the same semantics (Python
How do I get a list of localized month names for current locale? The
first thing that came to my mind was an ugly hack:
import datetime
for i in range(12):
# as I remember, all months in 2005 had 1st in days
datetime.date(2005, i + 1, 1).strftime('%B')
but I am sure there is a better
gregarican [EMAIL PROTECTED] writes:
reversed(a_string) (python)
Which version of Python offers this function? It doesn't seem to be
available in the 2.3 version I have installed...
I think it's new in 2.4.
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-03-13, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello again,
I am disappointed.
Yea, life's like that.
Sucks, eh?
--
Grant Edwards grante Yow! ... The waitress's
at UNIFORM sheds TARTAR SAUCE
What features exactly does it not have?
Come to think of it, the only exception is probably that PyScripter (AFAIK)
does not provide conditional pause.
But I really like it. PyScripter is written in Delphi, my other favorite
language :)
-Dag
--
Jarek Zgoda wrote:
How do I get a list of localized month names for current locale? The
first thing that came to my mind was an ugly hack:
import datetime
for i in range(12):
# as I remember, all months in 2005 had 1st in days
datetime.date(2005, i + 1, 1).strftime('%B')
doesn't
I'm trying to build python 2.4.2 on AIX 5.3 with the IBM xlC compiler
as per the notes in the AIX Readme file. Basically my make fails with
the errors listed below.
I'm calling configure with:
./configure --with-gcc=xlc_r -q64 --with-cxx=xlC_r -q64
--disable-ipv6 AR=ar -X64
It looks like it's
Robert Dodier wrote:
I've decided it's easier for me just to search for FOO, and then
break up the string based on the locations of FOO.
But I'd like to better understand regular expressions.
Those who cannot learn regular expressions are doomed to repeat string
searches. Which is not such
Jarek Zgoda wrote:
How do I get a list of localized month names for current locale? The
first thing that came to my mind was an ugly hack:
import locale
locale.nl_langinfo(locale.MON_1)
'January'
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
Trent Do you have any profile information for where in the logging
Trent package the time is being spent?
Looking back at a recent run from a few days ago Formatter.formatTime()
seems to be a current problem.
As Kent suggested, don't use %(asctime)s if you don't want fancy time
Wow, thanks for all the reponses. Very helpful!
--
http://mail.python.org/mailman/listinfo/python-list
I've very new to python, and am currently toying with pythonD. Could
someone please explain the rationale behind python designers' thinking
in deciding the function range(1,12) should return the sequence 1 to
11 rather than the more intuitively-useful 1 to 12??
After downloading the substantial
Fabiano Sidler wrote:
2006/3/12, Fabiano Sidler [EMAIL PROTECTED]:
Is there any way to use anonymous memory mapping in python, versions
earlier than 2.5?
No idea or no way to do it?
Often when there's no reply for a while, it's because the question is
unclear. Rather than just appending
Hi
I have a script e.g.
import package.module
ID = 55
package.module.checkID()
now in package.module.checkID function, i wnat to know what is the ID
defiend in the calling scriipt
if I dot globals(), it returns only items in module. is there a way
to get the script level namesapce
John Savage wrote:
Could someone please explain the rationale behind python designers' thinking
in deciding the function range(1,12) should return the sequence 1 to
11 rather than the more intuitively-useful 1 to 12??
Essentially, it has to do with the decision to have range(5) mean the
list
On Sun, 12 Mar 2006 21:50:32 +0800
Keith [EMAIL PROTECTED] wrote:
So lets say have two modules.. moduleA and moduleB. they
are both imported into a main python program using the
from module import * command. now moduleA has a dynamic
command that needs to access a command that is in moduleB.
On 3/14/06, John Savage [EMAIL PROTECTED] wrote:
I've very new to python, and am currently toying with pythonD. Couldsomeone please explain the rationale behind python designers' thinkingin deciding the function range(1,12) should return the sequence 1 to
11 rather than the more intuitively-useful
Sakcee wrote:
now in package.module.checkID function, i wnat to know what is the ID
defiend in the calling scriipt
It's almost always a really bad idea to kludge scopes like this. If
you need to access a variable from the caller's scope in a module
function, make it an argument to that
fumanchu wrote:
If you used a Queue, it wouldn't be the container itself; rather, it
would be a gatekeeper between the container and consumer code. A
minimal example of user-side code would be:
class Request:
def __init__(self, op, data):
self.op = op
self.data = data
I'm writing a python program which reads input device events so it needs
to know sizeof(struct timeval). By using the struct module I should be
able to work out sizeof(long) from python, but I can't think of a way to
measure non-fundamental types without including a little bit of C,
which I'd
Hi, I am now using minidom for my current development. I use cloneNode
method in Element object, but it just does not work. The test code is
very simple as follows:
=CODE==
from xml.dom.minidom import *
a=Element('see')
print a.toprettyxml()
b=a.cloneNode(True)
print
John Savage wrote:
Could
someone please explain the rationale behind python designers' thinking
in deciding the function range(1,12) should return the sequence 1 to
11 rather than the more intuitively-useful 1 to 12??
There are several ways to do this, closed intervals, half-open
intervals,
Tony Houghton wrote:
How safe would I be assuming that
sizeof(struct timeval) == 2 * sizeof(long)
is always true on Linux on different architectures?
Based on what I was looking at today (well, yesterday now), you might
be wrong.
I do know that the size of a struct utmp
Big and Blue wrote:
Tony Houghton wrote:
How safe would I be assuming that
sizeof(struct timeval) == 2 * sizeof(long)
is always true on Linux on different architectures?
Based on what I was looking at today (well, yesterday now), you might
be wrong.
However, it looks
On Mon, 13 Mar 2006 17:18:16 +0100
Martin P. Hellwig [EMAIL PROTECTED] wrote:
While I was reading PEP 8 I came across this part:
Function and method arguments
Always use 'self' for the first argument to instance
methods. Always use 'cls' for the first argument to
class
On 12 Mar 2006 17:58:43 -0800
[EMAIL PROTECTED] wrote:
Double-underscore methods are rewritten with the class
name? That's an ugly hack, but remember I'm coming from
Perl. If the language doesn't pull many other hijinks,
that's OK.
This is GvR's way of saying do not use double-underscore
I have following two classes
Code:
## file_A.py
class A(object):
## a contains is instances of A
a= [ ] def __init__(self, node):
self.nodes_in_A = []
self.nodes_in_A.append(node) packet_queue = [ ] ...etc
## file_B.py
import A
class B(object):
## n contains instances of B
In [EMAIL PROTECTED],
Big and Blue [EMAIL PROTECTED] wrote:
Big and Blue wrote:
Tony Houghton wrote:
How safe would I be assuming that
sizeof(struct timeval) == 2 * sizeof(long)
is always true on Linux on different architectures?
Based on what I was looking at today (well,
[robert]
That queue/passing-through-only-an-extra-global-var communication is
acceptable for thin thread interaction.
( hope this extra global var is thread-safe in future Python's :-) )
But real thread-programming should also be possible in Python - and it
is with the usual discipline in
Michael Tobis [EMAIL PROTECTED] wrote:
While the new one is much better than the old website, the logo strikes
me as awful.
I personally believe the new logo is miles better than the old one.
Whether you see snakes or a plus-sign or a yin-yang, it has a nice
harmonious look that still captures
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
In [EMAIL PROTECTED], robert wrote:
* Ruby without refcounts provides no deterministic __del__ in
non-circular refs == your type finally finally finally .close .close
.close all the time
Which is what you should type in Python too as
In [EMAIL PROTECTED],
Big and Blue [EMAIL PROTECTED] wrote:
Tony Houghton wrote:
How safe would I be assuming that
sizeof(struct timeval) == 2 * sizeof(long)
is always true on Linux on different architectures?
Based on what I was looking at today (well, yesterday now), you
we can do it with 'who' in *nuix, but os.getlogin() returns only the
user of the current process...
how to do it by python, any suggestions?
Best Regards.
--
http://mail.python.org/mailman/listinfo/python-list
markov query
I have noticed a couple markov implementations in python, but none
quite seem to do what i would like. Most seem to do an analysis of some
text and create a new text based on that... I think, (sorry i just
don't know terminology well) a markov table (or is it called a
transition
On Tue, 14 Mar 2006, Tony Houghton [EMAIL PROTECTED]
wrote:-
snip
In any case, it does imply that timeval can be relied on to be 2 *
32-bits (2 * long) in 32-bit architectures and something else in 64-bit
architectures - where long is 64-bit.
Using the source below for a quick test on both a 32
I'm having a scoping problem. I have a module called SpecialFile,
which defines:
def open(fname, mode):
return SpecialFile(fname, mode)
class SpecialFile:
def __init__(self, fname, mode):
self.f = open(fname, mode)
...
The problem, if it isn't obvioius, is that the open() call in
[EMAIL PROTECTED] wrote:
I'm having a scoping problem. I have a module called SpecialFile,
which defines:
def open(fname, mode):
return SpecialFile(fname, mode)
class SpecialFile:
def __init__(self, fname, mode):
self.f = open(fname, mode)
...
[snip]
How do I tell
[robert]
In very rare cases a program crashes (hard to reproduce) :
* several threads work on an object tree with dict's etc. in it. Items
are added, deleted, iteration over .keys() ... ). The threads are good
in such terms, that this core data structure is changed only by atomic
operations,
hi
i have to run a java program inside my python script.
i have some java classes declared:
os.environ['CLASSPATH'] = blah path
then i used the os.system method to invoke the java program and using
ret = os.WEXITSTATUS(os.system(cmd)) to catch the return
Java gave me an error about unable to
Icon is a language that share some similarities with Python:
http://www.cs.arizona.edu/icon/
During the execution of a Icon script there are ways to visualize the
memory:
http://www.cs.arizona.edu/icon/progvis/memmon/memmon.htm
Related pages:
Title: Basic python help
I have the following simple html file that is trying to send data to a python script, however, I am getting a weird server error:
This is my HTML:
html
FORM METHOD=POST ACTION="">
Ticker 1
input type=text name=ticker1 size=10
br
input type=submit value=Submit
input
Kevin Feng schrieb:
More information about this error may be available in the server error log.
Any suggestions? Much thanks.
What does the error log of the webserver say?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Don't know of a Python module (although this doesn't look complex enough for a
package anyway...), but
kpp9c wrote:
P.S. Does any one know first of all whether these are called markov
tables, transition tables or probability tables? I am not sure i am
referring to this correctly and what the
Thanks for the pointer to dejagnu, although it is not what I was after.
The question came about because I was scripting an interface to an
electronics design automation tool that comes with a TCL interface.
I was using a companion perl script called from the TCL to do most of
the more complex
No idea, I do not have permission to access the error log.
On 3/14/06 2:12 AM, in article [EMAIL PROTECTED],
Gregor Horvath [EMAIL PROTECTED] wrote:
Kevin Feng schrieb:
More information about this error may be available in the server error log.
Any suggestions? Much thanks.
(Please don't top-post -- fixed)
Kevin Feng wrote:
On 3/14/06 2:12 AM, in article [EMAIL PROTECTED],
Gregor Horvath [EMAIL PROTECTED] wrote:
Kevin Feng schrieb:
More information about this error may be available in the server error log.
Any suggestions? Much thanks.
What does
Bugs item #1448804, was opened at 2006-03-13 22:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1448804group_id=5470
Please note that this message will contain a full copy of
Bugs item #1448804, was opened at 2006-03-13 22:09
Message generated for change (Comment added) made by ncoghlan
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1448804group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1448934, was opened at 2006-03-13 15:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1448934group_id=5470
Please note that this message will contain a full copy of
Bugs item #1448640, was opened at 2006-03-13 04:54
Message generated for change (Comment added) made by splitscreen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1448640group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1448640, was opened at 2006-03-13 04:54
Message generated for change (Comment added) made by mwh
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1448640group_id=5470
Please note that this message will contain a full copy of the comment thread,
Bugs item #1436428, was opened at 2006-02-22 07:03
Message generated for change (Comment added) made by shadowmorpher
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1436428group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1448640, was opened at 2006-03-13 04:54
Message generated for change (Comment added) made by blais
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1448640group_id=5470
Please note that this message will contain a full copy of the comment thread,
Bugs item #1436428, was opened at 2006-02-21 22:03
Message generated for change (Comment added) made by dpeastman
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1436428group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1449311, was opened at 2006-03-13 18:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1449311group_id=5470
Please note that this message will contain a full copy of
Bugs item #1436428, was opened at 2006-02-21 22:03
Message generated for change (Comment added) made by dpeastman
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1436428group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1448058, was opened at 2006-03-11 15:19
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1448058group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1449397, was opened at 2006-03-14 07:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1449397group_id=5470
Please note that this message will contain a full copy of
Bugs item #1449397, was opened at 2006-03-14 07:50
Message generated for change (Settings changed) made by ruibmartins
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1449397group_id=5470
Please note that this message will contain a full copy of the
101 - 194 of 194 matches
Mail list logo