Re: replacments for stdio?

2005-09-23 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: >i was wondering if anyone have written a GUI module that can > function as a replacment for stdin/stdout? ie. has a file like > interface, by which one could just assaign it to sys.stdout or > sys.stdin and have all your prints and raw_inputs and other such things > sh

Re: File processing

2005-09-23 Thread Bryan Olson
Peter Hansen wrote: > Gopal wrote: >> [...] I'm >> thinking of going with this format by having "Param Name - value". Note >> that the value is a string/number; something like this: >> >> PROJECT_ID = "E4208506" >> SW_VERSION = "18d" >> HW_VERSION = "2" >> >> In my script, I need to parse

Bluetooth

2005-09-23 Thread Tor Erik S�nvisen
Hi I'm making a server-side solution in Python and need to be able to communicate through bluetooth. Is there any bluetooth-packages out there for python? regards tores -- http://mail.python.org/mailman/listinfo/python-list

CRC16

2005-09-23 Thread Tuvas
Anyone know a module that does CRC16 for Python? I have an aplication that I need to run it, and am not having alot of sucess. I have a program in C that uses a CRC16 according to CCITT standards, but need to get a program that tests it with python as well. Thanks! -- http://mail.python.org/mailm

Re: Finding where to store application data portably

2005-09-23 Thread Ron Adam
Steven D'Aprano wrote: > On Thu, 22 Sep 2005 19:09:28 +0400, en.karpachov wrote: > > >>There is an other way around: look at your home dir as if it is your >>"settings" dir and don't clutter it with files other than application >>config dot-files. Just make ~/files/, ~/bin/ ~/lib/ etc. for it.

Re: Question About Logic In Python

2005-09-23 Thread Bryan Olson
Steven D'Aprano wrote: > Or wait, I have thought of one usage case: if you are returning a value > that you know will be used only as a flag, you should convert it into a > bool. Are there any other uses for bool()? We could, of course, get along without it. One use for canonical true and false v

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Tom Anderson
On Fri, 23 Sep 2005, Collin Winter wrote: > If possible, I'd like to see this go in before 3.0. The reference manual > currently states [2] that __builtins__ can be either a dict or a module, > so changing it to always be a module would still be in keeping with > this. However, I realise that t

Re: Productivity and economics at software development

2005-09-23 Thread Tom Anderson
On Fri, 23 Sep 2005, Scott David Daniels wrote: > Adriano Monteiro wrote: > >> I'm making a little research project about programming languages e >> their respective IDEs. The goal is to trace each language silhouettes, >> where it fits better, their goods/bads and the costs of developing in >

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Fredrik Lundh
Collin Winter wrote: > As it currently stands, the type of the global __builtins__ differs > depending on whether you're in the __main__ namespace (__builtins__ is > a module) or not (its a dict). I was recently tripped up by this > discrepancy, and googling the issue brings up half-a-dozen or so

tk_focusNext() revisited

2005-09-23 Thread Sori Schwimmer
Hello, I am trying to move focus between Tkinter (and other) widgets. A solution similar with my approach was suggested by Eric Brunel at http://mail.python.org/pipermail/python-list/2004-July/229971.html It will generate an error: Exception in Tkinter callback Traceback (most recent call last):

Re: CRC16

2005-09-23 Thread Larry Bates
The first URL back from Google is: http://www.onembedding.com/tools/python/code/crc16.htm Site is Russian, but crc16.py that is listed there has English comments. Maybe you can use some/all of it. -Larry Bates Tuvas wrote: > Anyone know a module that does CRC16 for Python? I have an aplication

batch mkdir using a file list

2005-09-23 Thread DataSmash
Hello, I think I've tried everything now and can't figure out how to do it. I want to read in a text list from the current directory, and for each line in the list, make a system directory for that name. My text file would look something like this: 1144 1145 1146 1147 I simply want to create thes

Simple Dialogs

2005-09-23 Thread neil . fraser
I'm looking for a lightweight dialog boxes from Python. JavaScript uses: alert(), confirm() and prompt() VB uses: MsgBox() and InputBox() EasyGui seemed perfect, but a "Hello World" application takes nearly a minute to execute after the program has been compiled by py2exe. There appear to be dozen

Re: batch mkdir using a file list

