Re: [Tutor] Display all field of a listuples

2011-02-25 Thread Christopher Brookes
It's works. Thank you all. 2011/2/25 bob gailer > On 2/24/2011 4:54 PM, Christopher Brookes wrote: > > Hi i would like to display all the field of my powerAll like this : > > Choose a power : > Froid devorant : Embrase lenemi et le feu bruler > Flammes infernales : 'Gele lenemi sur place > >

Re: [Tutor] comparing strings

2011-02-25 Thread Corey Richardson
On 02/25/2011 02:53 AM, Edward Martinez wrote: > Thanks for the reply. i now understand that python uses either > ASCll or Unicode to compare and to do other things 1. Those are i's, not l's. 2. The first 128 characters of Unicode are the same as the only 128 characters of unicode. Check ou

Re: [Tutor] comparing strings

2011-02-25 Thread bob gailer
On 2/25/2011 3:23 AM, Corey Richardson wrote: On 02/25/2011 02:53 AM, Edward Martinez wrote: Thanks for the reply. i now understand that python uses either ASCll or Unicode to compare and to do other things When comparing string (not unicode) Python uses the underlying hardware characte

Re: [Tutor] list of dictionary

2011-02-25 Thread Alan Gauld
"sunil tech" wrote i have d=[{'qty':0.0},{'qty':0.0}] when all the qty is 0.0, i want to perform some print operation (only at once, after it checks everything in the list of dictionary 'd')... if its not 0.0, print some message... Just so I'm clear on the requirement you want something l

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Alan Gauld
"Bill Allen" wrote I have times when it is useful for me to check the environment of a user system on our lan remotely while trouble shooting and issue with them. Now, this is quite easy to do while I am using a windows system via the computer management console. I think we are meaning d

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Steven D'Aprano
Alan Gauld wrote: Anything you can do locally you can do on the remote machine with a combination of ssh, rsh, rlogin, telnet etc. I'd like to remove a CD from the CD drive, and replace it with a different disk. Being difficult just for the sake of it-ly y'rs, -- Steven _

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Corey Richardson
On 02/25/2011 04:49 AM, Steven D'Aprano wrote: > Alan Gauld wrote: > >> Anything you can do locally you can do on the remote >> machine with a combination of ssh, rsh, rlogin, telnet etc. > > I'd like to remove a CD from the CD drive, and replace it with a > different disk. > > > Being difficu

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Chris Fuller
My "etc" would be the loopback device and an iso image, optionally accompanied by wget and cdrecord (or whatever the kids are using these days). I was also reminded of this story: http://thedailywtf.com/Articles/ITAPPMONROBOT.aspx Cheers On Friday 25 February 2011, Corey Richardson wrote: > On

Re: [Tutor] having difficulty installing python

2011-02-25 Thread Dominik Zyla
On Thu, Feb 24, 2011 at 03:56:44PM +, Neven Dragojlovic wrote: > Please can someone help me? I am trying to install python 2.5.4 on > MacBookPro running on OS10.6.6, but when I try to set it up on > Terminal by running "python setup.py install" I get the following: > IDLE Subprocess: Connection

[Tutor] Search function in a list-tuples

2011-02-25 Thread Christopher Brookes
Hi, is there a better way to do this ? (*heros are Character*) herosAll = [ Character(0,"Chris","Soldat fort",type[0],15,5,8,50,1), Character(1,"Antaa","Soldat moins fort",type[0],15,5,8,50,1)] def HeroExist(HerosName): herosId = -1 for heros in herosAll: if HerosName

[Tutor] Unintentionally manipulating a list

2011-02-25 Thread ranjan das
I am facing the following problem I have a list of the form INPUT= [ [ ['A1-N','A2-Y','A3-N' ],['B1-Y','B2-N','B3-N' ] ], [.] ] and I want an output of the form (selecting only those elements which have a Y associated with them) OUTPUT=[ ['A2-Y', 'B1-Y'],[] ] I wrote the followi

Re: [Tutor] Unintentionally manipulating a list

