Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2014-12-16 Thread Sunil Bharuchi
I went to the website (www.courseptr.com/downloads) to download the source
code (py3e_source.zip). It's not there. Where can I get it the source code?

-- 
Sunil Bharuchi
sunilkumar.bharuchi@mail.mil
sbharu...@gmail.com
(C) 408.644.7626
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2014-12-16 Thread Alan Gauld

On 16/12/14 04:06, Sunil Bharuchi wrote:

I went to the website (www.courseptr.com/downloads) to download the source
code (py3e_source.zip). It's not there. Where can I get it the source code?



Try using Google with

python absolute beginners source code

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Python 3.4.1 ImportError Linux

2014-12-16 Thread Juan Christian
Python 3.4.1
Fedora 21 Server

My paths:
~/lorem
~/lorem/app
~/lorem/core

I want to execute: ~/lorem/app/main.py

Terminal (~/lorem/app): python3 main.py

Traceback (most recent call last):
File "app/main.py", line 5, in 
from core.backpack import BackpackThread
ImportError: No module named 'core'


Why am I getting this?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python 3.4.1 ImportError Linux

2014-12-16 Thread James Chapman
cd ..

Terminal (~/lorem): python3 app/main.py

import statement is relative to pwd.


--
James

On 16 December 2014 at 14:18, Juan Christian 
wrote:
>
> Python 3.4.1
> Fedora 21 Server
>
> My paths:
> ~/lorem
> ~/lorem/app
> ~/lorem/core
>
> I want to execute: ~/lorem/app/main.py
>
> Terminal (~/lorem/app): python3 main.py
>
> Traceback (most recent call last):
> File "app/main.py", line 5, in 
> from core.backpack import BackpackThread
> ImportError: No module named 'core'
>
>
> Why am I getting this?
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] RESOLVED: Re: Is there an easily or shorter way?

2014-12-16 Thread Ken G.


On 12/15/2014 07:47 PM, Danny Yoo wrote:

Thank you but actually whatever number I get from either 1 to 28,
each number represent a property name such as "Reading Railroad",
"Judy Avenue", "Pacific Gas and Electric", etc., etc.

For example:

if x = 1 then print "Mediterranean Avenue"
if x = 2 then print "Baltic Avenue"


Ah, cool!  Ok, then yes, definitely a list.  There's a sequential-ness
here that we should take advantage of.

PLACES = ["Is-there-a-place-when-x-is-zero?",
   "Mediterranean Avenue",
   "Baltic Avenue",
   ]# and so on ...

print PLACES[x]


so that all the conditioning dissolves into a single list lookup.
There might need to be a few more checks to make sure x is in bounds,
but it's worth it here.

Thank you, thank you. As I think it over through the night, I had a
very faint idea of what you suggested. Again, thank.

Ken

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Is there an easily or shorter way?

2014-12-16 Thread Albert-Jan Roskam
- Original Message -
> From: Danny Yoo 
> To: Ken G. 
> Cc: Python Tutor Mailing List 
> Sent: Monday, December 15, 2014 10:45 PM
> Subject: Re: [Tutor] Is there an easily or shorter way?
> 
>>  As a side note: if we were to talk about how we'd do this in a
>>  professional context, I think we'd recommend a library such as
>>  "humanize", which has functions to go from numbers to 
> human-friendly
>>  string descriptions.
>> 
>> https://pypi.python.org/pypi/humanize
> 
> 
> Whoops: wrong library.  Humanize is a good one, but not exactly the
> one I was supposed to cite.  I should have cited num2words, which is a
> cardinal number library:
> 
> https://pypi.python.org/pypi/num2words

Nice, useful. Humanize seems a better choice because it uses gettext. It is 
probably easier to add another language (like my own, which is not part of the 
package).
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python 3.4.1 ImportError Linux

2014-12-16 Thread James Chapman
> Further to my last email, here's some reading regarding Python Paths
>
>
http://www.stereoplex.com/blog/understanding-imports-and-pythonpath
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 130, Issue 28

