Re: [Tutor] help with program from learning python the hard way

2012-01-19 Thread bodsda
If I say that sys.argv is a list, does that help you? Also, run things from a command prompt for this kind of thing, at least then you can guarantee what args get passed Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Jason Loeve Sender: tutor-bounces

Re: [Tutor] re module help

2012-01-09 Thread bodsda
You could use read directly on the popen call to negate having to write to a file output = os.popen(“sdptool -i hci0 search OPUSH“).read() Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Ganesh Kumar Sender: tutor-bounces+bodsda=googlemail@python.org Date

Re: [Tutor] A few Python Mysteries

2011-12-21 Thread bodsda
, you need to replace the dll that was removed by the uninstallation of python2.5 - to do this, reinstall python2.5 Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Wayne Watson Sender: tutor-bounces+bodsda=googlemail@python.org Date: Wed, 21 Dec 2011 07:15:3

Re: [Tutor] unsupported operand

2011-12-17 Thread bodsda
plete' traceback, so we can see what caused the error. I'm gonna take a wild guess at it being the pyplot.plot call though, due to the data types that its moaning about. Bodsda Sent from my BlackBerry® wireless device -Original Message- From: stm atoc Sender: tutor-bounces+bo

Re: [Tutor] return, why do I need it?

2011-12-11 Thread bodsda
that shows one usage of return values Hth, Bodsda Sent from my BlackBerry® wireless device -Original Message- From: "Pete O'Connell" Sender: tutor-bounces+bodsda=googlemail@python.org Date: Mon, 12 Dec 2011 01:08:47 To: Subject: [Tutor] return, w

Re: [Tutor] list.index() question

2011-12-08 Thread bodsda
That won't work because l1[0] is ['a', 1] What happens if you don't change the code? l1.index('c') Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Robert Berman Sender: tutor-bounces+bodsda=googlemail@python.org Date: Thu, 0

Re: [Tutor] how to find index of list with its value

2011-12-08 Thread bodsda
>>>mylist = [1,2,3,4,1] >>>mylist.index(1) 0 But note that this only shows the index for the first occurrence of the item. Bodsda Sent from my BlackBerry® wireless device -Original Message- From: surya k Sender: tutor-bounces+bodsda=googlemail@python.org Date:

Re: [Tutor] Interprocess communication

2011-12-06 Thread bodsda
If you invoke the system 'cp' command though, it may not be possible to have a progress bar because the command will only talk back when it exits. Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Alan Gauld Sender: tutor-bounces+bodsda=googlemail@

Re: [Tutor] unable to run file though dir path included