2011-02-25 Thread Alex Hall
You may want to deepcopy instead of just copy? On 2/25/11, ranjan das wrote: > I am facing the following problem > > > I have a list of the form > > INPUT= [ [ ['A1-N','A2-Y','A3-N' ],['B1-Y','B2-N','B3-N' ] ], [.] ] > > > and I want an output of the form (selecting only those elements wh

Re: [Tutor] Unintentionally manipulating a list

2011-02-25 Thread Knacktus
Am 25.02.2011 15:49, schrieb ranjan das: I am facing the following problem I have a list of the form INPUT= [ [ ['A1-N','A2-Y','A3-N' ],['B1-Y','B2-N','B3-N' ] ], [.] ] and I want an output of the form (selecting only those elements which have a Y associated with them) OUTPUT=[ ['A

Re: [Tutor] Unintentionally manipulating a list

2011-02-25 Thread Steven D'Aprano
ranjan das wrote: I am facing the following problem I have a list of the form INPUT= [ [ ['A1-N','A2-Y','A3-N' ],['B1-Y','B2-N','B3-N' ] ], [.] ] and I want an output of the form (selecting only those elements which have a Y associated with them) OUTPUT=[ ['A2-Y', 'B1-Y'],[] ]

[Tutor] Python in MATLAB

2011-02-25 Thread Sriram Jaju
can i embed python code in MATLAB program? -- Xcited 2 be AliveSriram ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python in MATLAB

2011-02-25 Thread Sriram Jaju
can i embed python code in MATLAB program? -- Xcited 2 be AliveSriram ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to vectorize a constant function?

2011-02-25 Thread Jose Amoreira
Hello! In "A Primer on Scientific Programming with Python", they define a vectorized function as a scalar function that, when called with a vector argument, returns a vector with the values of the function for each of the values stored in the argument vector. I am trying to define a constant ve

Re: [Tutor] Search function in a list-tuples

2011-02-25 Thread Alan Gauld
"Christopher Brookes" wrote Hi, is there a better way to do this ? (*heros are Character*) There are several better ways but mainly they involve techniques that may be too advanced for you at present, so we'll keep it simple for now :-) herosAll = [ Character(0,"Chris","Soldat fort",type[0]

Re: [Tutor] How to vectorize a constant function?

2011-02-25 Thread Peter Otten
Jose Amoreira wrote: > I am trying to define a constant vectorized function, that is, one that > returns 1. (for instance) when called with a scalar argument x and that > returns array([1.,1.,1.]) when the argument is a three-element array, etc. With the help of google I found http://docs.scipy.

Re: [Tutor] list of dictionary

2011-02-25 Thread Patty
- Original Message - From: Pacific Morrowind To: tutor@python.org Sent: Thursday, February 24, 2011 10:21 PM Subject: Re: [Tutor] list of dictionary Hi; On 24/02/2011 9:35 PM, sunil tech wrote: Hi all... i have d=[{'qty':0.0},{'qty':0.0} If there isn't so

Re: [Tutor] Python in MATLAB

2011-02-25 Thread Chris Fuller
Absolutely. You can use mex files to interface with the Python API (this requires considerable C proficiency), or you can use something like pymex or pymat. Did you google "matlab python"? http://vader.cse.lehigh.edu/~perkins/pymex.html http://claymore.engineer.gvsu.edu/~steriana/Python/pymat

Re: [Tutor] Search function in a list-tuples

2011-02-25 Thread Christopher Brookes
Hi, I found the solution :) Special thanks to Alan G. Solution : def FindByName(HerosName): for heros in herosAll: if HerosName == heros.name: return heros return None HerosName = 'notfound' while FindByName(HerosName) == None: HerosName=input("Enter her

Re: [Tutor] Python in MATLAB

2011-02-25 Thread Sriram Jaju
I googled but i didn't get considerable results. I am doing a project on optical character recognition, i tried a code on matlab, but it was not efficient. I tried it on python it worked. Now i want to embed python code in matlab code with other matlab function such as image acquisition etc. so how

[Tutor] Running Existing Python

2011-02-25 Thread Justin Bonnell
I downloaded Python 2.7.1. I think this is a pretty basic question. When I try to run the existing python files on the computer (hello.py), I receive a syntax error. Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "copyright", "credits" or "l

Re: [Tutor] Running Existing Python

2011-02-25 Thread Corey Richardson
On 02/25/2011 06:42 PM, Justin Bonnell wrote: > I downloaded Python 2.7.1. I think this is a pretty basic question. > When I try to run the existing python files on the computer (hello.py), I > receive a syntax error. > > Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) > [GCC 4.2.1 (Apple Inc

Re: [Tutor] Search function in a list-tuples

2011-02-25 Thread ALAN GAULD
CCing group. Please use ReplyAll in replies to the list. > Hi, thank your for your answer. i wrote this now : >def HeroExist(HerosName): >for heros in herosAll: >if HerosName in heros.name: >herosId = heros.id >return herosId >return None > >HerosName=inp

[Tutor] scripts search

2011-02-25 Thread Victor Binns
Hello I am fairly new to python. I have a small business and I wanted to use python in my business. I have a need for an Employee Time and Attendance software. Is there any python scripts out there that can do the trick? Victor _

Re: [Tutor] scripts search

2011-02-25 Thread Corey Richardson
On 02/25/2011 03:20 PM, Victor Binns wrote: > > Hello I am fairly new to python. > > I have a small business and I wanted to use python in my business. I have a > need for an > Employee Time and Attendance software. > > Is there any python scripts out there that can do the trick? > I don

Re: [Tutor] Running Existing Python

2011-02-25 Thread Alan Gauld
"Justin Bonnell" wrote Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "copyright", "credits" or "license()" for more information. The >>> prompt means you are already inside Python. You can type Python commands at the >>> prompt, thing

Re: [Tutor] scripts search

2011-02-25 Thread Alan Gauld
"Victor Binns" wrote I have a small business and I wanted to use python in my business. I have a need for an Employee Time and Attendance software. Is there any python scripts out there that can do the trick? I'm not aware of any but a Google or Sourceforge search might throw up someth

Re: [Tutor] list of dictionary

2011-02-25 Thread Pacific Morrowind
On 25/02/2011 9:44 AM, Patty wrote: - Original Message - *From:* Pacific Morrowind *To:* tutor@python.org *Sent:* Thursday, February 24, 2011 10:21 PM *Subject:* Re: [Tutor] list of dictionary Pr

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Bill Allen
I apologize for not have been clear previously. What I am trying to access are the Windows system environment variables. The same ones that are listed out if you type the set command at a command prompt in Windows. --Bill On Fri, Feb 25, 2011 at 03:11, Alan Gauld wrote: > > "Bill Allen

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Steve Willoughby
On 25-Feb-11 18:50, Bill Allen wrote: I apologize for not have been clear previously. What I am trying to access are the Windows system environment variables. The same ones that are listed out if you type the set command at a command prompt in Windows. There isn't a "system" set of environm

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Steve Willoughby
On 25-Feb-11 19:27, Steve Willoughby wrote: Wait. Are you trying to figure out how, on a Unix system, to read Unix system environment variables as you're accustomed to doing on Windows? Or are you saying you want to, from a remote Unix system, reach out to a Windows system and see that Windo

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Bill Allen
On Fri, Feb 25, 2011 at 21:33, Steve Willoughby wrote: > On 25-Feb-11 19:27, Steve Willoughby wrote: > > > Or are you saying you want to, from a remote Unix system, reach out to a > Windows system and see that Windows system's system environment variables? Yes, that's it exactly.:-) I admi

[Tutor] Cross-Module Interaction

2011-02-25 Thread Corey Richardson
Greetings, Tutors (Sorry for the poor subject name, couldn't think of anything better) I'm writing a MUD server as part of a school project. Yes this is homework, but I'm not taking a traditional programming class (going through the OCW for CS50 at Harvard and getting credit). I'm in the design

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Steve Willoughby
On 25-Feb-11 20:26, Bill Allen wrote: On Fri, Feb 25, 2011 at 21:33, Steve Willoughby mailto:st...@alchemy.com>> wrote: On 25-Feb-11 19:27, Steve Willoughby wrote: Or are you saying you want to, from a remote Unix system, reach out to a Windows system and see that Windows system'

Re: [Tutor] Cross-Module Interaction

2011-02-25 Thread Steven D'Aprano
Corey Richardson wrote: My first thought was to have a module specifically for holding things like that, global objects that all the interacting modules need access to. I did a simple test with a lib module, and then a few modules that simply added things to a list called g in that lib module, b

Re: [Tutor] Cross-Module Interaction

2011-02-25 Thread Corey Richardson
On 02/26/2011 12:11 AM, Steven D'Aprano wrote: > [steve@sylar ~]$ python > Python 2.5 (r25:51908, Nov 6 2007, 16:54:01) > [GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import lib > >>> import a > >>> lib.g > [] >

Re: [Tutor] accessing another system's environment

2011-02-25 Thread Bill Allen
On Fri, Feb 25, 2011 at 22:39, Steve Willoughby wrote: > > One question you need to figure out is how interactive you want this to be, > or how automated. That will drive the implementation of what comes after. > As will the list of available options at your site for securely allowing a > remot