OSCON 2006: Opening Innovation
http://conferences.oreillynet.com/os2006/
Save the date for the 8th annual O'Reilly Open Source Convention, happening
July 24-28, 2006 at the Oregon Convention Center in beautiful Portland,
Oregon.
Call For Participation
--
Submit a
Hi.
I'm pleased to announce the twenty-eighth development release of PythonCAD,
a CAD package for open-source software users. As the name implies,
PythonCAD is written entirely in Python. The goal of this project is
to create a fully scriptable drafting program that will match and eventually
Alex Martelli wrote:
Alan Morgan [EMAIL PROTECTED] wrote:
...
Excessive cleverness can lead to unmaintainable code. So can excessive
stupidity.
+1 QOTW.
++
Since there are a lot more stupid people than clever people out there I
think the more likely scenario is having to maintain
GazaM wrote:
wow, those were some seriously quick replies, thanks. I understand that
cookies is the best way to do things, but I didn't explain my problem
well, sorry.
Basically, I have a blog in the works and I want to have an online
interface for posting. What I have is a cgi script run
jd wrote:
I have implemented a COM object in Python and I would like
to be able to change the script without stopping and
restarting the application that's using the COM object. Is
there a way to do this? (I can change the program that
calls the COM object if needed.)
I have no idea
questions? enlightened us with:
The things put to screen doesn't redirect to the file I want.
What do you see on screen? What do you want to redirect to the file?
What's the trick in here?
Giving us useful information.
Sybren
--
The problem with the world is stupidity. Not saying there
Blair P. Houghton wrote:
Would it be sufficient in your case merely to allow only .html files to
be loaded? Or URLs without .extensions? Or even just permit only the
http: protocol?
Personally, I'm just noodling around with this right now.
So my case is the abstract case. I think the
Saizan wrote:
Thanks, I had completely missed the module traceback...
I'll use traceback.print_exc(), it seems the most straightforward way.
The only flaw is that the traceback starts in the method where i catch the
exception and not from __main__, but I guess it can't be helped.
Actually, I
Hi!
Does anyone know the precise circumstances when the error
Fatal Python error: Py_EndInterpreter: thread still has a frame
does occur. I checked the source code of pythonrun.c, which tells me
that this error message is thrown in Py_EndInterpreter, when
thread-frame is checked for being
Hi! I have a little problem writing xml files formatted in a way like
the following:
rootnode
nodebla/node
nodebla/node
/rootnode
Every new node element should have a tabulation before it, but when I
use xml.dom.minidom I use writexml, which considers as a new node also
the
On 2/2/06, hotcountrywench [EMAIL PROTECTED] wrote:
I just got a new computer and pyton 2.2 is on it and I have never heard of
it What is is for.
Python is a programming language. It's (loosely speaking) an
interpreted language - that is to say, any software written in Python
needs the Python
Simon Brunning wrote:
I just got a new computer and pyton 2.2 is on it and I have never heard of
it What is is for.
Python is a programming language. It's (loosely speaking) an
interpreted language - that is to say, any software written in Python
needs the Python software around in order to
questions? wrote:
I am calling system command in python by os.system()
I do, os.system(wget http://blah blah blah)
then I run the program by ./programname redirected file
The things put to screen doesn't redirect to the file I want.
the operator redirects standard output only, but wget
Kay Schluehr wrote:
The new Python site is incredibly boring. Sorry to say this. The old
site is/was amateurish but engaged. Now after ~15 years of existence
Pythons looks like it wants to be popular among directors of a german
job centers. It aims to do everything right but what could be
On Wed, 01 Feb 2006 23:40:37 +0100, Daniel Nogradi wrote:
I'm relatively new to object oriented programming, so get confused
about its usage once in a while. Suppose there is a class Image that
has a number of methods, rotate, open, verify, read, close, etc. Then
to use this class my natural
questions?:
os.system(wget http://blah blah blah)
Why don't you use urllib(2) directly in Python?
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 1 Feb 2006, it was written:
Tom Anderson [EMAIL PROTECTED] writes:
The obvious way is make a list of hashes, and sort the list.
Obvious, perhaps, prudent, no. To make the list of hashes, you have to
read all of every single file first, which could take a while. If your
files are
I have converted another example of strategy which I prefer to the 2
described earlier, here it is:
class FindMinima:
def algorithm(self):raise NotImplementedError
class LeastSquares (FindMinima):
def algorithm(self,line):
return (1.1,2.2)
class NewtonsMethod
Hi,
here is the context:
I'm coding a openGL API I will need for a project for my school.
This API is quite simple:
an ooglScene describe all needed to make an openGL, and inherits from a
list. So an ooglScene is fundamentaly a list of ooglObjects (which is
organised as a Composite Pattern).
I have converted another example of strategy which I prefer to the 2
described earlier, here it is:
class FindMinima:
def algorithm(self):raise NotImplementedError
When most of your code does nothing in a pompous way that is a sure sign
that you are heading in the wrong direction.
As requested:
www.guardyannet.com.br
www.tra.web.pt
http://www.cita.es/veracidad/expolingua/Brasil
http://www.collegeboard.com/csearch/majors_careers/profiles/careers/105464.html
http://www.guardyannet.com.br/
http://www.guiagratis.com.br/
http://www.clubedoprofessor.com.br/traduz/
Ok, thanks for all the help guys. It seems that running this type of
script from inside of the html just isn't going to work as needed.
Seems like I'll just have to ditch the .shtml and point directly to a
cgi. This is how the other Python frameworks and sites work, such as
reddit and plone etc
GazaM wrote:
Ok, thanks for all the help guys. It seems that running this type of
script from inside of the html just isn't going to work as needed.
Seems like I'll just have to ditch the .shtml and point directly to a
cgi. This is how the other Python frameworks and sites work, such as
Fuzzyman wrote:
Blair P. Houghton wrote:
webbrowser.py module's handling of http:// accesses
is definitely different from its handling of file:// accesses.
It's worth working out if this is down to webbrowser.py *or* Firefox.
Try launching firefox with the path to the py file and seeing
Daniel Nogradi wrote:
In this case, Image seems to be a python module, with the open function
defined, PIL's Image is not a class.
Thanks for the enlightening remarks, especially this last one, indeed,
it's not a class.
Actually, this way of creating a class instance is good OO
GazaM wrote:
Ok, thanks for all the help guys. It seems that running this type of
script from inside of the html just isn't going to work as needed.
Seems like I'll just have to ditch the .shtml and point directly to a
cgi. This is how the other Python frameworks and sites work, such as
First of all, while I use TextTest, I'm fortunate to be surrounded
by TextTest experts such as Goeff and Johan here at Carmen, so I'm
not a TextTest expert by any measure. I probably use it in an non-
optimal way. For really good answers, I suggest using the mailing
list at sourceforge:
Randall Parker wrote:
Magnus Lycka wrote:
Randall Parker wrote:
Also, compile time errors get caught sooner. They get caught before
tests even get written.
Not if you do Test Driven Tevelopment. Then you write
the tests before you compile your target code! It's
also my experience that the
Peter Hansen wrote:
Fuzzyman wrote:
Blair P. Houghton wrote:
webbrowser.py module's handling of http:// accesses
is definitely different from its handling of file:// accesses.
It's worth working out if this is down to webbrowser.py *or* Firefox.
Try launching firefox with the path to
Jane Goldman wrote:
Hello,
I bigginer Python programmer. I am working on web application that
access PostgreSQL on backend. After I imported PSYCOPG2 module in my
program I started to get unwanded debug output into my web bowser. It is
something like that:
initpsycopg: initializing
GazaM wrote:
Ok, thanks for all the help guys. It seems that running this type of
script from inside of the html just isn't going to work as needed.
Seems like I'll just have to ditch the .shtml and point directly to a
cgi. This is how the other Python frameworks and sites work, such as
Here are my codes:
it doesn't use threading...!
#
# test_pyoogl.py
#
#!/usr/bin/env python
from pyoogl import *
import unittest
class test(unittest.TestCase):
def
Hi all.I've a problem with thread in python.My applications has a GUI that has some button. I've a MVC-like architecture.If i click on a button there is this effect:view.button_1_delete.Bind(EVT_BUTTON,
self.OnDelete)view.button_1_list.Bind(EVT_BUTTON,self.OnList)def OnDelete(self, evt):
Steven D'Aprano [EMAIL PROTECTED] wrote:
image = Image( )
Now you have an image object. What is it?
Answer: it isn't an image at all, not in the plain English sense. (Or if
it is, it is an arbitrary default image picked by the class designer.)
No doubt (presumably some kind of as-yet
Laurent wrote:
Hi,
here is the context:
I'm coding a openGL API I will need for a project for my school.
This API is quite simple:
an ooglScene describe all needed to make an openGL, and inherits from a
list. So an ooglScene is fundamentaly a list of ooglObjects (which is
organised
Magnus Lycka wrote:
Or...don't you have automated tests? Ouch. If you (like me) feel a
little lazy to write a lot of test scripts, you can use a test tool
such as TextTest, that compares output between test runs, rather than
forcing you to write lots of scripts with plenty of assertions. The
Alex Martelli wrote:
Steven D'Aprano [EMAIL PROTECTED] wrote:
And now, at long last, the image object actually is an image. So why make
this a two step process? Whatever the Image() initialization does, why
can't it be done automatically when you read the file?
Two-step construct (2SC) is a
Hi,
I have a need to store directory and filenames in a database. For the
database I chose to use UTF-8 encoding; but the actual encoding used is
probably immaterial: whichever coding I take, I'll run into this issue
eventually.
At first my code worked until I ran into a directory full of
My response is at the end.
Sbaush [EMAIL PROTECTED] wrote:
Hi all.
I've a problem with thread in python.
My applications has a GUI that has some button.
I've a MVC-like architecture.
If i click on a button there is this effect:
view.button_1_delete.Bind(EVT_BUTTON,self.OnDelete)
Peter Hansen wrote:
It appears the correct approach might be something along the lines of
reading the registry to find what application is configured for the
HTTP protocol (HKCR-HTTP-shell-open-command) and run that, passing
it the URL. I think that would do what most people expect, even when
Blair P. Houghton wrote:
Which makes it no security hole at
all, it would seem...
Well, no, that's a little strong. No *new* security hole, maybe. It
would be on the order of having ./ in the PATH for root, and getting
trapped by a hacker who named his rootkit ls or pwd. I.e., it puts
the
I'm working on an expert system that allows dynamic updating of
expert's knowledge and logics. I use database to store the info about
how to evaluate user's responses to questionnaires. The core table
called EvaluationPoint whose records have
In this case, Image seems to be a python module, with the open function
defined, PIL's Image is not a class.
Thanks for the enlightening remarks, especially this last one, indeed,
it's not a class.
Actually, this way of creating a class instance is good OO practice in
many
Tim N. van der Leeuw wrote:
Hi,
I have a need to store directory and filenames in a database. For the
database I chose to use UTF-8 encoding; but the actual encoding used is
probably immaterial: whichever coding I take, I'll run into this issue
eventually.
At first my code worked until I
Hi
I'm staring to learn python for some systems administration projects
and so far this looks like a really great alternative to using shell
for everything. The python docs on the web site are really great, but
I could use come clarification on passing arguments using the
os.spawnlp() function.
An incremental approach and a redesign are not the same thing. It might
be insurmountably difficult to acheeve both in a move to another
platform.
mt
--
http://mail.python.org/mailman/listinfo/python-list
On 2 Feb 2006 09:01:11 -0800, sleepylight [EMAIL PROTECTED] wrote:
Hi
I'm staring to learn python for some systems administration projects
and so far this looks like a really great alternative to using shell
for everything. The python docs on the web site are really great, but
I could use come
That is exactly what I do not want!!
this is not transparent, I'm sure it is possible to make what I want:
Scene = ooglScene()
Scene.run()
scene.append(ooglPoint())
--
http://mail.python.org/mailman/listinfo/python-list
On 2 Feb 2006 09:29:45 -0800, Laurent [EMAIL PROTECTED] wrote:
That is exactly what I do not want!!
this is not transparent, I'm sure it is possible to make what I want:
Scene = ooglScene()
Scene.run()
scene.append(ooglPoint())
Most concurrency is never even remotely transparent. Stop chasing a
Ah! I see now. That makes prefect sense. I guess I was thinking that
python was simply going to pass a whole command string to the program
rather than give each argument as individual strings. Seeing this
makes the documentation seem much more sensible. Thank you!
--
Laurent wrote:
That is exactly what I do not want!!
this is not transparent, I'm sure it is possible to make what I want:
Scene = ooglScene()
Scene.run()
scene.append(ooglPoint())
Well, if you know so well what you want, why don't you know how to do it?
Besides: just using threads might
In article [EMAIL PROTECTED],
Alex Martelli [EMAIL PROTECTED] wrote:
Alan Morgan [EMAIL PROTECTED] wrote:
...
Excessive cleverness can lead to unmaintainable code. So can excessive
stupidity.
+1 QOTW.
import blush
Since there are a lot more stupid people than clever people out there I
This is not a fantasm...
Why this can not work??
in a thread a loop (the glut main loop) called by Scene.run()
and in a second something else, e.g. function A
A want to add an object in the Scene, the it call
Scene.append(anObject)
and in his next step, the glutmainloop will see that there is a
Thanks for the insightful answer, Magnus. I have a lot of stuff to
digest from your message :-) Maybe I'll continue the discussion on the
mailing list you mentioned.
Grig
--
http://mail.python.org/mailman/listinfo/python-list
OSCON 2006: Opening Innovation
http://conferences.oreillynet.com/os2006/
Save the date for the 8th annual O'Reilly Open Source Convention, happening
July 24-28, 2006 at the Oregon Convention Center in beautiful Portland,
Oregon.
Call For Participation
--
Submit a
threading.Thread(target = Scene.run).start() WORKS !!!
great thx ;)
now this should be better if the thread can ben declared inside the
class!
--
http://mail.python.org/mailman/listinfo/python-list
Ognen Duzlevski wrote:
Volker Grabsch [EMAIL PROTECTED] wrote:
I'm sure you could replace 2/3 of your code with something much simpler
(and shorter!) just by not inventing a new language and using the power
of Python instead.
Hi Volker,
I appreciate your comments. Basically, the reason
this is a comment in JavaScript, which is itself inside an HTML comment
Did you read the post?
misread it rather ...
--
http://mail.python.org/mailman/listinfo/python-list
Youpe!
That work as I want
Thx everybody ;)
The problem was that I launched the glut main loop into a thread, and
then it was separated from his initialisations functions
I put it into another method and launch that method into a thread...!
That work!
--
Kent Johnson [EMAIL PROTECTED] wrote:
Ognen Duzlevski wrote:
Can you suggest a better approach or did you already do that and I just
missed
it? :)
With the above definitions, an equivalent class is created by calling
page = classFactory( 'page', { 'name' : None, 'caption': None,
hi all,
I have a simple snippet I am trying to keep the format the same as
plain text, though I want to embed it in html ...
basically,
print Content-type:text/plain\n\n;
getrup = os.popen('ruptime').read()
print getrup
is the same format as if I ran 'ruptime' from the command line.
If I
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hi all,
I have a simple snippet I am trying to keep the format the same as
plain text, though I want to embed it in html ...
basically,
print Content-type:text/plain\n\n;
getrup = os.popen('ruptime').read()
print getrup
is the
Alex Martelli wrote:
Disagree -- far more people THINK they're clever, than really ARE
clever. According to a recent article in the Financial Times, over 40%
of a typical financial firm's employees firmly believe they are among
the 5% best employees of the firm -- and the situation, believe
Hi,
I have a QListview widget that allows me to store a bunch of strings in
it. This strings can be visualized, sorted, selected, etc.
My Problem is that I cant find a way to get the user selected items
back from it! I looked over the Qt documentation many times over but
there is no method to
Flavio schrieb:
Hi,
I have a QListview widget that allows me to store a bunch of strings in
it. This strings can be visualized, sorted, selected, etc.
My Problem is that I cant find a way to get the user selected items
back from it! I looked over the Qt documentation many times over but
Hi.
I'm pleased to announce the twenty-eighth development release of PythonCAD,
a CAD package for open-source software users. As the name implies,
PythonCAD is written entirely in Python. The goal of this project is
to create a fully scriptable drafting program that will match and eventually
Well, I did want to add some formatting for example
STATUS = up
getrup = os.popen('ruptime').read()
show = getrup.splitlines()
gethost = show[0]
hostname = gethost.split()
print hostname[0]
getstatus = hostname[1]
if getstatus.find(STATUS):
print STATUS
else:
print font
Hi,
I'm trying to write a method that needs to know both the class name and
the instance details
class A:
@classmethod
def meth(cls, self):
print cls
print self
a = A()
a.meth(a)
The above code seems to work as intended. Could the same effect be
achieved using a
Hi Magnus,
I get the filename from a URL, which probably is not in any kind of
unicode-string but just a plain ASCII string. It should be possible to
cast this to an ASCII string -- I'll try it right away to see if this
works.
Thanks!
--Tim
--
The idea looks interesting, but you can also design a couple of
functions that scan the docstrings of a given class and its methods to
produce what you need:
doctestAll(C)
toHtml(C)
This is probably simpler and gives similar results.
Bye,
bearophile
--
I have a program running several threads. One of them must be done
every (Specified time, usually 1 second). The whole point to having a
thread is do this. However, I've noticed the following. When there is
another part of the program that is active, this thread slips into
disuse, ei, it's only
Tuvas wrote:
I have a program running several threads. One of them must be done
every (Specified time, usually 1 second). The whole point to having a
thread is do this. However, I've noticed the following. When there is
another part of the program that is active, this thread slips into
[EMAIL PROTECTED] wrote:
Hi,
I'm trying to write a method that needs to know both the class name and
the instance details
Any suggestions?
What's the point of using a classmethod and an explicit cls argument
when you can get the class object from the instance itself?
class
On 2 Feb 2006 12:08:43 -0800, [EMAIL PROTECTED] wrote:
Hi,
I'm trying to write a method that needs to know both the class name and
the instance details
class A:
@classmethod
def meth(cls, self):
print cls
print self
a = A()
a.meth(a)
The above code seems to work as
Hi!
Sorry for adopting your post for my own question, but since it is
related to PyQT I think it's ok: Does anybody of you know where the
openbook »GUI Programming with Python: QT Edition« has gone? It's not
available any more: http://www.opendocs.org/pyqt/ points now to a
non-existing site.
Yes that's better. Didn't know about the __class__ attribute. I
thought there must be a way to access this but couldn't find it in the
docs.
Thanks,
Andy
--
http://mail.python.org/mailman/listinfo/python-list
I couldn't find this with a search, but isn't there a way to overwrite
a previous folder (or at least not perform osmkdir( ) if your program
detects it already exists). Thanks !
--
http://mail.python.org/mailman/listinfo/python-list
Iterating over the items and checking if it is selected, sounds like a
good idea, but there no obvious way to get a hold of the list of
items!! The only way you can get an item is if you are in single
selection mode and you call selectedItem(). But I have to use multiple
selection mode, for which
Hi all,
I'd like to collect snmp data from varoius network devices parallel.
First I tried with my own threadpool class then I gave a try
to Christopher Arndt's threadpool.py
(http://chrisarndt.de/en/software/python/threadpool.html).
I got the same result: with one thread it finished about 2
Hi all,
I'd like to collect snmp data from varoius network devices parallel.
First I tried with my own threadpool class then I gave a try
to Christopher Arndt's threadpool.py
(http://chrisarndt.de/en/software/python/threadpool.html).
I got the same result: with one thread it finished about 2
Can Python be used to create (and/or open, read, and write) a text file
in Windows (if the path is known) ?
--
http://mail.python.org/mailman/listinfo/python-list
Ernesto wrote:
I couldn't find this with a search, but isn't there a way to overwrite
a previous folder (or at least not perform osmkdir( ) if your program
detects it already exists). Thanks !
I suppose this also leads to the question of:
Is there a way to determine if a path exists or not?
Ernesto [EMAIL PROTECTED] writes:
Can Python be used to create (and/or open, read, and write) a text file
in Windows (if the path is known) ?
Yes.
--
Jorge Godoy [EMAIL PROTECTED]
Quidquid latine dictum sit, altum sonatur.
- Qualquer coisa dita em latim soa profundo.
- Anything said in
Yes.
To open file:
fp=open(r'C:\directory\filename.txt','r')
To open file to write to:
fp=open(r'C:\directory\filename.txt','w')
You probably need to go through the Python tutorial as
these items are covered.
-Larry Bates
Ernesto wrote:
Can Python be used to create (and/or open, read,
Yes. You could do:
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type help, copyright, credits or license for more information.
fileobj=open('~\myfile.txt','w')
fileobj.write(test)
fileobj.close()
On Windows, for the path to your
NEVERMIND ! Here is the solution...
#
if (os.path.isdir(C:\\MyNewFolder) == 0):
os.mkdir(C:\\MyNewFolder)
# -
thanks
--
try os.path.exists(path)
-Larry Bates
Ernesto wrote:
Ernesto wrote:
I couldn't find this with a search, but isn't there a way to overwrite
a previous folder (or at least not perform osmkdir( ) if your program
detects it already exists). Thanks !
I suppose this also leads to the question
Flavio schrieb:
Iterating over the items and checking if it is selected, sounds like a
good idea, but there no obvious way to get a hold of the list of
items!! The only way you can get an item is if you are in single
selection mode and you call selectedItem(). But I have to use multiple
On Thursday 02 February 2006 9:25 pm, Fabian Steiner wrote:
Hi!
Sorry for adopting your post for my own question, but since it is
related to PyQT I think it's ok: Does anybody of you know where the
openbook »GUI Programming with Python: QT Edition« has gone? It's not
available any more:
Having read previous discussions on python-dev I think I'm not the only
Python programmer who doesn't particularly like python's self
parameter:
class Foo:
def bar(self, a,b):
return a+b
Foo().bar(1,2) = 3
The main reason (at least for me) is that there's simply too
got it . thanks tons. i'm doing the tutorial now.
--
http://mail.python.org/mailman/listinfo/python-list
On 2/2/06, Michael Sparks [EMAIL PROTECTED] wrote:
[1] NB: I **really** wouldn't go to python.com, I REALLY wasn'texpecting that (REALLY)
. I wouldn't even p y t h o n . c o m -- gmail keeps throwing these into the spam bucket .-- American Dream
Who has created these items? Obviously you, so you _can_ store the list
of selected items.
well yeah, but the Idea was to let the user select(through the widget)
a subset of the original list and then access that subset...
Or you use the equally well documented QListViewItemIterator to
JerryB wrote:
Rocco:
thanks for your response. The examples were just made up. I don't
normally use 'dict' and 'str'.
I know I can create a dictionary with the variables I want, etc. My
question is not how to solve the problem, or how to come up with a
work-around (I'm getting pretty good at
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
Having read previous discussions on python-dev I think I'm not the only
Python programmer who doesn't particularly like python's self
parameter:
class Foo:
def bar(self, a,b):
return a+b
Foo().bar(1,2) =
Hi all.My app has in input an ip address in IPv4 notation. is there a function that control if input is a string in IPv4 notation?Thanks all.bye-- Sbaush
--
http://mail.python.org/mailman/listinfo/python-list
Flavio schrieb:
Who has created these items? Obviously you, so you _can_ store the list
of selected items.
well yeah, but the Idea was to let the user select(through the widget)
a subset of the original list and then access that subset...
Or you use the equally well documented
thanks!! your ipcheck is perfect fo me!!2006/2/3, Fredrik Lundh [EMAIL PROTECTED]:
Sbaush wrote: My app has in input an ip address in IPv4 notation. is there a function that control if input is a string in IPv4 notation?here's one way to do it:def ipcheck(s):try:
a, b, c, d = [chr(int(c)) for c in
In article [EMAIL PROTECTED],
A.M. Kuchling [EMAIL PROTECTED] wrote:
On 27 Jan 2006 08:08:58 -0800,
Michael Tobis [EMAIL PROTECTED] wrote:
What about some permutation of the PyCon logo? It is really quite
brilliant.
http://www.python.org/pycon/2006/logo.png
Kudos to whoever came up
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Having read previous discussions on python-dev I think I'm not the only
Python programmer who doesn't particularly like python's self
parameter:
How about this decorator-based approach (still need to pick *some* name for
self, I picked
1 - 100 of 133 matches
Mail list logo