Re: What is a type error?

2006-07-11 Thread Marshall
Joachim Durchholz wrote: Marshall schrieb: Joachim Durchholz wrote: Chris Smith schrieb: For example, I wrote that example using variables of type int. If we were to suppose that we were actually working with variables of type Person, then things get a little more complicated. We

Re: Accessors in Python (getters and setters)

2006-07-11 Thread ZeD
Bruno Desthuilliers wrote: I decided to change the name of an attribute. Problem is I've used the attribute in several places spanning thousands of lines of code. If I had encapsulated the attribute via an accessor, I wouldn't need to do an unreliable and tedious search and replace find and

Re: threading troubles

2006-07-11 Thread [EMAIL PROTECTED]
sreekant wrote: Hi folks What am I doing wrong in the following? I just want to run fluidsynth in the background. Others have pointed you at os.popen. In non-crippled languages, use processes (e.g. popen) when you wish to preserve the years of hard work that OS designers put into protected

Re: urllib2 on Windows Vista

2006-07-11 Thread Martin v. Löwis
Sriram Krishnan wrote: I'm running Python 2.4.3 on Windows Vista June CTP. I'm not able to open any site using the urllib2 and related family of modules I think you need to break the error further down. Try httplib instead of urllib, and see what connect does. Then break this down into socket

Re: threading troubles

2006-07-11 Thread Piet van Oostrum
sreekant [EMAIL PROTECTED] (S) wrote: S Hi folks S What am I doing wrong in the following? I just want to run fluidsynth in S the background. S # S class MyThread(threading.Thread): S def __init__(self, cmd, callback): S self.__cmd = cmd S

Re: document

2006-07-11 Thread nhnh -cuncon
Please send me an anti-virus version. I can not read your attacked file!python-list@python.org wrote: Please read the document. Want to be your own boss? Learn how on Yahoo! Small Business. -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting 64bit vs. 32bit Linux

2006-07-11 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], Robin Becker [EMAIL PROTECTED] wrote: Michael Yanowitz wrote: .. I need to detect whether the operating system I am running on (not the Python version) is 64bit or 32bit. One requirement is that I need to include support for non-Intel/AMD architectures.

Re: Python for modem App

2006-07-11 Thread Bayazee
Any Idea !!!??? --- First Iranian Python Programming Community -- www.Python.ir -- http://mail.python.org/mailman/listinfo/python-list

Re: language design question

2006-07-11 Thread Fredrik Lundh
Bryan wrote: and how do you make sure that everything subclasses this base class ? in this hypothetical case, i was assuming len() would be put in object and every class subclasses object implicitly or explicitly (ie, new style classes only). if it was done that way, would len(obj) ==

How to terminate a main script?

2006-07-11 Thread Helmut Jarausch
Hi, I'm still looking for an elegant and clear means to terminate the main script in Python. Unfortunately, Python doesn't allow a 'return' instruction in the main script. Using sys.exit(0) produces an error message which looks dangerous to an uninitiated user. The same is true for an

Re: Accessors in Python (getters and setters)

2006-07-11 Thread Bruno Desthuilliers
ZeD wrote: Bruno Desthuilliers wrote: I decided to change the name of an attribute. Problem is I've used the attribute in several places spanning thousands of lines of code. If I had encapsulated the attribute via an accessor, I wouldn't need to do an unreliable and tedious search and replace

Re: mod_python fails to load under wamp

2006-07-11 Thread Ant
I suggest you search the download files on Xampp's sourceforge site and look for an older version with Apache 2.0.55 . I'm not sure, but I think xampp version 1.5.1 will be ok I did this just a few days ago, you could be right, but version 1.5.1 had no release notes, and a dodgy release

Re: How to terminate a main script?

2006-07-11 Thread Fredrik Lundh
Helmut Jarausch wrote: Using sys.exit(0) produces an error message which looks dangerous to an uninitiated user. sys.exit(0) doesn't print anything at all. $ python import sys sys.exit(0) $ however, sys.exit() raises an exception to tell the runtime that it wants to terminate the program,

Re: mod_python fails to load under wamp

2006-07-11 Thread Ant
Uh... this may sound silly, but aren't .so files UNIX/Linux/Solaris shared object files... Yes, but apache uses them (or at least the same file extension) for modules on Windows and Linux, so mod_python.so is correct. -- http://mail.python.org/mailman/listinfo/python-list