2011-12-06 Thread bodsda
directory to 'python\Lib\Site-packages' is doing what you think it should do. Bodsda Sent from my BlackBerry® wireless device -Original Message- From: surya k Sender: tutor-bounces+bodsda=googlemail@python.org Date: Wed, 7 Dec 2011 00:27:30 To: Python Tutor Subject: [Tu

Re: [Tutor] Python Saved the Day

2011-12-04 Thread bodsda
to the screen. This saved an estimated 55 man hours of work. Bodsda Sent from my BlackBerry® wireless device -Original Message- From: wesley chun Sender: tutor-bounces+bodsda=googlemail@python.org Date: Sun, 4 Dec 2011 00:51:59 To: Mark Lybrand Cc: Subject: Re: [Tutor] Python

Re: [Tutor] list, tuple or dictionary

2011-11-29 Thread bodsda
You could use any of them, but a dict would be the most logical assuming no duplicate items Bodsda Sent from my BlackBerry® wireless device -Original Message- From: ADRIAN KELLY Sender: tutor-bounces+bodsda=googlemail@python.org Date: Tue, 29 Nov 2011 20:31:56 To: Subject

Re: [Tutor] How to write lines in a text file (GUI)

2011-11-29 Thread bodsda
I'm not sure, I also don't have access to the python docs atm, but the simplest method would be to read the whole file into a list, edit the correct item (remembering to count from 0 not 1) and then writing the whole list back to the file. Bodsda --Original Message-- From: M

Re: [Tutor] How to write lines in a text file (GUI)

2011-11-29 Thread bodsda
by line. Experiment with both, see what data types they both return and decide which is most suitable. Bear in mind you need to easily differentiate each line and access them individually. If your still struggling to write this function, show us how far you get and we can go from there. Hop

Re: [Tutor] Making a function run every second.

2011-11-29 Thread bodsda
You won't get it exactly on because the time it takes to call the function will affect your trigger time. I would use something like an infinite loop with a 1 second sleep after the function call Bodsda Sent from my BlackBerry® wireless device -Original Message- From: "Mi

Re: [Tutor] ProgressBar - Python and Powershell

2011-11-20 Thread bodsda
This is just my opinion but I would have several (say 10) powershell scripts individually called by python, python will sit still until the powershell exits, then update the progress bar by 10% before calling the next script etc etc. Bodsda Sent from my BlackBerry® wireless device

Re: [Tutor] Help with error in ski game

2011-11-20 Thread bodsda
Just a guess but take a look at the spelling. centerx Or centrex Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Chloe Beck Sender: tutor-bounces+bodsda=googlemail@python.org Date: Sun, 20 Nov 2011 11:58:25 To: Subject: [Tutor] Help with error in ski game

Re: [Tutor] how can I save it from "for"

2011-11-11 Thread bodsda
Look into the 'continue' and 'break' statements - both very handy when working with loops Or just increment/decrement the conditional until it evaluates to False Bodsda Sent from my BlackBerry® wireless device -Original Message- From: lina Sender: tutor-bounc

Re: [Tutor] printing a key not a value

2011-10-25 Thread bodsda
Sure, mydict = {'a':1, 'b',2} for key in mydict: print key Hope this helps, Bodsda Sent from my BlackBerry® wireless device -Original Message- From: ADRIAN KELLY Sender: tutor-bounces+bodsda=googlemail@python.org Date: Tue, 25 Oct 2011 13:45:50 To: Subje

Re: [Tutor] Python Job Scheduling package

2011-10-14 Thread bodsda
Have you thought about writing your own? Others have posted some useful links, but in all honesty you could hack something together to achieve that in next to no time Bodsda Sent from my BlackBerry® wireless device -Original Message- From: harish bansal Sender: tutor-bounces+bodsda

Re: [Tutor] Calling Python Functions from Powershell scripts

2011-10-05 Thread bodsda
he beginning of each line - that way I can track execution order and follow error/info messages all in one file. That's just how I prefer to do it. Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Nikunj Badjatya Sender: tutor-bounces+bodsda=googlemail@

Re: [Tutor] Input

2011-09-30 Thread bodsda
You could also use something like pygame to wait and test for keypresses Bodsda (Top post is phone limitation, sorry) Sent from my BlackBerry® wireless device -Original Message- From: Mark Lybrand Sender: tutor-bounces+bodsda=googlemail@python.org Date: Fri, 30 Sep 2011 13:27:27

Re: [Tutor] guess age programme (still stuck!!!!!)

2011-09-30 Thread bodsda
If I enter 35 at the prompt in your program, does python see this: 35 Or this: “35“ ? Hope this helps, Bodsda Sent from my BlackBerry® wireless device -Original Message- From: ADRIAN KELLY Sender: tutor-bounces+bodsda=googlemail@python.org Date: Fri, 30 Sep 2011 19:18:15 To: Cc

Re: [Tutor] guess age programme (please help)

2011-09-30 Thread bodsda
f you don't want to do that, look into the 'break' statement. while someOtherCondition: Do stuff if guesses == 0: break Hope this helps, Bodsda Sent from my BlackBerry® wireless device -Original Message- From: ADRIAN KELLY Sender: tutor-bounc

Re: [Tutor] where to look for python codes

2011-09-29 Thread bodsda
written by beginners. The code will not be enterprise standard, but it should be a good insight into how others write python programs Hope this helps, Bodsda, Ubuntu beginners team P.S: sorry for the top post, smartphone limitation Sent from my BlackBerry® wireless device -Original Message

Re: [Tutor] paper scissors

2011-09-24 Thread bodsda
that there are other place holders such as %i and %d that expect a certain data type. With %s, if it is not a string that is given to it, it will attempt to be converted to a string first. Hope this helps, Bodsda Sent from my BlackBerry® wireless device -Original Message- From:

Re: [Tutor] string formatting

2011-09-19 Thread bodsda
Is there any additional overhead of using the locals() or format(locals()) instead of a tuple? - the format option is a double function call so I would expect that to be considerably slower Thanks, Bodsda -- my phone won't let me bottom post, sorry Sent from my BlackBerry® wireless d

Re: [Tutor] If statement optimization

2011-09-16 Thread bodsda
Thanks for the explanation - very clear. Cheers, Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Steven D'Aprano Sender: tutor-bounces+bodsda=googlemail@python.org Date: Fri, 16 Sep 2011 20:43:45 To: Tutor - python List Subject: Re: [Tutor] If stat

[Tutor] If statement optimization

2011-09-16 Thread bodsda
Hi, In a normal if,elif,elif,...,else statement, are the conditions checked in a linear fashion? I am wondering if I should be making an effort to put the most likely true condition at the beginning of the block Thanks, Bodsda Sent from my BlackBerry® wireless device

Re: [Tutor] how to sort the file out

2011-09-06 Thread bodsda
I'm also slightly confused. Why does file one start at 1, but file 2 starts at 3. Why not just duplicate file2? Bodsda Sent from my BlackBerry® wireless device -Original Message- From: lina Sender: tutor-bounces+bodsda=googlemail@python.org Date: Wed, 7 Sep 2011 12:46:3

Re: [Tutor] Python program with multiple answers

2011-05-11 Thread bodsda
Hi, I would suggest appending the dice[roll] to a new list just after the print statement, then in the quit block order the list and then loop over it and print each entry. Hope this helps, Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Johnson Tran Sender

Re: [Tutor] Gtk - relational data display and edit

2011-04-26 Thread bodsda
data from them Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Walter Prins Date: Tue, 26 Apr 2011 16:55:36 To: Cc: Subject: Re: [Tutor] Gtk - relational data display and edit On 26 April 2011 16:34, wrote: > Hi, > > I am reading in data from a csv fi

[Tutor] Gtk - relational data display and edit

2011-04-26 Thread bodsda
boxes as I have no idea how many entries there will be (column length will be fixed) so I can't create the entry widgets beforehand Anyone have any suggestions? Thanks, Bodsda Sent from my BlackBerry® wireless device ___ Tutor maillist - Tuto

Re: [Tutor] Variables and constants [was Re: working with strings inpython3]

2011-04-19 Thread bodsda
And presumably cleans up the leftover object with the value of 42 when it changes to point at the 43 object? Or does it leave all changes in memory until the program exits? Bodsda. Sorry for top posting, my phone won't let me change it Sent from my BlackBerry® wireless device -Ori