Re: [Tutor] Bar Operator ??

2013-03-10 Thread Danny Yoo
> > It's a filter: > > https://docs.djangoproject.com/en/1.5/ref/templates/builtins/ And to be explicit about Mitya's point: it's technically not Python. It's part of Django's template language. If it were Python, it'd be interpreted as the "or" bitwise operator, http://docs.python.org/3/re

Re: [Tutor] Tutor Digest, Vol 109, Issue 29

2013-03-10 Thread Steven D'Aprano
On 11/03/13 10:30, Stephen Yang wrote: please unsubscribe You subscribed yourself. You can unsubscribe yourself by following the instructions here: To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/tutor or, via email, send a message w

Re: [Tutor] python on ipad

2013-03-10 Thread Hilton Fernandes
Hi ! If you don't mind, a non technical recommendation: maybe you should consider a cheaper, low end Android smartphone. An iPad will attract the attention of robbers everywhere: it's small, it's expansive and it's fancy. The training 'Developing Android Apps completely in Python', at https://ep

Re: [Tutor] Tutor Digest, Vol 109, Issue 29

2013-03-10 Thread Alan Gauld
On 10/03/13 23:30, Stephen Yang wrote: please unsubscribe Nope, I like it here. But you can unsubscribe by following the instructions in the message you sent... To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/tutor or, via ema

Re: [Tutor] python on ipad

2013-03-10 Thread Alan Gauld
On 10/03/13 21:42, Benjamin Fishbein wrote: Hello. I wrote some python programs for my small business that I run on my computer...macbook ...I should get a cheap computer for a couple hundred bucks and run the python scripts on it. I think this is possible because I hear the code is the same wh

Re: [Tutor] 'Last' in Python?

2013-03-10 Thread Mark Lawrence
On 11/03/2013 00:16, Dave Friedman wrote: Hi all, I'm teaching myself Python in part with Google's course, and one of the exercises is to sort a list of tuples by the last element. e.g.: a list [(1, 7), (1, 3), (3, 4, 5), (2, 2)] yields [(2, 2), (1, 3), (3, 4, 5), (1, 7)]. My answer, after figu

Re: [Tutor] 'Last' in Python?

2013-03-10 Thread Mitya Sirenef
On 03/10/2013 08:16 PM, Dave Friedman wrote: Hi all, > > I'm teaching myself Python in part with Google's course, and one of the exercises is to sort a list of tuples by the last element. > e.g.: a list [(1, 7), (1, 3), (3, 4, 5), (2, 2)] yields [(2, 2), (1, 3), (3, 4, 5), (1, 7)]. > > My ans

[Tutor] 'Last' in Python?