Re: free python hosting !

2006-07-11 Thread Bruno Desthuilliers
Bayazee wrote: hi i want a free hosting for python . Then setting up your own hosting might be a good solution - if you can have a decent internet connection. www.python.ir -- Persian Python Community ! I'm afraid I won't be able to contribute !-) -- bruno desthuilliers python -c print

Re: threading troubles

2006-07-11 Thread sreekant
I decided in the end to use fork and all is well. Thanks sree -- http://mail.python.org/mailman/listinfo/python-list

How to use images at the bachground?

2006-07-11 Thread arvind
hi all, how to get out of the python shell which is executing a command? how to use images in the background of a page in Tkinter? -- http://mail.python.org/mailman/listinfo/python-list

Re: Restricted Access

2006-07-11 Thread Fredrik Lundh
iapain wrote: No, I cant change permission or delete the module, the best would be something to detect 'import os' in user code .. trust me, implementing a restricted execution model for Python that actually works is a *lot* harder than that. googling for python restricted execution might

Re: help a newbie with a IDE/book combination

2006-07-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: Hi, I already have a couple of newbie books on Python itself, but would rather get started with a nice to use IDE and I am therefore looking for a good IDE to learn Python. On my computer I have installed eric (http://ericide.python-hosting.com/) but it lacks any

Re: What is a type error?

2006-07-11 Thread Fredrik Lundh
David Hopwood wrote: Yes, I'm well aware that most of this thread has been off-topic for c.l.p.m, but it is no less off-topic for the other groups (except possibly c.l.functional), and I can't trim the Newsgroups line down to nothing. is someone forcing your to post off-topic stuff against

Re: How to terminate a main script?

2006-07-11 Thread Ganesan Rajagopal
Helmut Jarausch [EMAIL PROTECTED] writes: Using sys.exit(0) produces an error message which looks dangerous to an uninitiated user. What message? Your program should exit silently when you call sys.exit(0). Ganesan -- Ganesan Rajagopal --

Re: function that modifies a string

2006-07-11 Thread Diez B. Roggisch
I'm sorry, perhaps I'm being slow today, but just why are they dangerous? More dangerous than, say, mutable lists and mutable dicts? Unless I'm missing something, the worst that can happen is that people will write inefficient code, and they'll be caught out by the same sort of things that

Making HTTP requests using Twisted

2006-07-11 Thread rzimerman
I'm hoping to write a program that will read any number of urls from stdin (1 per line), download them, and process them. So far my script (below) works well for small numbers of urls. However, it does not scale to more than 200 urls or so, because it issues HTTP requests for all of the urls

Re: What is a type error?

2006-07-11 Thread Marcin 'Qrczak' Kowalczyk
Chris Smith [EMAIL PROTECTED] writes: No what happens if right here you code b := 16; Does that again change the type of b? Or is that an illegal instruction, because b has the local type of (18..22)? It arranges that the expression b after that line (barring further changes) has

Re: Making HTTP requests using Twisted

2006-07-11 Thread K.S.Sreeram
rzimerman wrote: I'm hoping to write a program that will read any number of urls from stdin (1 per line), download them, and process them. So far my script (below) works well for small numbers of urls. However, it does not scale to more than 200 urls or so, because it issues HTTP requests for

Re: Howto or Tutorial for tokenize module for a newbie?

2006-07-11 Thread Fuzzyman
TY wrote: Hi, Can someone point me to a Howto or Tutorial for tokenize module for a newbie? I read the documentation but it doesn't have a lot of info... Here's another useful example : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298 All the best, Fuzzyman

Generating all ordered substrings of a string

2006-07-11 Thread girish
Hi, I want to generate all non-empty substrings of a string of length =2. Also, each substring is to be paired with 'string - substring' part and vice versa. Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c', 'ab'], ['b', 'ac'], ['ac', 'b']] etc. Similarly, 'abcd' should give

Re: language design question

2006-07-11 Thread Steve Holden
Bryan wrote: Fredrik Lundh wrote: Bryan wrote: could you get the same result by putting these methods in base class object that everything subclasses? and how do you make sure that everything subclasses this base class ? /F in this hypothetical case, i was assuming len() would be put

Re: Making HTTP requests using Twisted

2006-07-11 Thread Fredrik Lundh
rzimerman wrote: Is Twisted the best library for me to be using? I do like Twisted, but it seems more suited to batch mode operations. Is there some way that I could continue registering url requests while the reactor is running? Is there a way to specify a time out per page request, rather

Re: Accessors in Python (getters and setters)

2006-07-11 Thread mystilleef
Hello, Thanks for the responses. The reason I want to change the name of the attribute is because it doesn't reflect the purpose of the attribute, anymore. The attribute was originally a string object, but not anymore. It is primarily a readability issue. There are also a few key attributes I

Re: Looking for a HTML like rendering library (wishlist)

2006-07-11 Thread Stefan Behnel
Laszlo Nagy wrote: I'm looking for a library that can do the following: * Parse a simple structured text file (XML or HTML etc.) * Render its output to an image * I would like to give the maximum width of the image (but not the minimum) * I would like to use my custom

Re: How to use images at the bachground?

2006-07-11 Thread pipehappy
hi all, how to get out of the python shell which is executing a command? how to use images in the background of a page in Tkinter? on Unix, ctrl-c or ctrl-d may do the job. on Windows, ctrl-z will do -- http://mail.python.org/mailman/listinfo/python-list

Re: Augument assignment versus regular assignment

2006-07-11 Thread Antoon Pardon
On 2006-07-10, Terry Reedy [EMAIL PROTECTED] wrote: Antoon Pardon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I disagree. The += version only evaluates the index once, but still has to find the object twice. No it does not *have* to find the object twice and no it does *not*

Re: How to terminate a main script?

2006-07-11 Thread Helmut Jarausch
Fredrik Lundh wrote: Helmut Jarausch wrote: Using sys.exit(0) produces an error message which looks dangerous to an uninitiated user. sys.exit(0) doesn't print anything at all. Yes, sorry, I was trying in in 'idle' There you get Traceback (most recent call last): File pyshell#1, line

Re: Global except condition

2006-07-11 Thread Steve Holden
Ernesto wrote: Within the scope of one Python file (say myFile.py), I'd like to print a message on ANY exception that occurs in THAT file, dependent on a condition. Here's the pseudocode: if anyExceptionOccurs(): if myCondition: print Here's my global exception message

Re: Global except condition

2006-07-11 Thread Fredrik Lundh
Ernesto wrote: Within the scope of one Python file (say myFile.py), I'd like to print a message on ANY exception that occurs in THAT file, dependent on a condition. condition = True def handle_any_exception(function): def trampoline(*args, **kwargs): try:

Re: Accessors in Python (getters and setters)

2006-07-11 Thread Bruno Desthuilliers
mystilleef wrote: Hello, Thanks for the responses. The reason I want to change the name of the attribute is because it doesn't reflect the purpose of the attribute, anymore. The attribute was originally a string object, but not anymore. It is primarily a readability issue. There are also a

Best command for running shell command

2006-07-11 Thread Donald Duck
I'm a little bit confused about what is the best way to run a shell command, if I want to run a command like xx -a -b yy where I'm not interested in the output, I only want to make sure that the command was executed OK. How should I invoke this (in a Unix/linux

Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread horizon5
Hi, my collegues and I recently held a coding style review. All of the code we produced is used in house on a commerical project. One of the minor issues I raised was the common idiom of specifing: pre if len(x) 0: do_something() /pre Instead of using the language-defined bahviour, as

CPU or MB Serial number

2006-07-11 Thread Bayazee
Hi, How can I get CPU Serial number , or motherboard serial number with python . I need an idetification of a computer ThanX --- iranian python community -- www.python.ir -- http://mail.python.org/mailman/listinfo/python-list

Re: Best command for running shell command

2006-07-11 Thread Roy Smith
In article [EMAIL PROTECTED], Donald Duck [EMAIL PROTECTED] wrote: I'm a little bit confused about what is the best way to run a shell command, if I want to run a command like xx -a -b yy where I'm not interested in the output, I only want to make sure

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Bruno Desthuilliers
horizon5 wrote: Hi, my collegues and I recently held a coding style review. All of the code we produced is used in house on a commerical project. One of the minor issues I raised was the common idiom of specifing: pre if len(x) 0: do_something() /pre Instead of using the

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Steven D'Aprano
On Tue, 11 Jul 2006 04:52:42 -0700, horizon5 wrote: Hi, my collegues and I recently held a coding style review. All of the code we produced is used in house on a commerical project. One of the minor issues I raised was the common idiom of specifing: pre if len(x) 0: do_something()

error occurs when using wmi module in child thread

2006-07-11 Thread Chen Houwu
--sample code begin- import threading import wmi def run(*args): c = wmi.WMI () memory=c.Win32_LogicalMemoryConfiguration()[0] info='Total Virtual Memory: '\ +str(int(memory.TotalVirtualMemory)/1024)\

Re: Restricted Access

2006-07-11 Thread iapain
googling for python restricted execution might give you some clues. I've already assumed that there is no rexec for me as i am using python 2.4. Yeah its much more difficult that my imagination. Should I go for alternatives like 1. Assume every one who is using this webide, wont corrupt system

Re: Restricted Access

2006-07-11 Thread Fredrik Lundh
iapain wrote: I've already assumed that there is no rexec for me as i am using python 2.4. Yeah its much more difficult that my imagination. Should I go for alternatives like 1. Assume every one who is using this webide, wont corrupt system 2. Use some tricks to encrypt the user path and do

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Daniel Dittmar
horizon5 wrote: Hi, my collegues and I recently held a coding style review. All of the code we produced is used in house on a commerical project. One of the minor issues I raised was the common idiom of specifing: pre if len(x) 0: do_something() /pre Instead of using the

Re: error occurs when using wmi module in child thread

2006-07-11 Thread placid
Chen Houwu wrote: --sample code begin- import threading import wmi def run(*args): c = wmi.WMI () memory=c.Win32_LogicalMemoryConfiguration()[0] info='Total Virtual Memory: '\

Re: Restricted Access

2006-07-11 Thread iapain
unless you're willing to build a restricted runtime that runs on top of the core inter- preter, you should assume that anyone writing a Python script that's executed by your program has access to everything that your Python process has access to... I think using replacements I can ban

Re: error occurs when using wmi module in child thread

2006-07-11 Thread Chen Houwu
thanks to solve my big problem :-) I will try it later. -- http://mail.python.org/mailman/listinfo/python-list

Re: language design question

2006-07-11 Thread vdrab
isinstance(1, object) True What's 1 . len() ? That's easy! since 1 is actually syntactic sugar for set([set([])]), clearly 1.len() == 1. ;-) v. (actually, make that frozenset([frozenset([])])...) -- http://mail.python.org/mailman/listinfo/python-list