2005-09-23 Thread Fredrik Lundh
DataSmash <[EMAIL PROTECTED]> wrote > I think I've tried everything now and can't figure out how to do it. > I want to read in a text list from the current directory, > and for each line in the list, make a system directory for that name. > > My text file would look something like this: > 1144 > 1

Re: batch mkdir using a file list

2005-09-23 Thread Jeremy Jones
DataSmash wrote: >Hello, >I think I've tried everything now and can't figure out how to do it. >I want to read in a text list from the current directory, >and for each line in the list, make a system directory for that name. > >My text file would look something like this: >1144 >1145 >1146 >1147 >

Re: What is "self"?

2005-09-23 Thread Michael Spencer
Ron Adam wrote: > Erik Max Francis wrote: > >>Ron Adam wrote: >> >> >>>When you call a method of an instance, Python translates it to... >>> >>> leader.set_name(leader, "John") >> >> >>It actually translates it to >> >>Person.set_name(leader, "John") >> > > > I thought that I might have

Re: Open PDF

2005-09-23 Thread Martin Miller
IMHO, the fact that there is no way to wait for the application to finish is major deficiency with os.startfile() -- and why I often cannot use it instead of other techniques [such as the much more involved but limited os.spawnv() function]. I don't if if this is just a limitation of the implement

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Christopher Subich
Collin Winter wrote: > Hallo all, > I'd like to propose that in Py3.0 (if not earlier), __builtins__ will > be the same type regardless of which namespace you're in. Tim Peters > has said [1] that the reason __builtins__ in __main__ is a module so > that "the curious don't get flooded with output w

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Collin Winter
On 9/23/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Collin Winter wrote: > > > As it currently stands, the type of the global __builtins__ differs > > depending on whether you're in the __main__ namespace (__builtins__ is > > a module) or not (its a dict). I was recently tripped up by this > > d

Re: batch mkdir using a file list

2005-09-23 Thread [EMAIL PROTECTED]
Jeremy Jones wrote: > DataSmash wrote: > > >Hello, > >I think I've tried everything now and can't figure out how to do it. > >I want to read in a text list from the current directory, > >and for each line in the list, make a system directory for that name. > > > >My text file would look something

Re: batch mkdir using a file list

2005-09-23 Thread DataSmash
I am using bash shell on windows and I'm getting the error: TypeError: loop over non-sequence Is there any way around not messing with the text file. I want to batch generate the text lists as well. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone else getting posts back as email undeliverable bounces?

2005-09-23 Thread Bengt Richter
On Fri, 23 Sep 2005 11:49:51 +0100, Steve Holden <[EMAIL PROTECTED]> wrote: >I've even tried communicating with postmaster at all relevant domains, >but such messages are either bounced or ignored, so I've just filtered >that domain out. > Yeah, but I thought maybe there could be a way to detect

Python Source Code for a HTTP Proxy

2005-09-23 Thread llothar
Hello, i'm looking for a simple http proxy in python. Does anybody know about something like this ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Dialogs

