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" migh

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

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 again

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 -- http://mail.python.org/mailman/listinfo/

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 > tha

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 simult

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 furt

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 f

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 http://www.voi

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 ? >> >> >> > > in this hypothetical case, i was as

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, rat

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 don'

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 custo

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

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 "", lin

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 exceptio

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 al

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: if len(x) > 0: do_something() Instead of using the language-defined bahviour, as stated by PE

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 mak

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: > > > if len(x) > 0: > do_something() > > Instead of using the lang

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: > > > if len(x) > 0: > do_somet

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 a

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: > > > if len(x) > 0: > do_something() > > Instead of using the lang

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: '\ > +str(int(memory.TotalVirtual

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 b

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 w

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__ self.connect(h

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 ;-) >

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 PRO

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:   Fi

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 len(x) > 0 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 > of

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

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

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

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

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 S

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 asser

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 i

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 "Time

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(, 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 2.4 and 2.

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 id

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 at

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

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 t

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 dir

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

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 fun

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. That

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 correct

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

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)? > > >

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, a

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

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 di

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

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 cond

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 no

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 := read

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 ci

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. Jav

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, Fuzz

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

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

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 > > anno

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 b

Re: os.access() problem

2006-07-11 Thread Larry Bates
Phil Schmidt wrote: > 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(, os.W_OK) always returns false. > > I wrote a 2-liner Python script to just test os.access on any file. > I have t

Re: Making HTTP requests using Twisted

2006-07-11 Thread Manlio Perillo
rzimerman ha scritto: > 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 reque

<    1   2