Re: language design question

2006-07-11 Thread Bryan
Fredrik Lundh wrote: Bryan wrote: and how do you make sure that everything subclasses this base class ? in this hypothetical case, i was assuming len() would be put in object and every class subclasses object implicitly or explicitly (ie, new style classes only). if it was done that

Abuse of the object-nature of functions?

2006-07-11 Thread Ant
Hi all, In a framework I've written to test out website, I use something like the following to add functionality at various points: #--- def do_work(callable, data): assertion = False try: assertion = callable.is_assertion except: pass

Multi-threaded FTP Question

2006-07-11 Thread dbandler
I'm trying to use ftp in python in a multi-threaded way on a windows box - python version 2.4.3. Problem is that it appears that it's only possible to have five instances/threads at one point in time. Errors look like: File C:\Python24\lib\ftplib.py, line 107, in __init__

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Fredrik Lundh
Ant [EMAIL PROTECTED] wrote: The question is, is this a reasonable thing to do? absolutely. a test framework DSL is a perfectly valid use case for function attributes. It works, but is it considered bad practice to add attributes to functions? nope (at least not in small doses ;-) And are

Re: Best command for running shell command

2006-07-11 Thread Thomas Nelson
Yes, I highly recommend the subprocess module. subprocess.call() can do almost anything you want to do, and the options are all pretty intuitive Whenever I need to write quick scripts for myself, it's what I use. THN Roy Smith wrote: In article [EMAIL PROTECTED], Donald Duck [EMAIL