2005-09-23 Thread James Stroud
py> from tkMessageBox import askquestion, showerror py> from tkSimpleDialog import askfloa py> a = askfloat('Census Data', 'Enter Salary') py> print a 12500.51 py> a = askquestion('Opinion', 'Do you think windoze sucks?') py> print a yes py> a = showerror('Problem','Program Crashed before Starting'

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Collin Winter
On 9/23/05, Christopher Subich <[EMAIL PROTECTED]> wrote: > How would this change, if made in a minimal way, impact the "provide > alternate globals() and locals() to eval and exec" feature? Altering > __builtins__ is a half-assed way of providing some sort of security, but > it's probably useful

Re: batch mkdir using a file list

2005-09-23 Thread DataSmash
OR...if python can't handle this type of text file, what do I need to do to remove the "\n" from the file? -- http://mail.python.org/mailman/listinfo/python-list

parsing a date

2005-09-23 Thread Kalle Anke
I want to parse a date string, for example '2005-09-23', and since I haven't done this before I would like to ask what is the best way to do it. I've looked around and the dateutil seems to be what most people use, but unfortunately I only get an empty file when I try to download it. I also tri

Re: Run VPython on FC3

2005-09-23 Thread Artur M. Piwko
In the darkest hour on Fri, 16 Sep 2005 15:45:33 -0700, York <[EMAIL PROTECTED]> screamed: >>>/usr/local/lib/libgtkgl.so.4.0.0 >>>/usr/local/lib/libgtkgl.so.4 >>> >>>Does anybody know a solution for this problem? >>> >> >> You need libgtk-(open)gl package (i don't know the exact name in FC). >> >

Re: Getting tired with py2exe

2005-09-23 Thread Bugs
Any luck on finding anyone to take over py2exe development Thomas? It's a GREAT project and would be a shame to see it fall into obsolescence. Thomas Heller wrote: [snip] > > Is anyone interested in taking over the maintainance, documentation, and > further development? > [snip] -- http://mai

Re: Python Source Code for a HTTP Proxy

2005-09-23 Thread Gary Herron
llothar wrote: >Hello, > >i'm looking for a simple http proxy in python. >Does anybody know about something like this ? > > > Here's a list, maintained by Alan Kennedy, of about 20 proxys written in Python: http://xhaus.com/alan/python/proxies.html Enjoy, Gary Herron -- http://mail.pyth

Re: Open PDF

2005-09-23 Thread Thomas Heller
"Martin Miller" <[EMAIL PROTECTED]> writes: > IMHO, the fact that there is no way to wait for the application to > finish is major deficiency with os.startfile() -- and why I often > cannot use it instead of other techniques [such as the much more > involved but limited os.spawnv() function]. > >

Re: Calling Access module functions from python

2005-09-23 Thread Chris Smith
> "kayakerjess" == kayakerjess <[EMAIL PROTECTED]> writes: kayakerjess> Hi, I have an Access Data Project (.adp) that I am kayakerjess> trying to open and execute from Python. I am using kayakerjess> the win32com.client, and I have successfully opened kayakerjess> the applica

Re: batch mkdir using a file list

2005-09-23 Thread Peter Otten
DataSmash wrote: > I am using bash shell on windows and I'm getting the error: > TypeError: loop over non-sequence Use open(filename).readlines() instead of open(filename) or switch to a current Python version. > OR...if python can't handle this type of text file, > what do I need to do to remov

HTML to LaTeX RE pattern and sub

2005-09-23 Thread [EMAIL PROTECTED]
Hi, trying to make a small script which would translate wiki file into LaTeX and when trying to translate possible HTML elements into LaTeX I did this: def latexEnvironments(matchobj): print >>sys.stderr,str(matchobj.groups()) inStr = matchobj.group(1) translDict = {'dl': ('\\begin{de

Accessing class variable at class creation time

2005-09-23 Thread Carlos
Hi! class A: X = 2 def F(): print A.X F() The above fails because the name A is not yet at global scope when the reference A.X is reached. Is there any way to refer to A.X without making explicit use of the name 'A'? Admittedly the code looks pretty unusual, but I'm defining configurati

Re: parsing a date

2005-09-23 Thread Larry Bates
Better than a single line of code? What is it that you are looking for? If you dates are consistent you can do: year, month, day=map(int, d.split('-')) but I'm not sure it is "better". I guess it depends on what you want to do with them after parsing. -Larry Bates Kalle Anke wrote: > I want

Re: Wrapping classes

2005-09-23 Thread Pedro Werneck
I agree this is a case for using metaclasses. What about an implementation like this ? Seems like checking if init was already called will slow down all attribute access significantly, but, I don't like this approach of changing the __init__ method. class LazyInit(type): def __new__(self, n

Re: CRC16

2005-09-23 Thread Bryan Olson
Tuvas wrote: > Anyone know a module that does CRC16 for Python? I have an aplication > that I need to run it, and am not having alot of sucess. I have a > program in C that uses a CRC16 according to CCITT standards, but need > to get a program that tests it with python as well. Thanks! I'll includ

Re: batch mkdir using a file list

2005-09-23 Thread DataSmash
Awesome! That worked! Much thanks to Peter and all of you who took the time to answer my question. R.D. -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing class variable at class creation time

2005-09-23 Thread Jan-Ole Esleben
You could use self.__class__.X HTH, Ole 23 Sep 2005 14:01:21 -0700, Carlos <[EMAIL PROTECTED]>: > Hi! > > class A: > X = 2 > def F(): > print A.X > F() > > The above fails because the name A is not > yet at global scope when the reference A.X > is reached. Is there any way to refer to

RE: distutils and decorators

2005-09-23 Thread Robert Brewer
Benji York wrote: > Robert Brewer wrote: > > Actually, in this case we most definitely want to test > > 2.4's "@" syntax. The decorator in question is an aliaser, > > and therefore is one of the few > > decorators which must be implemented differently for the 2.3-style > > decoration and the 2.4

Re: Bluetooth

2005-09-23 Thread Paul Boddie
Tor Erik Sønvisen wrote: > I'm making a server-side solution in Python and need to be able to > communicate through bluetooth. Is there any bluetooth-packages out there for > python? At the lowest level, you should be able to create sockets for Bluetooth communications (see the socket module's doc

Re: Accessing class variable at class creation time

2005-09-23 Thread Simon Percivall
It might be that I'm complicating something easy here, but I immediately thought of import sys class A: X = 2 def F(): f = sys._getframe().f_back print f.f_locals["X"] F() -- http://mail.python.org/mailman/listinfo/python-list

Re: Productivity and economics at software development

2005-09-23 Thread Peter Hansen
Adriano Monteiro wrote: > I'm making a little research project about programming languages e > their respective IDEs. The goal is to trace each language silhouettes, > where it fits better, their goods/bads and the costs of developing in > this language. You say this as though each language ha

Re: Simple Dialogs

2005-09-23 Thread neil . fraser
James Stroud wrote: > from tkMessageBox import showerror > showerror('Problem','Program Crashed before Starting') Thanks. That works great when interpreted (though a blank window seems to open as well). Unfortunately it still takes 40 seconds to execute after it has been 'compiled' with py2exe (

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Peter Hansen
Collin Winter wrote: > On 9/23/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>__builtins__ is a CPython implementation detail. why not just let it >>be an implementation detail, and refrain from using it? it's not that >>hard, really. > Given, but I fail to see why it can't be a consistent imple

Help installing Python 2.3 on Win2K

2005-09-23 Thread D.S. Hein
I have installed python 2.3 on my Windows 2K laptop and I can run python from the command prompt. I have tried various ways to set PYTHONPATH with the various directories where I have python programs (i.e. xx.py) but no matter how I set PYTHONPATH I keep getting a message that python can't

Re: CRC16

2005-09-23 Thread Raymond L. Buvel
Tuvas wrote: > Anyone know a module that does CRC16 for Python? I have an aplication > that I need to run it, and am not having alot of sucess. I have a > program in C that uses a CRC16 according to CCITT standards, but need > to get a program that tests it with python as well. Thanks! > Try this

Re: Help installing Python 2.3 on Win2K

2005-09-23 Thread [EMAIL PROTECTED]
D.S. Hein wrote: > I have installed python 2.3 on my Windows 2K laptop and I can run python > from the command prompt. > > I have tried various ways to set PYTHONPATH with the various directories > where I have python programs (i.e. xx.py) but no matter how I set > PYTHONPATH I keep getting a

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Collin Winter
On 9/23/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > User are clearly told in various places that names with leading and > trailing double underscores are *special*, and at least by implication > they are not to be used without a good understanding of what they are. > You certainly shouldn't have

Re: Help installing Python 2.3 on Win2K

2005-09-23 Thread Tim Williams (gmail)
On 23/09/05, D.S. Hein <[EMAIL PROTECTED]> wrote: > I have tried various ways to set PYTHONPATH with the various directories > where I have python programs (i.e. xx.py) but no matter how I set > PYTHONPATH I keep getting a message that python can't open the python > file. If I try to specify t

Re: parsing a date

2005-09-23 Thread Peter
Kalle Anke wrote: >I want to parse a date string, for example '2005-09-23', and since I haven't >done this before I would like to ask what is the best way to do it. > >I've looked around and the dateutil seems to be what most people use, but >unfortunately I only get an empty file when I try to

Re: Wrapping classes

2005-09-23 Thread Michael Spencer
Jeremy Sanders wrote: > Colin J. Williams wrote: > > >>Could you not have functions a and b each of which returns a NumArray >>instance? >> >>Your expression would then be something like a(..)+2*b(..). > > > The user enters the expression (yes - I'm aware of the possible security > issues), as

Can I compile Python for the web?

2005-09-23 Thread Charles
Dear sirs, I'm doing some investigations on the Python language. I'd like to know if it is possible to compile Python code made for the web (an online database for instance), and to run it using mod_python. How is it possible? I think it would be very fast to execute the code if it were comp

Re: Productivity and economics at software development

2005-09-23 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > If you focus on IDEs, your research will have pre-selected only > certain kinds of programmers and teams, and will not necessarily > include the best ones. It wouldn't have occurred to me to say that Ken Iverson (APL), Peter Deutsch (PARC Smalltalk), or D

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Peter Hansen
Collin Winter wrote: > The difference between __builtins__ and the other __*__ names is that > while the others shouldn't be used without understanding their > purpose, the consensus on __builtins__ seems to be that it shouldn't > be used at all. > > ... at the very > least, users should be expli

Re: Can I compile Python for the web?

2005-09-23 Thread Peter Hansen
Charles wrote: > I'm doing some investigations on the Python language. > I'd like to know if it is possible to compile Python code made for the > web (an online database for instance), and to run it using mod_python. > How is it possible? I think it would be very fast to execute the code > if

Re: Productivity and economics at software development

2005-09-23 Thread Peter Hansen
Paul Rubin wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>If you focus on IDEs, your research will have pre-selected only >>certain kinds of programmers and teams, and will not necessarily >>include the best ones. > > It wouldn't have occurred to me to say that Ken Iverson (APL), Peter > Deut

Re: Bluetooth

2005-09-23 Thread Tor Erik S�nvisen
Okei I've been doing some research since my first post and now I'm really confused. I'm programming in xp, and found some c++ code out of this world that supposidly should list all available services to a given bluetooth device. This code however where only working with certain bluetooth-de

Re: Accessing class variable at class creation time

2005-09-23 Thread Benji York
Carlos wrote: > Hi! > > class A: > X = 2 > def F(): > print A.X > F() > > The above fails because the name A is not > yet at global scope when the reference A.X > is reached. Is there any way to refer to A.X > without making explicit use of the name 'A'? How about this: >>> class A:

Re: Can I compile Python for the web?

2005-09-23 Thread Terry Hancock
On Friday 23 September 2005 07:53 pm, Peter Hansen wrote: > What you appear to be asking is if it's possible to create *native > machine code* from Python source in order to achieve a significant > increase in performance. The short answer is "no, not really", and > longer answers include "yes,

RE: Re: A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals...

2005-09-23 Thread your
You consider it spam because you don't agree with the political message or the idea of people working for a better world. However, if it had been a subject which was "acceptable" to your standards as a self-made moderator, then everything would have been wonderful in Kansas. Click your heels p

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Collin Winter
On 9/23/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > My point, which might not have been clear, is that users are *already* > told that they shouldn't ever touch __anything__ without understanding > what it is, which is more general advice than and therefore encompasses > the __builtins__ issue.

Problem subclassing (Newbie)

2005-09-23 Thread Shahla Almasri
Hi, I'm new to Python, so forgive me if I'm missing something obvious here. All what I am trying to do is create a hirarachy of objects (i.e. one that inherits from another). But for somereason my subclasses are not recognizing their superclass! I have the following: class Widget(object): de

Re: Config parser module

2005-09-23 Thread qqcq6s59
Thanks a lot for Dale and Larry, I have not tried the OOP way yet like you mentioned, I will try to create a parser soon, maybe I will post it in the net after that, it may be useful to others too, Thanks again -Jiro -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem subclassing (Newbie)

2005-09-23 Thread Laszlo Zsolt Nagy
>Then I have an instance of class Button called obj. My probelm is that >the test isinstance(obj, Widget) resturns False! > You must have a typo somewhere. Please try this little test program. >>> class Widget(object): ... pass ... >>> class Button(Widget): ... pass ... >>> b = B

How to decompile an exe file compiled by py2exe?

2005-09-23 Thread Leo Jay
Dear All, I lost my source code because of my incaution. so anyone can tell me how to decompile the exe file compiled by py2exe? Thanks. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

<    1   2