[Tutor] Best way to get root project directory in module search path

2017-08-26 Thread boB Stepp
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

Re: [Tutor] How to use subprocess module to get current logged in user?

2017-08-26 Thread boB Stepp
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 &

Re: [Tutor] Best way to get root project directory in module search path

2017-08-27 Thread boB Stepp
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

Re: [Tutor] Best way to get root project directory in module search path

2017-08-28 Thread boB Stepp
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

Re: [Tutor] New to Python

2017-09-07 Thread boB Stepp
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

Re: [Tutor] Help

2017-09-07 Thread boB Stepp
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

[Tutor] How is database creation normally handled?

2017-09-09 Thread boB Stepp
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

[Tutor] Standard module sqlite3 or APSW?

2017-09-09 Thread boB Stepp
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.

Re: [Tutor] beginning to code

2017-09-10 Thread Bob Gailer
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

Re: [Tutor] beginning to code

2017-09-10 Thread boB Stepp
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

[Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-12 Thread boB Stepp
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

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-12 Thread boB Stepp
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

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-12 Thread boB Stepp
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

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-13 Thread boB Stepp
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

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-13 Thread boB Stepp
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

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-13 Thread boB Stepp
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

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-15 Thread boB Stepp
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

Re: [Tutor] How to write database-agnostic python code? (Is this even possible?)

2017-09-15 Thread boB Stepp
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

Re: [Tutor] Python programming for the absolute beginner

2017-09-30 Thread boB Stepp
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.

Re: [Tutor] OT: how to best follow the posting style on this list

2017-09-30 Thread boB Stepp
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

Re: [Tutor] logging to cmd.exe

2017-09-30 Thread boB Stepp
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 _

[Tutor] Am I missing something obvious about "FizzBuzz"?

2017-09-30 Thread boB Stepp
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

Re: [Tutor] Am I missing something obvious about "FizzBuzz"?

2017-09-30 Thread boB Stepp
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

[Tutor] Fwd: Python programming for the absolute beginner

2017-10-01 Thread boB Stepp
-- 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

[Tutor] OT: New book on pytest

2017-10-13 Thread boB Stepp
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

[Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-13 Thread boB Stepp
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

Re: [Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-13 Thread boB Stepp
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 _

Re: [Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-14 Thread boB Stepp
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

Re: [Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-14 Thread boB Stepp
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:

Re: [Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-14 Thread boB Stepp
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

Re: [Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-14 Thread boB Stepp
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

Re: [Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-15 Thread boB Stepp
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

Re: [Tutor] How to test for the existence of a table in a sqlite3 db?

2017-10-15 Thread boB Stepp
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

Re: [Tutor] problem with program in python in easy steps

2017-10-26 Thread boB Stepp
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

Re: [Tutor] FW: confused about Pypi

2017-10-29 Thread boB Stepp
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

Re: [Tutor] Counting iterations of a function

2017-11-30 Thread Bob Gailer
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,

Re: [Tutor] application development

2017-12-09 Thread bob gailer
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

Re: [Tutor] Aggregation vs Composition

2017-12-10 Thread boB Stepp
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

Re: [Tutor] Code

2017-12-19 Thread boB Stepp
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

[Tutor] Finding written and video tutorials for Python [Was: IDLE]

2017-12-31 Thread boB Stepp
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

[Tutor] Is len(a_list) a computed value or a stored attribute of a_list?

2017-12-31 Thread boB Stepp
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

[Tutor] How to handle passwords in programs that perform FTP processes?

2018-01-03 Thread boB Stepp
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

[Tutor] Why does os.path.realpath('test_main.py') give different results for unittest than for testing statement in interpreter?

2018-01-06 Thread boB Stepp
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

Re: [Tutor] Why does os.path.realpath('test_main.py') give different results for unittest than for testing statement in interpreter?

2018-01-07 Thread boB Stepp
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(&#

Re: [Tutor] Why does os.path.realpath('test_main.py') give different results for unittest than for testing statement in interpreter?

2018-01-07 Thread boB Stepp
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

Re: [Tutor] Why does os.path.realpath('test_main.py') give different results for unittest than for testing statement in interpreter?

2018-01-07 Thread boB Stepp
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

Re: [Tutor] Testing

2018-01-07 Thread boB Stepp
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

[Tutor] When is and isn't "__file__" set?

2018-01-10 Thread boB Stepp
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:

Re: [Tutor] Writing to a file

2018-01-19 Thread Bob Gailer
= 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):

[Tutor] Do _all_ Python builtin methods/functions return "None" IF ...

2018-01-26 Thread boB Stepp
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

Re: [Tutor] Data Structures printing and Python Package creation

2018-02-03 Thread Bob Gailer
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

Re: [Tutor] Java equivalent of Python-Tutor?

2018-02-07 Thread boB Stepp
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 -

[Tutor] Does Python and its standard libraries use semantic versioning?

2018-02-09 Thread boB Stepp
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

Re: [Tutor] Does Python and its standard libraries use semantic versioning?

2018-02-10 Thread boB Stepp
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

Re: [Tutor] Pong using python

2018-02-13 Thread boB Stepp
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

Re: [Tutor] I have a problem with def

2018-02-23 Thread Bob Gailer
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

Re: [Tutor] help with code

2018-03-11 Thread Bob Gailer
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

Re: [Tutor] Pi approximation

2018-03-28 Thread boB Stepp
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

Re: [Tutor] Pi approximation

2018-03-28 Thread boB Stepp
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

Re: [Tutor] Extract main text from HTML document

2018-05-05 Thread boB Stepp
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

[Tutor] How to separate UI code from program logic?

2018-05-06 Thread boB Stepp
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

Re: [Tutor] Need help with a virtual environment mess

2018-05-06 Thread boB Stepp
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

Re: [Tutor] How to separate UI code from program logic?

2018-05-06 Thread boB Stepp
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

Re: [Tutor] How to separate UI code from program logic?

2018-05-06 Thread boB Stepp
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

Re: [Tutor] How to separate UI code from program logic?

2018-05-08 Thread boB Stepp
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 %

Re: [Tutor] Iteration issues

2018-05-10 Thread boB Stepp
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

Re: [Tutor] Iteration issues

2018-05-10 Thread boB Stepp
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

Re: [Tutor] Help

2018-05-15 Thread boB Stepp
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

Re: [Tutor] Help

2018-05-15 Thread boB Stepp
derstanding. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Nested use of replication operator on lists

2018-05-24 Thread boB Stepp
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 ___

Re: [Tutor] Nested use of replication operator on lists

2018-05-25 Thread boB Stepp
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

Re: [Tutor] egg timer

2018-06-24 Thread boB Stepp
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

Re: [Tutor] learn python to build payment processor

2018-07-11 Thread boB Stepp
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

[Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-14 Thread boB Stepp
_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

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-14 Thread boB Stepp
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

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-14 Thread boB Stepp
.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

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-14 Thread boB Stepp
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

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-14 Thread boB Stepp
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. > > > > > >

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-14 Thread boB Stepp
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: > > > > > >

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-15 Thread boB Stepp
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

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-15 Thread boB Stepp
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

[Tutor] Questions about the formatting of docstrings

2018-07-26 Thread boB Stepp
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

Re: [Tutor] Questions about the formatting of docstrings

2018-07-27 Thread boB Stepp
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

Re: [Tutor] How to write a function which reads files

2018-08-08 Thread boB Stepp
://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

Re: [Tutor] How to write a function which reads files

2018-08-08 Thread boB Stepp
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

[Tutor] How to have unique identifiers for multiple object instances of a given class?

2018-08-26 Thread boB Stepp
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

Re: [Tutor] How to have unique identifiers for multiple object instances of a given class?

2018-08-26 Thread boB Stepp
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

Re: [Tutor] How to have unique identifiers for multiple object instances of a given class?

2018-08-26 Thread boB Stepp
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

Re: [Tutor] How to have unique identifiers for multiple object instances of a given class?

2018-08-27 Thread boB Stepp
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

Re: [Tutor] Contour Plots

2018-08-28 Thread boB Stepp
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 ___

[Tutor] OT: How to automate the setting of file permissions for all files in a collection of programs?

2018-08-29 Thread boB Stepp
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

Re: [Tutor] Python programming help!

2018-09-23 Thread Bob Gailer
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

Re: [Tutor] Advanced python recommendations

2018-10-09 Thread boB Stepp
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

Re: [Tutor] Advanced python recommendations

2018-10-10 Thread boB Stepp
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

Re: [Tutor] python game error

2018-10-13 Thread Bob Gailer
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

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
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

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
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

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
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

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
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

[Tutor] When are "__init__.py" files needed and not needed in a project?

2018-10-20 Thread boB Stepp
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

<    15   16   17   18   19   20   21   >