Re: Multi-threaded FTP Question

2006-07-11 Thread Jeremy Jones
On 11 Jul 2006 06:45:42 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm trying to use ftp in python in a multi-threaded way on a windowsbox - python version 2.4.3.Problem is that it appears that it's onlypossible to have five instances/threads at one point in time.Errorslook like: File

pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2006-07-11 Thread Marco Aschwanden
Hi I would like to 1. import an existing Excel-sheet (a template) 2. and add some data to it 3. and save it under a different name afterwards. To me it seems, that pyExcelerator does not support the reading for modification of an Excel-sheet. It allows only the parse_xls but I would

Re: free python hosting !

2006-07-11 Thread John Salerno
Luis M. González wrote: I'm curious, why it didn't work? I sent them an email recently, asking about mod_python support, and they replied afirmatively, and very quickly. They also said that they can install other scripts on demand. But I never tried them though... I'd like to know more

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Maric Michaud
Le mardi 11 juillet 2006 13:52, horizon5 a écrit : Arguments that have been presented for using codelen(x) 0/code to test emptiness of a container include:   - It's safer   - Not relying on weird behaviour of the language   - Explicit is better than implicit (as stated by 'this' module, Zen

Re: Restricted Access

2006-07-11 Thread Steven D'Aprano
On Tue, 11 Jul 2006 06:21:39 -0700, iapain wrote: unless you're willing to build a restricted runtime that runs on top of the core inter- preter, you should assume that anyone writing a Python script that's executed by your program has access to everything that your Python process has

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Fredrik Lundh
Sybren Stuvel wrote: Ant enlightened us with: try: assertion = callable.is_assertion except: pass Try to make a habit out of catching only the exceptions you know will be thrown. Catching everything generally is a bad idea. In this case, my bet is that catching

Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2006-07-11 Thread Larry Bates
Marco Aschwanden wrote: Hi I would like to 1. import an existing Excel-sheet (a template) 2. and add some data to it 3. and save it under a different name afterwards. To me it seems, that pyExcelerator does not support the reading for modification of an Excel-sheet. It allows