2013-03-10 Thread Dave Friedman
Hi all, I'm teaching myself Python in part with Google's course, and one of the exercises is to sort a list of tuples by the last element. e.g.: a list [(1, 7), (1, 3), (3, 4, 5), (2, 2)] yields [(2, 2), (1, 3), (3, 4, 5), (1, 7)]. My answer, after figuring out lambda functions, is def sort_last(

Re: [Tutor] python on ipad

2013-03-10 Thread Ben Fishbein
Btw I don't have any GUI so that's not an issue. Sent from my iPad On Mar 10, 2013, at 6:07 PM, William Ray Wing wrote: > On Mar 10, 2013, at 6:18 PM, Sven wrote: > >> On 10 March 2013 21:42, Benjamin Fishbein wrote: >>> Hello. I wrote some python programs for my small business that I run on

Re: [Tutor] python on ipad

2013-03-10 Thread Ben Fishbein
Thanks. Pythonista looks good. Do you know if it can use any module? Besides the standard libraries that come with python I also use selenium. I'm not sure if it would work with pythonista. In my mac selenium needs at least python 2.7. I wasn't able to get selenium to work for a while and it tur

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread Jason Friedman
> Thank you for the response! I next modified the __str__ so it will also > include the values self. boredom and self. hunger. I am getting a bit > confused with how to set up strings from within a method. It is set up like > this: > > def __str__(self): > attrs = "Hunger: ", self.hunge

Re: [Tutor] Tutor Digest, Vol 109, Issue 29

2013-03-10 Thread Stephen Yang
> > Do these scripts have GUIs or are they just CLI scripts? > > If they are CLI scripts then you can certainly run them on a jailbroken > device > http://www.rioleo.org/python-on-the-ipad.php > > or if you don't want to jailbreak http://omz-software.com/pythonista/ >

Re: [Tutor] subprocess module: when to _NOT_ use shell=True

2013-03-10 Thread Eike Welk
On Sunday 10.03.2013 09:56:26 aklei...@sonic.net wrote: > I've not found anywhere a clear explanation of when not to set shell=True. > If the command line must be interpreted by the shell then clearly this > must be set. So the question that comes up is why not set it always? Because ``shell=True`

Re: [Tutor] subprocess module: when to _NOT_ use shell=True

2013-03-10 Thread eryksun
On Sun, Mar 10, 2013 at 12:56 PM, wrote: > I've not found anywhere a clear explanation of when not to > set shell=True. If the command line must be interpreted by > the shell then clearly this must be set. So the question > that comes up is why not set it always? Using the shell can be a securit

Re: [Tutor] python on ipad

2013-03-10 Thread William Ray Wing
On Mar 10, 2013, at 6:18 PM, Sven wrote: > On 10 March 2013 21:42, Benjamin Fishbein wrote: > Hello. I wrote some python programs for my small business that I run on my > computer...macbook air. I'm planning to backpack around Mexico and perhaps > south america. I'll still be working though. B

Re: [Tutor] python on ipad

2013-03-10 Thread Fernando Salamero
Sure. Pythonista is a must have. https://itunes.apple.com/es/app/pythonista/id528579881?mt=8 > Date: Sun, 10 Mar 2013 16:42:59 -0500 > From: Benjamin Fishbein > To: *tutor python > Subject: [Tutor] python on ipad > Message-ID: <315460bc-0389-4e18-b7ef-0c4e1d7ca...@gmail.com> > Content-Type: t

Re: [Tutor] python on ipad

2013-03-10 Thread Sven
On 10 March 2013 21:42, Benjamin Fishbein wrote: > Hello. I wrote some python programs for my small business that I run on my > computer...macbook air. I'm planning to backpack around Mexico and perhaps > south america. I'll still be working though. Basically my computer does all > the work, I ju

[Tutor] python on ipad

2013-03-10 Thread Benjamin Fishbein
Hello. I wrote some python programs for my small business that I run on my computer...macbook air. I'm planning to backpack around Mexico and perhaps south america. I'll still be working though. Basically my computer does all the work, I just need to have internet connections and run the program

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread Jason Friedman
> I am trying to use a __str__ method to display the values of attribute mood > = self.hunger + self. boredom. > When I try to execute I get this error: > > Traceback (most recent call last): > File "C:/Users/Vincent/Documents/Programming Tutorials/Python Programming > for the Absolute Beginner -

[Tutor] Problem with Fibonacci example

2013-03-10 Thread bob gailer
On 3/10/2013 3:06 AM, bessenkphilip wrote: Hello Bob, Hi. When you have a Python question that is not related to Python Pipelines I suggest you send it to the tutor group.I and others will see it and you will get faster help. While trying one Fibonacci example in tutorial, i'm having some

[Tutor] subprocess module: when to _NOT_ use shell=True

2013-03-10 Thread akleider
I've not found anywhere a clear explanation of when not to set shell=True. If the command line must be interpreted by the shell then clearly this must be set. So the question that comes up is why not set it always? In an effort to investigate, I came up with the following script that indicates tha

Re: [Tutor] Need help with function coding.

2013-03-10 Thread Steven D'Aprano
On 11/03/13 03:09, Joel Goldstick wrote: On Sun, Mar 10, 2013 at 11:35 AM, Steven D'Aprano wrote: On 10/03/13 05:23, Jason Friedman wrote: You might look at this: https://chrome.google.com/**webstore/[...] Why would I do that? If you have a question,

Re: [Tutor] Need help with function coding.

2013-03-10 Thread Joel Goldstick
On Sun, Mar 10, 2013 at 11:35 AM, Steven D'Aprano wrote: > On 10/03/13 05:23, Jason Friedman wrote: > >> You might look at this: >> >> https://chrome.google.com/**webstore/[...] >> > > > Why would I do that? > > If you have a question, please ask it. Don't post

Re: [Tutor] Need help with function coding.

2013-03-10 Thread Steven D'Aprano
On 10/03/13 05:23, Jason Friedman wrote: You might look at this: https://chrome.google.com/webstore/ [...] Why would I do that? If you have a question, please ask it. Don't post a link to something that looks like spam with no explanation at all. Oh, and if you think I'm being rude, consid

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread eryksun
On Sun, Mar 10, 2013 at 4:57 AM, Vincent Balmori wrote: > I am trying to use a __str__ method to display the values of attribute mood > = self.hunger + self. boredom. __str__ has to return a string: http://docs.python.org/3/reference/datamodel.html#object.__str__ Bookmark the "_" index of the d

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread Steven D'Aprano
On 10/03/13 19:57, Vincent Balmori wrote: I am trying to use a __str__ method to display the values of attribute mood = self.hunger + self. boredom. When I try to execute I get this error: Traceback (most recent call last): File "C:/Users/Vincent/Documents/Programming Tutorials/Python Progra

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread Timo
Op 10-03-13 09:57, Vincent Balmori schreef: I am trying to use a __str__ method to display the values of attribute mood = self.hunger + self. boredom. When I try to execute I get this error: Traceback (most recent call last): File "C:/Users/Vincent/Documents/Programming Tutorials/Python Prog

[Tutor] Use __str__ method for int values

2013-03-10 Thread Vincent Balmori
I am trying to use a __str__ method to display the values of attribute mood = self.hunger + self. boredom. When I try to execute I get this error: Traceback (most recent call last):   File "C:/Users/Vincent/Documents/Programming Tutorials/Python Programming for the Absolute Beginner - Project F

Re: [Tutor] Bar Operator ??

2013-03-10 Thread Alan Gauld
On 10/03/13 01:53, Mathieu Poag wrote: I need some advice. I have been searching throughout the internet > for the beginner's guide to learning Python. I am a little lost. So what did you find? In what way are you lost? The Python web site has two pages for beginners. One for people who can a