Re: [Tutor] Disable keyboard/mouse input on windows?

2007-10-01 Thread Tim Golden
Trey Keown wrote: Hey everybody, I was wondering, how could I disable all keyboard/mouse input for the whole windows system while I have a video playing? So the user can't press, for example, the super key [one with windows logo on it], and have the windows menu pop up? Could this be

Re: [Tutor] How to Practice Python?(Linpeiheng)

2007-10-01 Thread Alan Gauld
??? [EMAIL PROTECTED] wrote I am learning Python. Do you know somewhere I can practice Python? I means some sites where have exercises I can try solving. The Useless Python website has some exercises and other small projects. Some have solutions some don't. Also the Python Challenge web

Re: [Tutor] [tutor] creating image from a given data in wxpython

2007-10-01 Thread Alan Gauld
Ian Witham [EMAIL PROTECTED] wrote I basically wanna create a bitmap image in python. This will be basically in pixels. X and y coordinates will be specified in the program and python should create an image by matching the colours. I found it to be a very slow way to do things (both

Re: [Tutor] [tutor] printing bitmap image dynamically reading data inwxpython

2007-10-01 Thread Alan Gauld
Varsha Purohit [EMAIL PROTECTED] wrote I want to create a wxpython program where i am reading a list having integer values like [1,2,3,4]. and i need to display the output value as bitmap image which shd be coloured after reading the values. Like 1=red, 2=yellow, 3=orange etc and it

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread Alan Gauld
GTXY20 [EMAIL PROTECTED] wrote Any way to display the count of the values in a dictionary where the values are stored as a list? here is my dictionary: {'1': ['a', 'b', 'c'], '3': ['a', 'b', 'c'], '2': ['a', 'b', 'c'], '4': ['a', 'c']} I would like to display count as follows and I

Re: [Tutor] Really basic web templating

2007-10-01 Thread Martin Walsh
wormwood_3 wrote: Well yes and no:-) This sort of application would fall under the sprawling category of CGI, yes, and I can use Python scripts on my web server, so it is supported. But nearly every tutorial I have seen regarding Python and CGI only have to do with form submissions, doing

Re: [Tutor] creating the equivalent of string.strip()