Re: CPU or MB Serial number

2006-07-11 Thread marc . wyburn
Bayazee wrote: Hi, How can I get CPU Serial number , or motherboard serial number with python . I need an idetification of a computer ThanX --- iranian python community -- www.python.ir If you are on a windows box with WMI (2000 or

Re: Restricted Access

2006-07-11 Thread iapain
my_innocent_object = __import__(''.join([chr(110+x) for x in [1, 5]])) Thats really smart way, yeah i had plan to scan and detect but I think its not gonna work. Creating a restricted execution environment is *hard*. As far as I know, even Microsoft has never attempted it. And for all of

Re: What is a type error?

2006-07-11 Thread David Hopwood
Chris Smith wrote: David Hopwood [EMAIL PROTECTED] wrote: Maybe I'm not understanding what you mean by complete. Of course any type system of this expressive power will be incomplete (whether or not it can express conditions 3 to 5), in the sense that it cannot prove all true assertions about

Identifying apparently unused globals

2006-07-11 Thread skip
At work we have a fairly large application (about 20 packages, 300+ modules) that looks like we might be heading into a bit of a plateau stage. Now seems like a good time to identify and delete old, unused code that's flown under the radar screen for awhile simply because nobody was looking for

Re: Best command for running shell command

2006-07-11 Thread iapain
where I'm not interested in the output, I only want to make sure that the command was executed OK. How should I invoke this (in a Unix/linux environment)? Remember few things about executing program within python 1. Create a subprocess or child process and execute it. 2. You should use Timeout

os.access() problem

2006-07-11 Thread Phil Schmidt
I just got a new PC with Windows XP, and I want to run Leo on it. Leo uses the os.access() function to check for read-only files. For some reason, os.access(filename, os.W_OK) always returns false. I wrote a 2-liner Python script to just test os.access on any file. I have tried this with Python

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Peter Otten
Fredrik Lundh wrote: Sybren Stuvel wrote: Ant enlightened us with: try: assertion = callable.is_assertion except: pass Try to make a habit out of catching only the exceptions you know will be thrown. Catching everything generally is a bad idea. In this case, my

Re: Restricted Access

2006-07-11 Thread Diez B. Roggisch
iapain wrote: my_innocent_object = __import__(''.join([chr(110+x) for x in [1, 5]])) Thats really smart way, yeah i had plan to scan and detect but I think its not gonna work. Creating a restricted execution environment is *hard*. As far as I know, even Microsoft has never attempted

timeit module for comparing the performance of two scripts

2006-07-11 Thread Phoe6
Hi, Following are my files. In the format: Filename content config1.txt #DataBase Repository file dbRepository = omsa_disney.xml config2.txt # Configfile for sendmail [Sendmail] userprefix = testuser pyConfig.py import re def pyConfig(): fhandle

Re: std in and stdout

2006-07-11 Thread Peter Otten
Juergen Huber wrote: how would i fix the following problem: now i have an input file with a fix name and an output file! i have this two files hardcoded written in the sourcecode of this function! in the future i will start this script with the command line. the syntax should be look

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Fredrik Lundh
Peter Otten wrote: You would normally expect that you can turn off a flag by setting it to False instead of deleting it -- which is also how the OP's code works. So I would prefer assertion = getattr(callable, is_assertion, False) agreed (but note that the OP used a decorator to set the

Re: Augument assignment versus regular assignment

2006-07-11 Thread Piet van Oostrum
Antoon Pardon [EMAIL PROTECTED] (AP) wrote: AP As I read the language reference the x stands for a target expression. AP Now what does it mean to evaluate a target expression like col[key]. AP IMO it means finding the location of the item in the collection: the AP bucket in the directory, the

Re: threading troubles

2006-07-11 Thread Piet van Oostrum
sreekant [EMAIL PROTECTED] (S) wrote: S I decided in the end to use fork and all is well. But how are you doing the callback then? From your code it looks like the callback is called after the external command finishes. The callback would then be called in the child process, not in the parent

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread Fredrik Lundh
Phoe6 [EMAIL PROTECTED] wrote: How do I compare the performance of pyConfig.py vs pyConparse.py using timeit module? $ python -m timeit -s import pyConfig pyConfig.pyConfig() $ python -m timeit -s import pyConparse pyConparse.pyConParse() note that timeit runs the benchmarked function

Re: Python in a nutshell - new edition ?

2006-07-11 Thread Anthony Baxter
End of July is our aggressive but still-achievable target: everythingwas scheduled from the start to hit OSCON '06 (and the release of Python 2.5 -- whether 2.5 final will be out at OSCON is still uncertain,though).Currently the schedule has Python 2.5 final due August 8th, and RC1 August 1st.

Re: What is a type error?

2006-07-11 Thread Chris Smith
David Hopwood [EMAIL PROTECTED] wrote: I don't think that placing too much emphasis on any individual example is the right way of thinking about this. What matters is that, over the range of typical programs written in the language, the value of the increased confidence in program correctness

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread Phoe6
Fredrik Lundh wrote: $ python -m timeit -s import pyConfig pyConfig.pyConfig() $ python -m timeit -s import pyConparse pyConparse.pyConParse() note that timeit runs the benchmarked function multiple times, so you may want to remove the print statements. Thanks a lot Fredrik!. I did not know

Re: What is a type error?

2006-07-11 Thread Chris Smith
Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Chris Smith [EMAIL PROTECTED] writes: No what happens if right here you code b := 16; Does that again change the type of b? Or is that an illegal instruction, because b has the local type of (18..22)? It arranges that the

Subject: RELEASED Python 2.5 (beta 2)

2006-07-11 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the second BETA release of Python 2.5. This is an *beta* release of Python 2.5. As such, it is not suitable for a production environment. It is being released to solicit feedback and hopefully discover bugs,

Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2006-07-11 Thread Gregory Piñero
I'm pretty sure it doesn't support reading an existing document. That would be useful. On 7/11/06, Larry Bates [EMAIL PROTECTED] wrote: Marco Aschwanden wrote: Hi I would like to 1. import an existing Excel-sheet (a template) 2. and add some data to it 3. and save it under a

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread Fredrik Lundh
Phoe6 $ python -m timeit -s import pyConfig pyConfig.pyConfig() $ python -m timeit -s import pyConparse pyConparse.pyConParse() note that timeit runs the benchmarked function multiple times, so you may want to remove the print statements. Thanks a lot Fredrik!. I did not know that timeit

Re: syslog best practices -- when to call closelog?

2006-07-11 Thread Cameron Laird
In article [EMAIL PROTECTED], J Rice [EMAIL PROTECTED] wrote: I have a question: When should syslog.closelog() be called? I have a daemon that spends most of its time asleep and quiet, but writes messages to the mail log when active. Should I open the log at the start and keep it open until

Re: Restricted Access

2006-07-11 Thread Cameron Laird
In article [EMAIL PROTECTED], iapain [EMAIL PROTECTED] wrote: . . . Does that mean there is no way to implement restricted enviorment? . . . The most

Re: What is a type error?

2006-07-11 Thread Darren New
Marshall wrote: Now, I'm not fully up to speed on DBC. The contract specifications, these are specified statically, but checked dynamically, is that right? Yes, but there's a bunch more to it than that. The handling of exceptions, an in particular exceptions caused by failed pre/post

Re: What is a type error?

2006-07-11 Thread Darren New
Marcin 'Qrczak' Kowalczyk wrote: The assignment might be performed in a function called there, so it's not visible locally. In Hermes, which actually does this sort of constraint propagation, you don't have the ability[1] to munge some other routine's[2] local variables, so that becomes a

Re: What is a type error?

2006-07-11 Thread Darren New
Chris Smith wrote: Specialized language already exist that reliably (as in, all the time) move array bounds checking to compile time; It sounds like this means the programmer has to code up what it means to index off an array, yes? Otherwise, I can't imagine how it would work. x :=

Re: What is a type error?

2006-07-11 Thread Marshall
Chris Smith wrote: Going back to my handy copy of Pierce's book again, he claims that range checking is a solved problem in theory, and the only remaining work is in how to integrate it into a program without prohibitive amounts of type annotation. This is in TAPL? Or ATTPL? Can you cite it

Re: Restricted Access

2006-07-11 Thread K.S.Sreeram
Steven D'Aprano wrote: Creating a restricted execution environment is *hard*. As far as I know, even Microsoft has never attempted it. And for all of Sun's resources and talent, security holes are sometimes found even in Java. Java is not the only restricted execution environment around.

win32 and System Font Size

2006-07-11 Thread Fuzzyman
Hello all, I'm writing a windows application with a Tkinter GUI. Tkinter ignores the Windows user setting for system default font size - which can be 'normal', 'large' or 'extra large'. Does anyone know how to retrieve this information from the win32api, or using win32com ? All the best,

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Ant
Sybren wrote: Try to make a habit out of catching only the exceptions you know will be thrown. Yes - you are right of course - this was just a minimal example of course to illustrate the sort of thing I'm using function attriutes for. Fredrik Lundh wrote: Peter Otten wrote: assertion =

Re: Identifying apparently unused globals

2006-07-11 Thread Simon Forman
[EMAIL PROTECTED] wrote: At work we have a fairly large application (about 20 packages, 300+ modules) that looks like we might be heading into a bit of a plateau stage. Now seems like a good time to identify and delete old, unused code that's flown under the radar screen for awhile simply

Re: Restricted Access

2006-07-11 Thread iapain
The most knowledgeable people have effectively given up, in regard to Python. I guess now I am up with only one option, i.e hope that user input code wont be evil to the system. **which is rarely possible** -- http://mail.python.org/mailman/listinfo/python-list

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Carl J. Van Arsdall
Sybren Stuvel wrote: Ant enlightened us with: try: assertion = callable.is_assertion except: pass Try to make a habit out of catching only the exceptions you know will be thrown. Catching everything generally is a bad idea. In this case, my bet is that

Re: Restricted Access

2006-07-11 Thread Paul Rubin
K.S.Sreeram [EMAIL PROTECTED] writes: Java is not the only restricted execution environment around. Javascript, as implemented by most browsers, is an excellent lightweight restricted execution environment, and there are many browsers which have good implementations. And we hear about browser

Re: What is a type error?

2006-07-11 Thread George Neuner
On Tue, 11 Jul 2006 14:59:46 GMT, David Hopwood [EMAIL PROTECTED] wrote: What matters is that, over the range of typical programs written in the language, the value of the increased confidence in program correctness outweighs the effort involved in both adding annotations, and understanding

Re: What is a type error?

2006-07-11 Thread Chris Smith
Marshall [EMAIL PROTECTED] wrote: Chris Smith wrote: Going back to my handy copy of Pierce's book again, he claims that range checking is a solved problem in theory, and the only remaining work is in how to integrate it into a program without prohibitive amounts of type annotation.

Re: Identifying apparently unused globals

2006-07-11 Thread skip
Simon I haven't used it myself, but pychecker Simon (http://pychecker.sourceforge.net/) is supposed to be able to Simon perform such stunts. From the page: Types of problems that can Simon be found include: Unused globals and locals (module or variable) Thanks. I've used both

  1   2   3   >