Brandon Dorsey | 19 Dec 03:09 2014
Picon

Learning to program, not code.

Hello All,

Programming has always been a passion of mine, however, I'm frequently
frustrated at

simple fact that I've been learning python for 8 months, and I have yet to
start, and finish, a simple

project.  I find difficult to not only visualize the execution, but to
figure out when and where to

use data structure 'x'.    Any suggestions on how to approach programming
from a different angle?
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Abdullahi Farah Mohamud | 18 Dec 22:10 2014
Picon

(no subject)

hello i need help with a program and i dont understand what is wrong
it is a lottery ticket generator.
the problem is:
when the computers asks the user if he would like to go again and the user says yes, it asks for the number of
lines and then if the user clicks 3 it will only give me one line.
here is the code
appreciate if you could help

import random
abz = 0
lines = int(input('How many lines would you like?'))
loop = lines
if lines >7:
    print('Too many lines saaxib')
    exit()
else:
    print()
while lines != 0:
    line1 = random.randint (1,7)
    line2 = random.randint (8,14)
    line3 = random.randint (15,21)
    line4 = random.randint (22,28)
    line5 = random.randint (29,35)
    line6 = random.randint (36,42)
    line7 = random.randint (43,49)
    lines = lines - 1
    print(line1, line2, line3, line4, line5, line6,line7)
while abz == 0:
    again = input('Would you like to go again?')
    if again == 'yes':
(Continue reading)

Jim Gallaher | 16 Dec 13:16 2014
Picon

Re: Tutor Digest, Vol 130, Issue 28


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-request <at> python.org wrote:
> 
> Send Tutor mailing list submissions to
>    tutor <at> 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-request <at> python.org
> 
> You can reach the person managing the list at
>    tutor-owner <at> 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)
> 
(Continue reading)

Juan Christian | 16 Dec 15:18 2014
Picon

Python 3.4.1 ImportError Linux

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 <module>
from core.backpack import BackpackThread
ImportError: No module named 'core'

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

Sunil Bharuchi | 16 Dec 05:06 2014
Picon

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

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.mil <at> mail.mil
sbharuchi <at> gmail.com
(C) 408.644.7626
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Ken G. | 15 Dec 22:25 2014
Picon

Is there an easily or shorter way?

I am sure there is a better way to refine the following lines.

Letting x equal a number from 1 to 28, go through 28 separate 'if'
statements to print a resulting value that equaled the value of x.

For example:

x = 8

if x = 1, print 'one'
if x = 2, print 'two'
...
...
if x = 8, print 'eight'
...
...
if x = 28, print 'twenty eight'

Would a single line using list or dictionary be shorter?

Thanks,

Ken

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

(Continue reading)

Pi Po | 14 Dec 20:29 2014
Picon

looking for a Python feature for computer teaching

As a teacher I find python simple and effective.

However, appreciate feedback from anyone who knows
of a Python version with this feature:

Want each interpreted line of code to introduce as a cells on
a spreadsheet window each new variable (or array) with its initialized
value,
and show the updated contents of each previously defined variable (or
array).

As a student types in a  line of code they will see how that
line  impacts old data and introduces new data.

This can now be done manually on a blackboard but is slow and tedious.

Here are two simple spreadsheets that show how it
might look for a student to step through their code:

https://docs.google.com/spreadsheets/d/1FkyzsT4VcGf9APE4IgHEYl4f6EI3C_DdUi_oD9K9shU/edit?usp=sharing

https://docs.google.com/spreadsheets/d/1mxIlScRBUa0Qtxg0G65Pw4FupeuDTDXQQbvpON7EH5M/edit?usp=sharing

If anyone knows another language (assembler, forth, C, J, ...)   which
already has this feature, appreciate a link.

But as syntax of Python is relatively clean and suited for instruction,
much prefer something in Python.

Cam Trenor
(Continue reading)

Luis San Martin | 12 Dec 15:20 2014
Picon

about multiprocessing performance

Dear fellows,

I'm learning about on multiprocessing module on python. So far I've enjoyed
it though regarding performance I got some doubts. There is not that much
difference[0] when running it on Mac OS X on the contrary to Linux.

[0] http://codepad.org/lNDHNhof

Kind regards
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Jagannath Ramanan | 12 Dec 13:46 2014
Picon

Need help!

Dear Sir / Madam,

My name is jag. I need little bit of help understanding something. I have a
vncserver running at the background in redhat. My client is lubuntu where
im using python.

For some reason the communication is only possible between them is to send
custom TCP/IP messages. Im not a hardcore developers. I can do scripts and
i have used gtk python for front ends etc.

*The TCP /IP message length is:*

TCP/IP: 37 bytes of message + 16 bytes of header = 53 bytes Raw Serial: 37
bytes message + 16 bytes of header + 2 bytes of trailer = 55 bytes
I have no idea how i would code something like that in python to make it
talk to the server.

Any any help or guidance is sincerely appreciated.

Thanks in advance!!

  Sincerely,
Jagannath Ramanan,
Software Tester
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

(Continue reading)

Galen Seilis | 11 Dec 21:25 2014
Picon

Parsing JSON with Python

To whom it may concern,

I am having difficulty interacting with JSON. The example below if a
typical input and output:

*import json*
*array = json.load( { "name": "Joe", "address": "111 Street" } )*

*Traceback (most recent call last): File "<stdin>" , line 1, in <module>
File "C:\Python27\lib\json\__init__.py" , line 286, in load return
loads(fp.read(), AttributeError: 'dict' object has no attribute 'read' >>>*

I would appreciate assitance understanding why this doesn't work, and how I
can get up-and-running with inputing JSON code into Python.
--

-- 
Galen
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Matthew Nappi | 11 Dec 05:20 2014

While Loop Help

Hello All:

I am working on the challenges from “Python Programming for the Absolute
Beginner” Chapter 3.  I am asked to modify the original code pasted below
to limit the number of guesses a player has to guess the number.  I did so
(code pasted below); however if a player guesses the right number they
still receive an ending message indicating that they failed.  How can I
modify the code without using any advanced techniques to have a different
message in the event of a successful guess?  Thanks in advance!

*Original Code:*

# Guess My Number

#

# The computer picks a random number between 1 and 100

# The player tries to guess it and the computer lets

# the player know if the guess is too high, too low

# or right on the money

import random

print("\tWelcome to 'Guess My Number'!")

print("\nI'm thinking of a number between 1 and 100.")

(Continue reading)


Gmane