ANN: OSCON 2006 (Python 14 Conference) Proposals due Feb. 13th

2006-02-02 Thread Kevin Altis
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

[ANNOUNCE] Twenty-eighth release of PythonCAD now available

2006-02-02 Thread Art Haas
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

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Steve Holden
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

Re: cgi - secure sessions

2006-02-02 Thread Fuzzyman
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

Re: changing python script on-the-fly for ActiveX/COM object (win32com)

2006-02-02 Thread Fuzzyman
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

Re: redirect and python

2006-02-02 Thread Sybren Stuvel
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

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Fuzzyman
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

Re: howto catch an Exception and still print the TraceBack?

2006-02-02 Thread Fabio Zadrozny
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

Fatal Python error: Py_EndInterpreter: thread still has a frame

2006-02-02 Thread Thomas Korimort
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

Fromatting an xml file

2006-02-02 Thread sir_alex
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

Re:

2006-02-02 Thread Simon Brunning
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

Re: Re:

2006-02-02 Thread Fredrik Lundh
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

Re: redirect and python

2006-02-02 Thread Fredrik Lundh
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

Re: beta.python.org content

2006-02-02 Thread Michael Sparks
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

Re: OO conventions

2006-02-02 Thread Steven D'Aprano
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

Re: redirect and python

2006-02-02 Thread Rene Pijlman
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

Re: Why checksum? [was Re: Fuzzy Lookups]

2006-02-02 Thread Tom Anderson
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

Re: Builder Pattern

2006-02-02 Thread Jason
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

my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
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).

Re: Builder Pattern

2006-02-02 Thread Peter Otten
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.

Resources

2006-02-02 Thread Silva
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/

Re: cgi - secure sessions

2006-02-02 Thread GazaM
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

Re: cgi - secure sessions

2006-02-02 Thread Fuzzyman
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

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Peter Hansen
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

Re: OO conventions

2006-02-02 Thread Tim N. van der Leeuw
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

Re: cgi - secure sessions

2006-02-02 Thread Fuzzyman
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

Re: Test driven programming, was Re: VB to Python migration

2006-02-02 Thread Magnus Lycka
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:

Re: Python vs C for a mail server

2006-02-02 Thread Magnus Lycka
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

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Fuzzyman
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

Re: psycopg2

2006-02-02 Thread Matt Goodall
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

Re: cgi - secure sessions

2006-02-02 Thread Fuzzyman
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

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
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

Problem in threading

2006-02-02 Thread Sbaush
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):

Re: OO conventions

2006-02-02 Thread Alex Martelli
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

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Diez B. Roggisch
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

Re: Python vs C for a mail server

2006-02-02 Thread Randall Parker
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

Re: OO conventions

2006-02-02 Thread Magnus Lycka
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

Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Tim N. van der Leeuw
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

Re: [wxPython-users] Problem in threading

2006-02-02 Thread Josiah Carlson
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)

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Blair P. Houghton
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

Re: webbrowser module + urls ending in .py = a security hole?

2006-02-02 Thread Blair P. Houghton
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

perform dynamic tasks for C/C++/ObjC programs

2006-02-02 Thread YL
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

Re: OO conventions

2006-02-02 Thread Daniel Nogradi
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

Re: Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Magnus Lycka
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

Starting terminal applications from within python

2006-02-02 Thread sleepylight
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.

Re: VB to Python migration

2006-02-02 Thread Michael Tobis
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

Re: Starting terminal applications from within python

2006-02-02 Thread Jean-Paul Calderone
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

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
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

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Jean-Paul Calderone
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

Re: Starting terminal applications from within python

2006-02-02 Thread sleepylight
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! --

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Diez B. Roggisch
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

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Alan Morgan
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

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
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

Re: Test driven programming, was Re: VB to Python migration

2006-02-02 Thread Grig Gheorghiu
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

ANNOUNCE: OSCON 2006 (Python 14 Conference) Proposals due Feb. 13th

2006-02-02 Thread Kevin Altis
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

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
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

Re: dynamic class instantiation

2006-02-02 Thread Kent Johnson
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

Re: HTML parsing bug?

2006-02-02 Thread Istvan Albert
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

Re: my openGL API need threads!!! But how to ,ake it work???

2006-02-02 Thread Laurent
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! --

Re: dynamic class instantiation

2006-02-02 Thread Ognen Duzlevski
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,

learning python, using string help

2006-02-02 Thread [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 same format as if I ran 'ruptime' from the command line. If I

Re: learning python, using string help

2006-02-02 Thread Paul McGuire
[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

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Benji York
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

PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Flavio
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

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Diez B. Roggisch
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

[ANNOUNCE] Twenty-eighth release of PythonCAD now available

2006-02-02 Thread Art Haas
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

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
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

classmethod and instance method

2006-02-02 Thread andychambers2002
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

Re: Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Tim N. van der Leeuw
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 --

Re: A class with built-in doctest feature ?

2006-02-02 Thread bearophileHUGS
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 --

Thread imbalance

2006-02-02 Thread Tuvas
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

Re: Thread imbalance

2006-02-02 Thread Carl J. Van Arsdall
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

Re: classmethod and instance method

2006-02-02 Thread Xavier Morel
[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

Re: classmethod and instance method

2006-02-02 Thread Jean-Paul Calderone
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

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Fabian Steiner
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.

Re: classmethod and instance method

2006-02-02 Thread andychambers2002
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

OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Ernesto
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

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Flavio
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

Collecting snmp data - threads, processes, twisted?

2006-02-02 Thread Antal Rutz
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

Collecting snmp data - threads, processes, twisted?

2006-02-02 Thread Antal Rutz
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

Windows - create text file - (newb)

2006-02-02 Thread Ernesto
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

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Ernesto
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?

Re: Windows - create text file - (newb)

2006-02-02 Thread Jorge Godoy
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

Re: Windows - create text file - (newb)

2006-02-02 Thread Larry Bates
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,

Re: Windows - create text file - (newb)

2006-02-02 Thread epost2
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

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Ernesto
NEVERMIND ! Here is the solution... # if (os.path.isdir(C:\\MyNewFolder) == 0): os.mkdir(C:\\MyNewFolder) # - thanks --

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Larry Bates
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

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Diez B. Roggisch
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

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Phil Thompson
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:

Another try at Python's selfishness

2006-02-02 Thread n . estner
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

Re: Windows - create text file - (newb)

2006-02-02 Thread Ernesto
got it . thanks tons. i'm doing the tutorial now. -- http://mail.python.org/mailman/listinfo/python-list

Re: beta.python.org content

2006-02-02 Thread Ph.T
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

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Flavio
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

Re: locals() and dictionaries

2006-02-02 Thread Kent Johnson
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

Re: Another try at Python's selfishness

2006-02-02 Thread Donn Cave
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) =

Control if a input text is IP

2006-02-02 Thread Sbaush
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

Re: PyQt: QListView how to retrieve selected items?

2006-02-02 Thread Diez B. Roggisch
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

Re: Control if a input text is IP

2006-02-02 Thread Sbaush
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

Re: beta.python.org content

2006-02-02 Thread Aahz
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

Re: Another try at Python's selfishness

2006-02-02 Thread Paul McGuire
[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   2   >