or my use case? And can it be written
in such a way that I do not have to edit it when I copy and move the
code to its new location? As I already have these empty __init__.py
files, is there something I can add to these files to solve the
situation and make th
ment variables such as
>
> os.getenv('USER') #-> 'alan'
> os.getenv('HOME') #-> '/home/alan'
>
> the latter being a useful place to look for the
> individual config file... You can use os.environ
&
On Sun, Aug 27, 2017 at 2:13 AM, Cameron Simpson wrote:
> On 26Aug2017 21:27, boB Stepp wrote:
>>
>> I have a project structure where I am developing various programs,
>> some in Pinnacle HotScript language, some in Perl, some in Python,
>> some shell scripts. For t
On Sun, Aug 27, 2017 at 6:03 PM, Cameron Simpson wrote:
> On 27Aug2017 14:27, boB Stepp wrote:
>>
>> On Sun, Aug 27, 2017 at 2:13 AM, Cameron Simpson wrote:
>>>
>>> On 26Aug2017 21:27, boB Stepp wrote:
>>> The trouble with this specific approach
levant background. Perhaps someone might be able to offer
advice that is more tailored to your needs and goals.
And again, welcome! This is a very friendly and helpful place to learn!!
Cheers!
--
boB
___
Tutor maillist - Tutor@pytho
you want.
Another approach you might want to look into is using float(input())
to convert the string resembling a float into a floating point number
and then use the operator "//" (to perform integer division) and then
use that result to extract the decimal portion. You will still have
e the approach to use.
I would create the database, populate it with the needed empty tables
with the desired fields, making it ready to use by the program's user.
Not having any experience in the database arena, I'm not even sure I
know how to properly think about
A further question. Is APSW being maintained solely by a single
person? That is, is it likely to be around for years to come?
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.
On Sep 10, 2017 8:40 AM, "Senthil Kumaran" wrote:
>
> > unindent does not match any outer indention level
>
> Means that your Intendentaion is not proper. You should align your print
> statement and rest to the same level as if statement.
>
> Use a proper editor that supports Python Syntax.
>
Also
alier with how you
re-type code. This lack of attention to seemingly teeny-tiny details
can cause you much grief, such as in your indentation problems.
Whereas a human being can usually easily interpret your intentions,
computers, being extremely literal in their
articular
usage of SQL. So how does one write one's python program to be
DB-agnostic? And if this is impossible, then what is the best way to
structure the overall program to isolate this SQL-specific stuff by
itself, insofar as possible, so any migrations to a
On Tue, Sep 12, 2017 at 2:17 PM, Mats Wichmann wrote:
> On 09/12/2017 01:05 PM, boB Stepp wrote:
>> As I continue to read about SQL, one thing jumps out: There are many
>> differences between how SQL statements are implemented among the
>> different database products. Even
On Tue, Sep 12, 2017 at 8:58 PM, boB Stepp wrote:
> On Tue, Sep 12, 2017 at 2:17 PM, Mats Wichmann wrote:
>> On 09/12/2017 01:05 PM, boB Stepp wrote:
>>> As I continue to read about SQL, one thing jumps out: There are many
>>> differences between how SQL statement
tion character so in some databases
> you use ? and in others its %.
I will try to keep this in the back of my mind ...
Thanks, Alan. This helps a lot!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Wed, Sep 13, 2017 at 2:55 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>>
>> And these would be the SQL commands/statements I would have
>> cursor.execute use from the sqlite3 module. They would be different
>> depending on which database pr
cally you are just
> mapping your logic layer object models to underlying
> data tables.
My initial thoughts here are that typically a particular class would
map to a particular table and that each object instance would
correspond to a row in said table. Is this typically how this is
y stuck in tar
every time the VB abstraction leaks..." That has me wondering: Where
does the Python abstraction leak???
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
move to get proficient in SQL first before going
on to ORMs.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
an early version of
Python 3. Again, I don't think there will be any problems with the
exact version of Python 3 used as long as the version of Pygame is
compatible with the chosen Python.
--
boB
___
Tutor maillist - Tutor@python.
ists like Tutor? I believe
there are some such people on the main list.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Tue, Sep 26, 2017 at 6:22 AM, Albert-Jan Roskam
wrote:
> PS: sorry about the missing quote (>>) markers. Hotmail can't do this. Is
> Gmail better?
Yeah, in Gmail it will handle the quote markers when doing plain text.
--
boB
_
oblem seems to be trivial for *anyone* exposed to the if -
elif - else structure and is aware of the modulus operator. What am I
missing??? How can anyone in any programming language not get this
question right?
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sun, Oct 1, 2017 at 12:32 AM, Steven D'Aprano wrote:
> On Sun, Oct 01, 2017 at 12:09:55AM -0500, boB Stepp wrote:
>
>> If I understand the problem correctly, this gives the desired result.
>> I would have had this in < 30 seconds if I did not stop at each stage
>&g
-- Forwarded message --
From: Howard B
Date: Sun, Oct 1, 2017 at 2:20 PM
Subject: Re: [Tutor] Python programming for the absolute beginner
To: boB Stepp
The 2010 copyright version, ISBN 978-1-4354-5500-9, discusses installing
Python 3.1 (main text on page 5, and Appendix A on
est, I must say I like its simpler ways of doing
things. And I haven't lost anything! It runs all of my existing
unittest code just fine. Thought I would mention this book in case
anyone on the Tutor list has thought about trying pytest, but wanted a
reate my table(s).
BTW, in the docs at https://docs.python.org/3/library/sqlite3.html I
found no mention of the actual exception I caught, "OperationalError".
Should not this be in the docs?
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ently trying to make the following work:
py3: tb_exists = c.execute('select name from sqlite_master where type="table"')
so that I can embed this in an if statement. But it is not behaving
quite like I hope yet. So I am still experimenting and Googling ...
boB
_
On Sat, Oct 14, 2017 at 1:43 AM, boB Stepp wrote:
> I am currently trying to make the following work:
>
> py3: tb_exists = c.execute('select name from sqlite_master where
> type="table"')
>
> so that I can embed this in an if statement. But it is not beha
On Sat, Oct 14, 2017 at 2:11 AM, boB Stepp wrote:
> So I get "None" as a result if the target table has not been created
> yet. But if I *do* create the table I want:
>
> py3: with open('create_sqlite3_db.sql') as f:
> ... sql = f.read()
> ...
> py3:
project.
Should the code so far stay as a function or get incorporated into a
class? My original intent was to do a class for the
BloodPressureReadings table, but I am not at the point of going there
yet.
4) I wish there was a PEP 8 for SQL! I have several SQL books I have
consulted, bu
On Sun, Oct 15, 2017 at 12:07 AM, boB Stepp wrote:
>
> #!/usr/bin/env python3
>
> """This file starts the blood pressure readings program."""
>
> import sqlite
On Sun, Oct 15, 2017 at 3:09 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>
>> I have not used a "finally" block before. I just had the thought that
>> maybe it would run even if an uncaught exception might occur. I tried
>> to test
On Sun, Oct 15, 2017 at 2:56 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>>
>> I am puzzled. If one is using version control, then what is the
>> advantage of this incremental approach in creating and populating the
>> database? Instead, why not
ot;, line 1, in
> from Man import*
> File "/home/chris/scripts/Man.py", line 2
> '''A derived class to define Man properties.'''
> ^
> IndentationError: unexpected indent
So, did you try removing the indentation in front of '''A derived
class ... '''? And once you do, you will get the same error later on
where you did the same thing. Recall that Python uses indentation to
define its code blocks.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
when I have not bothered to set the
path to the Python installation, that using the Python launcher as
follows works:
py -m pip install "pyglet"
Perhaps it will work for you. BTW, are the quotes around pyglet
needed? I don't reca
On Nov 30, 2017 12:56 PM, "Michael Dowell"
wrote:
>
> Hello, I'm trying to code a magic 8-ball program and it needs to include a
> counter for the number of questions asked. I'm having a hard time
> implementing a count, and need a little help. I had tried to implement it
> in the main() function,
On 12/9/2017 2:09 PM, Ayanlade Timilehin via Tutor wrote:
Goodday, I'm a Windows user and I am interested in developing android
applications but I can't find any tutorial resource online. Please how can you
help.
Google "android development tutorial". If you can't find what you are
looking for
composite object, or can outlast that
object, an aggregate relationship makes more sense. Also keep in mind
that composition is aggregation; aggregation is simply a more general
form of composition. Any composite relationship is also an aggregate
relationship, b
ision, etc. Use understandable variable
names. You will probably want to use the math standard library.
Attempt this and if you get into trouble copy and paste both your
actual code you tried to run and any error tracebacks into a plain
text email and we will en
you find works best for how you learn, but whatever you
do, make sure you write and debug code. This is where the real
learning occurs.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
I was wondering if len(a_list) is computed on the fly or is it a
stored attribute of the a_list object? And is the answer the same for
both Python 2 and 3?
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options
2.4 and its
available standard libraries. I cannot use any outside software.
However, I am free to write all the software I might like, assuming I
can find time to do so. What would you sage Pythonistas recommend for
my situation?
--
boB
___
Tutor
y3: os.path.realpath('test_main.py')
'c:\\Projects\\solitaire_scorekeeper\\tests\\test_main.py'
Would someone enlighten me as to why the different results?
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sun, Jan 7, 2018 at 2:05 AM, Steven D'Aprano wrote:
> On Sun, Jan 07, 2018 at 12:49:59AM -0600, boB Stepp wrote:
>
>> Win7, Python 3.6.2
>>
>> If I run a unit test with the following embedded:
>>
>> print('realpath =', os.path.realpath(
path to a real file was implied. Apparently that is not the case. So
Alan's explanation has cleared that up for me (I think!).
I agree with you that the 4th definition you cite:
"4. Mathematics. (of an equation, coordinate, etc.) in simplest or
standard
On Sun, Jan 7, 2018 at 8:32 AM, Alan Gauld via Tutor wrote:
> On 07/01/18 09:07, boB Stepp wrote:
>> clarify this? What is the methodology that os.path.realpath(path) is
>> actually following to yield a particular path name? And why does it
>> not care if path refers
swer to your post last night
took so long to appear on https://mail.python.org/pipermail/tutor that
I finally gave up and went to bed. But it was there when I awoke
today!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subsc
te is optional. So what can I rely on here with
"__file__"? The first sentence of the cited quote is not illuminating
this sufficiently for me.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
=
On Jan 18, 2018 5:45 PM, "Devansh Rastogi" wrote:
>
> Hello,
>
> I'm new to python and programming as
>
> from collections import Counter
> import json
>
I don't see any value for having a class. All you need are functions and
global variables
> class Files:
> def __init__(self, filename):
oth versions 2 and 3) consistent throughout and *always*
returns None?
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Feb 3, 2018 2:09 PM, "Daniel Bosah" wrote:
>
> I'm in a research group for school, and my first task is to learn how to
> make a Python package and to learn how to print out all types of data
> structures. Are there resources I can be pointed to to help me out.
https://python-packaging.readthe
ume a non-newbie level of knowledge).
>
> Any suggestions?
When I was dabbling with Java a few years ago, I found the Beginning
Java Forum at JavaRanch helpful. It can be found at:
https://coderanch.com/f/33/java
--
boB
___
Tutor maillist -
n this article? But I suppose that for third party
libraries anything goes?
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sat, Feb 10, 2018 at 5:34 PM, Alex Kleider wrote:
> On 2018-02-10 01:07, Alan Gauld via Tutor wrote:
>>
>> On 10/02/18 05:44, boB Stepp wrote:
>>>
>>> I have been reading the interesting web page "Semantic Versioning
>
>
> This link may be of
will do our best to help (But we won't do your
homework for you!). But if you instead ask vague questions you are
unlikely to get a helpful response.
Good luck and better thinking!
--
boB
___
Tutor maillist - Tutor@python.org
To unsu
On Feb 23, 2018 3:58 AM, "David Bauer" wrote:
>
> it doesn't work, you are suppsed to declare a function as def func() and
it
> comes back as:
>
> File "", line 1
> def func()
> ^
> SyntaxError: invalid syntax
>
> that is not expected I would also expect def to turn red because it
On Mar 11, 2018 6:25 AM, "Leslie SimondeMontfort via Tutor" <
tutor@python.org> wrote:
>
> Hi, I wondered if there is someone that can help me with this code.
I have to assume that you are very new to python. Have you written a Python
program that runs the way you want it to?
It is often useful t
k:
def calc_pi(loop_value):
pi_approx = 0.0
for k in range(loop_value):
pi_approx += your formula
return pi_approx
print(calc_pi(10))
You actually had all the pieces mentioned. You just need to put them
together, looping just like you would do if you were calculating by
hand
I see I wrote the below a little too quickly! Don't forget to take
the reciprocal when printing. You might want to modify my naming of
variables to reflect this. And return the reciprocal, which actually
gives the pi approximation in the function form.
On Wed, Mar 28, 2018 at 9:08 PM
alled
with pip.
[1] "Automate the Boring Stuff with Python -- Practical Programming
for Total Beginners" by Al Sweigart.
HTH!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
RAM issues as the numbers are
being generated and then outputted one at a time. OTOH, if I created
some kind of display messages function, I don't see how I have gained
anything as these calls to a display message function would just be
taking the place of the print() calls. The end res
then your
error messages suggest you need to install the tkinter stuff from
within that virtual environment using that virtual environment's pip.
Hopefully I am too far off from the truth here, but in any event, I
hope this helps you in your problem!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sun, May 6, 2018 at 5:05 PM, Alan Gauld wrote:
> On 6 May 2018, at 23:00, boB Stepp wrote:
>>My understanding of best practice here is that I should not have any
>>print() calls inside my generate_collatz_sequence() function. I
>>_could_ store the generated sequence in
On Sun, May 6, 2018 at 5:05 PM, Alan Gauld wrote:
> On 6 May 2018, at 23:00, boB Stepp wrote:
>>My understanding of best practice here is that I should not have any
>>print() calls inside my generate_collatz_sequence() function. I
>>_could_ store the generated sequence in
On Mon, May 7, 2018 at 12:26 AM, boB Stepp wrote:
> def get_collatz_number(integer):
> """Returns the Collatz sequence number corresponding to integer. integer
> must be > 0, or the sequence will not converge to 1."""
>
> if integer %
st[i]] += 1
else:
wordset[word_list[i]] = 1
I used "..." to replace much of your code so you can see the needed
indentation levels better.
HTH!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
your string: Replace that symbol with
an empty string.
That might make your code more direct and compact.
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ttata['HP'] >= 1:
> Move = input('What Will You Do? Fight or Run: ')
> if Move == Fight:
> pass
> elif Move == Run: # This appears to be the problem. Make Run into a
> string, "Run" or 'Run'.
> RC = random.randint(1,3)
> if RC == 1 or 3: # This probably does not do what you think it
> does!
> print('You Didn\'t Get Away!')
> else:
> print('You Got Away!')
> break
> else:
> print('Typo')
> break
> Battle()
HTH!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
derstanding.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ist, [1, 2]. Or if it is, then I do not know how to
demonstrate it.
Also the "replication operator" does not seem to be replicating
anything list-wise if it is instead replicating references to the
original list's members.
I request explanation/clarification please.
--
boB
___
The subtleties of the interactions between the concepts of references
to objects, mutable objects, immutable objects, shallow copy of
objects and deep copy of objects continue to surprise me!
On Fri, May 25, 2018 at 1:27 AM, Steven D'Aprano wrote:
> On Thu, May 24, 2018 at 10:33:56PM -0
hile scanning string literal
I am using Python 3.6.5 on Windows 7-64 bit. I was trying to get the
amount of time in minutes the user wanted me to boil the egg in my
"time" variable, but I got the above error. What am I doing wrong?
Do you think you might be abl
itten down."
What is the unwritten twentieth aphorism? If this is a joke or pun,
I'm missing it.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
_easy_ way to do
this upgrade. I would rather delay the learning experience of
compiling Python from source if I can. Is there any _easy_ way to
upgrade the system Python 3.6.5 to 3.6.6 (Without wreaking system-wide
havoc)?
--
boB
___
Tutor maillist
obvious choices:
(1) Just stick with the current system Python 3 until an issue comes
up that 3.6.6 fixes. (2) Wait on the system Python 3 to provide an
update to Python 3.6.6. (3) Install into a virtual environment --
either compiling from source or the PPA route.
Thanks, Jim!
--
boB
.7.8
example:
$ pyenv install 2.7.8
Where and how does it get its Python installation?
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sat, Jul 14, 2018 at 8:43 PM boB Stepp wrote:
>
> On Sat, Jul 14, 2018 at 8:23 PM Mats Wichmann wrote:
> >
> > take a look at pyenv. should make it fairly easy.
> >
> > https://github.com/pyenv/pyenv
>
> This does look interesting. On the linked page, afte
On Sat, Jul 14, 2018 at 11:52 PM boB Stepp wrote:
>
> On Sat, Jul 14, 2018 at 8:43 PM boB Stepp wrote:
> >
> > On Sat, Jul 14, 2018 at 8:23 PM Mats Wichmann wrote:
> > >
> > > take a look at pyenv. should make it fairly easy.
> > >
> > >
On Sun, Jul 15, 2018 at 1:38 AM boB Stepp wrote:
>
> On Sat, Jul 14, 2018 at 11:52 PM boB Stepp wrote:
> >
> > On Sat, Jul 14, 2018 at 8:43 PM boB Stepp wrote:
> > >
> > > On Sat, Jul 14, 2018 at 8:23 PM Mats Wichmann wrote:
> > > >
> >
I would leave it alone.
This is what led me to my question, I could not find a "vetted 3.6.6".
However, I will keep your suggested command in mind for the future.
I have decided I am going to try out Mats' suggestion of pyenv. It
seems clean, flexible, and does not mess wi
I added to the end of my .bashrc:
export PATH="/home/bob/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
This apparently allows pyenv's "shims" to take precedence in the
search path for Python versions. Warning: On the page M
s to me that if type hinting is being used, then the ":type"
info is redundant, so I wonder if special provision is made for
avoiding this redundancy when using type hinting?
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscri
On Fri, Jul 27, 2018 at 12:50 AM Steven D'Aprano wrote:
>
> On Thu, Jul 26, 2018 at 11:34:11PM -0500, boB Stepp wrote:
> > (1) The author claims that reStructuredText is the official Python
> > documentation standard. Is this true? If yes, is this something I
> &g
://www.python.org/dev/peps/pep-0008/
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Wed, Aug 8, 2018 at 8:30 PM boB Stepp wrote:
>
> On Tue, Aug 7, 2018 at 9:13 AM Rafael Knuth wrote:
Curses! Sorry, Chris! This should be:
> > Chris Warrick wrote:
> > > Also, consider using snake_case instead of PascalCase for your
> > > function name, sinc
s to persistently store
these objects on disk upon program closure.
TIA!
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sun, Aug 26, 2018 at 7:48 PM Steven D'Aprano wrote:
>
> On Sun, Aug 26, 2018 at 05:38:52PM -0500, boB Stepp wrote:
>
> > I feel that I may be missing something truly obvious. I am pondering
> > the design of a solitaire scorekeeper program. It is just mea
On Sun, Aug 26, 2018 at 6:10 PM Alan Gauld via Tutor wrote:
>
> On 26/08/18 23:38, boB Stepp wrote:
>
> > class SolitaireGame():
> > def __init__(self, name):
> > self.name = name
>
> > Say I go with the aforementioned game with 13 separate scores
On Mon, Aug 27, 2018 at 3:44 AM Alan Gauld via Tutor wrote:
>
> On 27/08/18 04:58, boB Stepp wrote:
> >> Maybe JSON for that? Or even a shelve database?
> >
> > I plan to keep this simple. I will use a ".cfg" file to store game
> > configuration inform
al tutorial at
https://seaborn.pydata.org/tutorial.html
If the above does not sufficiently help then you will have to provide
additional information as to what exactly you are trying to do, how
are you trying to do it, where are you getting stuck, etc.
HTH!
--
boB
___
in the Solaris environment, I am not allowed to do
so. I am not allowed to use Python pip either. Strange rules ...
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Sep 23, 2018 3:33 AM, "V E G E T A L"
wrote:
>
> Hello folks! So, I'm pretty much a noob still experimenting with basic
> commands. I wanted to make a code that checks if the value of one variable
> is less, equal or greater than the other. Pretty simple right? But then,
> this problem emerged
e most, as the others have said.
--
boB
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On Wed, Oct 10, 2018 at 12:09 PM Mats Wichmann wrote:
> This is actually the concept of test driven development (TDD), which I'm
> not a huge proponent of personally, but kind of useful for this:
I'm curious: What are the things you find less than satisfactory f
suggestions:
1-Use triple-quoted strings:
print """take the
short-cut!""'
2 - make the program much simpler to start with. The usual approach to
developing programs like this is to start simple get the simple things
working right then add more complicated scene descriptions.
Even better: separa
On 10/13/2018 4:25 AM, Mariam Haji wrote:
...
Your problem intrigued me enough to spend some time "fixing" your
program so it will compile with no errors and run at least the initial
case where I entered "shoot!"
Here are the problems I found: (line numbers refer to your original code)
- spell
More comments:
User Friendly?
I hope this game is not intended for actual use. No one will be able to
guess the correct actions in a reasonable time. or 3 digit random code
given 10 tries for any one code. I for one would give up pretty quickly.
The original colossal
The reason I used it here was because the OP was using map (actually
Map). Duh!
Bob
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
More comments on code:
guess = raw_input("[pod #]> ")
if int(guess) != good_pod:
If user enters something that will not convert to integer an exception
will be raised. For example
>>> int('a')
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid literal
the first time on
my new Solitaire Scorekeeper project (Finally getting around to
this!), I got:
bob@Dream-Machine1:~/Projects/solitaire_scorekeeper$ python3 -m unittest
--
Ran 0 tests in 0.000s
OK
So no tests were run. So it i
1901 - 2000 of 2074 matches
Mail list logo