2007-10-01 Thread Andrew James
I've gone ahead and created a script that does this, however it also strips punctuation. I was originally just comparing each character to a string containing a single space ' ' but even using s[-1].isspace() I lose punctuation marks. Any idea why that's happening? (Not the OP, I just thought

Re: [Tutor] Really basic web templating

2007-10-01 Thread Kent Johnson
wormwood_3 wrote: I want to do this because my site is on a shared hosting account, so I cannot install a web framework like Django Another option is to switch to a hosting account that supports Python. I have been working with WebFaction and I'm very happy with them; an account with Django

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread Kent Johnson
GTXY20 wrote: Hello, Any way to display the count of the values in a dictionary where the values are stored as a list? here is my dictionary: {'1': ['a', 'b', 'c'], '3': ['a', 'b', 'c'], '2': ['a', 'b', 'c'], '4': ['a', 'c']} I would like to display count as follows and I would not

Re: [Tutor] creating the equivalent of string.strip()

2007-10-01 Thread Kent Johnson
Andrew James wrote: I've gone ahead and created a script that does this, however it also strips punctuation. I was originally just comparing each character to a string containing a single space ' ' but even using s[-1].isspace() I lose punctuation marks. Any idea why that's happening?

Re: [Tutor] Really basic web templating

2007-10-01 Thread wormwood_3
My host actually does support Python. But I don't have access to Apache rules nor the level of access to install apps like Django, so I am limited to just scripts I write. But for that price, i will definitely check out WebFaction! -Sam - Original Message From: Kent Johnson [EMAIL

[Tutor] using **kwargs in __init__() as attributes

2007-10-01 Thread János Juhász
Dear Tutors, I would like to make a new class instance, where the intance attributes coming from the kwargs hash. class ADUser: def __init__(self, **kwargs): for key in kwargs.keys(): self.key = kwargs[k] a = ADUser(name='papa') It isn't working :( Yours sincerely,

Re: [Tutor] using **kwargs in __init__() as attributes

2007-10-01 Thread Kent Johnson
János Juhász wrote: Dear Tutors, I would like to make a new class instance, where the intance attributes coming from the kwargs hash. class ADUser: def __init__(self, **kwargs): for key in kwargs.keys(): self.key = kwargs[k] This sets the 'key' attribute of self

Re: [Tutor] using **kwargs in __init__() as attributes

2007-10-01 Thread Dave Kuhlman
On Mon, Oct 01, 2007 at 04:51:53PM +0200, J?nos Juh?sz wrote: Dear Tutors, I would like to make a new class instance, where the intance attributes coming from the kwargs hash. class ADUser: def __init__(self, **kwargs): for key in kwargs.keys(): self.key =

[Tutor] Location of modules in Mac OS X

2007-10-01 Thread Roy Chen
Hello all, I'm using MacPython 2.5 on OS X 10.4. I was just wondering if all the Python modules are contained in this directory: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ Also, I've installed the Python Image Library (PIL), and it seems to be installed in this folder:

Re: [Tutor] How to Practice Python?(Linpeiheng)

2007-10-01 Thread Andy
While not Python specific you could to the Ruby quizzes (http://www.rubyquiz.com/). Just look at the problems and write a solution in Python. On 10/1/07, Alan Gauld [EMAIL PROTECTED] wrote: ??? [EMAIL PROTECTED] wrote I am learning Python. Do you know somewhere I can practice Python? I

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread GTXY20
This works perfectly. However I will be dealing with an import of a very large dictionary - if I call the commands at command line this seems to be very taxing on the CPU and memory and will take a long time. I was thinking of creating each as a fucntion whereby python would just to write to a

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread Kent Johnson
GTXY20 wrote: This works perfectly. However I will be dealing with an import of a very large dictionary - if I call the commands at command line this seems to be very taxing on the CPU and memory and will take a long time. I was thinking of creating each as a fucntion whereby

[Tutor] function for removing all white spaces from a string

2007-10-01 Thread Tim
Hello, after reading the responses to athread in 2004 [1] I am wondering why there is no easy function in python to remove all white spaces from a string. Like: i am very fine to iamveryfine In IDL there's just one simple function which does this: STRCOMPRESS [2]. Is there really not yet

Re: [Tutor] [tutor] printing bitmap image dynamically reading data inwxpython

2007-10-01 Thread Varsha Purohit
Hi Alan, Thanks for the response. Its not a home work problem its actually a task i need to complete as i am tryin to make some tool which will be helpful to use as a script in arcgis. i kinda got some clue will surely ask help if i get stuck somewhere coz i know its difficult to put down in

Re: [Tutor] function for removing all white spaces from a string

2007-10-01 Thread Alan Gauld
Tim [EMAIL PROTECTED] wrote after reading the responses to athread in 2004 [1] I am wondering why there is no easy function in python to remove all white spaces from a string. i am very fine to iamveryfine You can use string.replace. 'I am very fine'.replace(' ','') 'Iamveryfine'

Re: [Tutor] using **kwargs in __init__() as attributes

2007-10-01 Thread Alan Gauld
János Juhász [EMAIL PROTECTED] wrote class ADUser: def __init__(self, **kwargs): for key in kwargs.keys(): self.key = kwargs[k] a = ADUser(name='papa') It isn't working :( Try using setattr instead of self.key assignment. HTH, -- Alan Gauld Author of the Learn

Re: [Tutor] using **kwargs in __init__() as attributes

2007-10-01 Thread Noufal Ibrahim
János Juhász wrote: Dear Tutors, I would like to make a new class instance, where the intance attributes coming from the kwargs hash. class ADUser: def __init__(self, **kwargs): for key in kwargs.keys(): self.key = kwargs[k] a = ADUser(name='papa') Your

Re: [Tutor] Location of modules in Mac OS X

2007-10-01 Thread Kent Johnson
Roy Chen wrote: Hello all, I'm using MacPython 2.5 on OS X 10.4. I was just wondering if all the Python modules are contained in this directory: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ Try import sys sys.path That will give you a list of all the places Python

Re: [Tutor] Really basic web templating

2007-10-01 Thread wormwood_3
There was another host that I wanted to mention along these lines (for Python sites) that I think is even better: VPSLink (http://www.vpslink.com). They allow root SSH access, and can install your choice of OS (lots of linux flavors, ubuntu, SUSE, CentOS, etc) from a control panel. Aside from

Re: [Tutor] Really basic web templating

2007-10-01 Thread Michael Langford
Check to see if mod_python is installed/installable. It would quite easily give you a very simple interface to do what you're looking for. --Michael -- Michael Langford Phone: 404-386-0495 Consulting: http://www.TierOneDesign.com/ On 9/30/07, wormwood_3 [EMAIL PROTECTED] wrote: Hello

Re: [Tutor] How to Practice Python?(Linpeiheng)

2007-10-01 Thread Rolando Pereira
Alan Gauld wrote: There are no such things as standard solutions to programming problems, its not like doing math! But usually there is The Right Way. I think... -- _ ASCII ribbon campaign ( ) - against HTML email X vCards / \

Re: [Tutor] function for removing all white spaces from a string

2007-10-01 Thread Bill Campbell
On Mon, Oct 01, 2007, Alan Gauld wrote: Tim [EMAIL PROTECTED] wrote after reading the responses to athread in 2004 [1] I am wondering why there is no easy function in python to remove all white spaces from a string. i am very fine to iamveryfine You can use string.replace. 'I am

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread Ricardo Aráoz
GTXY20 wrote: Hello, Any way to display the count of the values in a dictionary where the values are stored as a list? here is my dictionary: {'1': ['a', 'b', 'c'], '3': ['a', 'b', 'c'], '2': ['a', 'b', 'c'], '4': ['a', 'c']} I would like to display count as follows and I would not

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread GTXY20
Thanks again I have worked that issue out. However I have the following function and it is throwing this error: FEXpython_v2.py, line 32, in UnitHolderDistributionqty count[item]+=1 KeyError: 3 This is the function: def Distributionqty(dictionary): holder=list() held=list()

Re: [Tutor] function for removing all white spaces from a string

2007-10-01 Thread Ricardo Aráoz
Tim wrote: Hello, after reading the responses to athread in 2004 [1] I am wondering why there is no easy function in python to remove all white spaces from a string. Like: i am very fine to iamveryfine In IDL there's just one simple function which does this: STRCOMPRESS [2]. Is

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread Kent Johnson
GTXY20 wrote: Thanks again I have worked that issue out. However I have the following function and it is throwing this error: FEXpython_v2.py, line 32, in UnitHolderDistributionqty count[item]+=1 KeyError: 3 This is the function: def Distributionqty(dictionary):

Re: [Tutor] Dictionary - count values where values are stored as a list

2007-10-01 Thread GTXY20
Thanks so much I changed to the following and this worked: def HolderDistributionqty(dictionary): from collections import defaultdict count=defaultdict(int) for item in dictionary.values(): count[len(item)]+=1 for k,v in sorted(count.items()): fdist=k qty=v

[Tutor] A simple Question...

2007-10-01 Thread Suzanne Peel
Hi, I have a very simple question that I cannot find the answer to ... if I knew the correct question to ask it would be simple. I am trying to find the name of the file I am currently running (please don't laugh at me I know it's simple but I cannot figure it out). I want to know where my

Re: [Tutor] A simple Question...

2007-10-01 Thread John Fouhy
On 02/10/2007, Suzanne Peel [EMAIL PROTECTED] wrote: I am trying to find the name of the file I am currently running (please don't laugh at me I know it's simple but I cannot figure it out). Have a look at sys.argv[0] :-) -- John. ___ Tutor

Re: [Tutor] A simple Question...

2007-10-01 Thread Kent Johnson
Suzanne Peel wrote: Hi, I have a very simple question that I cannot find the answer to ... if I knew the correct question to ask it would be simple. I am trying to find the name of the file I am currently running (please don't laugh at me I know it's simple but I cannot figure it

Re: [Tutor] creating the equivalent of string.strip()

2007-10-01 Thread Christopher Spears
I was looking for the source code for the strip functions at python.org. I didn't find anything. Do you or someone else know where the source code is posted? I tried to find python on my workstation, but I'm not sure where the sys admin installed it.