2014-12-16 Thread Jim Gallaher

Sunil Bharuchi,

I have that same book so I can answer this question. The code can be found at 
the author's site. programgames.com

> On Dec 16, 2014, at 05:00, tutor-requ...@python.org wrote:
> 
> Send Tutor mailing list submissions to
>tutor@python.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>https://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
>tutor-requ...@python.org
> 
> You can reach the person managing the list at
>tutor-ow...@python.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Is there an easily or shorter way? (Dave Angel)
>   2. Re: program code for Python Programming for the Absolute
>  Beginner, 3rd ed.? (Sunil Bharuchi)
>   3. Re: program code for Python Programming for the Absolute
>  Beginner, 3rd ed.? (Alan Gauld)
> 
> 
> --
> 
> Message: 1
> Date: Mon, 15 Dec 2014 22:50:59 -0500
> From: Dave Angel 
> To: tutor@python.org
> Subject: Re: [Tutor] Is there an easily or shorter way?
> Message-ID: <548fac23.1030...@davea.name>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
>> On 12/15/2014 07:55 PM, Ken G. wrote:
>> 
>> Oh, it is not an assignment, Dave. It is an actual program I am using
>> for my benefit. I had to figure out on a fly, what is the name of a piece
>> of property that each number represent. I had to reckon something out
>> within a limited amount of time I had. Giving the response given here
>> so far, I could go with a list, dictionary or tuple.
> 
> Two other advantages with using a tuple, list or dictionary
> 
> 1) is that you might someday need to do the reverse lookup, changing a 
> string back into the integer.  If you do it from the same data 
> structure, you're more likely to get the transformation to be completely 
> reversible (for valid values).
> 
> 2) You might need to load this table from a file, or otherwise generate 
> or check it on the fly.  Tough to do that with separate function statements.
> 
> -- 
> DaveA
> 
> 
> --
> 
> Message: 2
> Date: Mon, 15 Dec 2014 23:06:06 -0500
> From: Sunil Bharuchi 
> To: tutor@python.org
> Subject: Re: [Tutor] program code for Python Programming for the
>Absolute Beginner, 3rd ed.?
> Message-ID:
>
> Content-Type: text/plain; charset=UTF-8
> 
> I went to the website (www.courseptr.com/downloads) to download the source
> code (py3e_source.zip). It's not there. Where can I get it the source code?
> 
> -- 
> Sunil Bharuchi
> sunilkumar.bharuchi@mail.mil
> sbharu...@gmail.com
> (C) 408.644.7626
> 
> 
> --
> 
> Message: 3
> Date: Tue, 16 Dec 2014 10:39:20 +
> From: Alan Gauld 
> To: tutor@python.org
> Subject: Re: [Tutor] program code for Python Programming for the
>Absolute Beginner, 3rd ed.?
> Message-ID: 
> Content-Type: text/plain; charset=windows-1252; format=flowed
> 
>> On 16/12/14 04:06, Sunil Bharuchi wrote:
>> I went to the website (www.courseptr.com/downloads) to download the source
>> code (py3e_source.zip). It's not there. Where can I get it the source code?
> 
> Try using Google with
> 
> python absolute beginners source code
> 
> -- 
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
> 
> 
> 
> 
> --
> 
> Subject: Digest Footer
> 
> ___
> Tutor maillist  -  Tutor@python.org
> https://mail.python.org/mailman/listinfo/tutor
> 
> 
> --
> 
> End of Tutor Digest, Vol 130, Issue 28
> **
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 130, Issue 28

2014-12-16 Thread Alan Gauld

On 16/12/14 12:16, Jim Gallaher wrote:


Sunil Bharuchi,

I have that same book so I can answer this question. The code can be found at 
the author's site. programgames.com


Thanks for answering the question but please, in future,
provide a meaningful subject line (for archive purposes)
and also delete the contents of the digest that is not
relevant. Some members pay by the byte for their internet
access and others just dislike being sent stuff they
have already seen as members of the list.

Thankyou
--
Alan G
List moderator

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor