Re: [Tutor] Search for Text in File

2019-08-15 Thread David Rock
result actually is. We also don’t know the context in which the TypeError occurs. Please paste the actual text session showing your interaction with the program _and_ the full traceback so we can see what the TypeError is related to in the code. — D

Re: [Tutor] HELP PLEASE

2019-08-13 Thread David L Neil
On 13/08/19 7:11 AM, Marissa Russo wrote: This is my code: import math def get_numbers(): print("This program will compute the mean and standard deviation") file1 = input("Please enter the first filename: ") file2 = input("Please enter the second filename: ") x = open(file1,

Re: [Tutor] Name for this type of class?

2019-08-03 Thread David L Neil
NB am heading somewhat OT NBB Python3+ On 3/08/19 12:38 PM, Alan Gauld via Tutor wrote: On 03/08/2019 00:47, Malcolm Greene wrote: Anyways, I'm looking for help coming up for the proper name for a class that collects the following type of telemetry data Classes should never be named for the

Re: [Tutor] Python code

2019-08-01 Thread David Rock
maybe a copy/paste of your terminal session so we can see the text of the steps you are actually performing will give use some clues. — David > On Aug 1, 2019, at 18:22, David L Neil wrote: > > On 2/08/19 3:23 AM, Spencer Wannemacher wrote: >> I'm new to python and I was

Re: [Tutor] Python code

2019-08-01 Thread David L Neil
On 2/08/19 3:23 AM, Spencer Wannemacher wrote: I'm new to python and I was trying to perform a simple one code. All that is included in the code is print(61). I save it as 61.py and change the directory before typing in python 61.py and I don't get an output. There is no error and the output i

Re: [Tutor] Inserting long URL's into comments & docstrings?

2019-07-29 Thread David L Neil
On 30/07/19 8:36 AM, James Hartley wrote> On occasion, I put long URL's into comments/docstrings simply to document where I found specific information. However, to be a good disciple of PEP8, anything which can't fit within 72 characters needs to be split across multiple lines. Since a number o

Re: [Tutor] Fw: CSC1010H 4th assignment

2019-07-25 Thread David Rock
in-line in the body of the email if we are going to be able to see it. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] A question about daunting KeyError

2019-07-24 Thread David L Neil
On 24/07/19 3:21 PM, TAISHI KAWAMURA wrote: Hi tutors on Tutor, I'm Taishi from Japan working in a data analytics team. Currently, I'm trying to analyse purchase data of a fashion brand. However, mysterious KeyErrors started occurring continuously when I was coding, and I haven't been able to

Re: [Tutor] Python Generator expressions

2019-07-23 Thread David L Neil
Hi Animesh, Unfortunately the list server/email has removed the formatting from your sample, but no matter... On 24/07/19 5:06 AM, Animesh Bhadra wrote: # This code creates a generator and not a tuple comprehensions. my_square =(num *num fornum inrange(11)) print(my_square) # at 0x7f3c838c0c

Re: [Tutor] Lengthy copyright notices?

2019-07-17 Thread David L Neil
On 18/07/19 10:08 AM, Alan Gauld via Tutor wrote: On 17/07/2019 21:01, David L Neil wrote: One line offers plenty of space to exert a claim (such can be very simple and does not need to be lawyer-speak!) which should also refer to the template's/package's external file or web-page.

Re: [Tutor] Lengthy copyright notices?

2019-07-17 Thread David L Neil
On 16/07/19 12:47 PM, Alan Gauld via Tutor wrote: On 15/07/2019 23:34, Mats Wichmann wrote: Rule #1: it's all opinion in the end... Not quite. Different jurisdictions (remember, this list has an international membership!) have different understandings of (even, respect for) copyrights and p

Re: [Tutor] Reading .csv data vs. reading an array

2019-07-16 Thread David Rock
uirement to know them, but it does get easier with practice. That said, if making a little python one-off filter to do what you need is faster (to write) and works (well enough), it comes down to what your time is worth. — David Rock da...@graniteweb.com _

Re: [Tutor] Lengthy copyright notices?

2019-07-15 Thread David L Neil
On 16/07/19 10:34 AM, Mats Wichmann wrote: On 7/15/19 3:25 PM, James Hartley wrote: help(module_name) will place any text in the *first* module-level docstring into the description section of the help page in Python 3.4.5. Subsequent docstrings found at module level are ignored. I have been us

Re: [Tutor] Fw: [docs] Python Embedding PyImport_ImportModule

2019-07-08 Thread David
On Tue, 9 Jul 2019 at 03:13, Alan Gauld via Tutor wrote: > On 08/07/2019 15:14, Ibarra, Jesse wrote: > > > > I cannot seem to figure this potential bug out. > > Neither can we since we cannot see any code. I'm guessing this might be the original post: https://mail.python.org/pipermail/docs/2019-J

Re: [Tutor] pointers or references to variables or sub-sets of variables query.

2019-07-08 Thread David L Neil
On 8/07/19 10:54 AM, Alan Gauld via Tutor wrote: On 07/07/2019 20:54, David L Neil wrote: (However, some of us grew-up at a time when RAM was expensive and even in our relaxed state, such 'costs' still impinge on our consciousness - Indeed, my first computer was at the local univ

Re: [Tutor] pointers or references to variables or sub-sets of variables query.

2019-07-07 Thread David L Neil
On 8/07/19 2:48 AM, Alan Gauld via Tutor wrote: On 07/07/2019 09:19, David L Neil wrote: First-off, it has to be said that "100's of elements" suggests using an RDBMS - particularly if 'age' (eg 23 and 99) is not the only likely selection mechanism. Multiple selection

Re: [Tutor] pointers or references to variables or sub-sets of variables query.

2019-07-07 Thread David L Neil
First-off, it has to be said that "100's of elements" suggests using an RDBMS - particularly if 'age' (eg 23 and 99) is not the only likely selection mechanism. On 7/07/19 2:39 PM, mhysnm1...@gmail.com wrote: Hi all. In C, you can use pointers to reference variables, arrays, ETC. In python, I

[Tutor] Python 3.7 Grids

2019-06-29 Thread David Merrick
Hi Looking for a way to use the determine the position of a card in a grid using the mouse click event in Python. Code is attached. There are no viruses. Unfortunately using Tinkter grids / frames can't determine between the two demo cards. Any suggestions are welcome -- Dave Merrick TutorInve

[Tutor] Python 3.7 Grids

2019-06-28 Thread David Merrick
Hi Looking for a way to use the determine the position of a card in a grid using the mouse click event in Python. Code is attached. Unfortunately using Tinkter grids / frames can't determine between the two demo cards. The Relevant code is below def showCardInitial(cardList): cardsToPlay = [

[Tutor] Was: Basic Question about Visualization for enduser

2019-06-25 Thread David L Neil
On 26/06/19 4:56 AM, Alan Gauld via Tutor wrote: On 25/06/2019 15:52, Sinardy Xing wrote: My question is, how currently all of this great technology glue together and as a final product for the enduser. Because I cant imagine that we install Anaconda Jupyter Notebook at frontend for the enduser

Re: [Tutor] replacing a loop

2019-06-24 Thread David L Neil
Hi John, On 25/06/19 4:15 AM, johnf wrote: Hi folks, I have the following loop (actually repeated many times ) def locChoices(self):     locDS = self.eslocation.getDataSet()     loc_Choices=['']     locKeys=[0]     for row in locDS:     loc_Choices.append(row['facil

Re: [Tutor] Hii

2019-06-20 Thread David Rock
ways helps along with any error > messages. Also tell us about any 3rd party libraries you are using. Also, what’s the use case? Do you want this to be something that is only capturing keystrokes within the program itself, or do you mean to capture all keystrokes happening regardless of appl

Re: [Tutor] Follow-up on my removing elements from lists question.

2019-06-15 Thread David L Neil
On 15/06/19 9:35 PM, mhysnm1...@gmail.com wrote: This is a follow-up on my previous question for removing elements. Below is the code I am currently using. I am removing the elements at the end of the outer loop. The data structure goes along this: [ ['123123',[2019-2-18', 'transaction text',

Re: [Tutor] Pickles and Shelves Concept

2019-06-07 Thread David Rock
new, the file reads is probably more usable. The shelving of data is most useful for easier retrieval later so you don’t have to re-process the raw data every time. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To un

[Tutor] I'm having a small problem with my code

2019-05-23 Thread David Lifschitz
Hi. I am currently working on a project for myself. The code posted here is supposed to ask the user for an amount of numbers, what those numbers are, and places those numbers in a list. The next job of the code is to sort the list of numbers that were inputted in an ascending fashion. There is no

Re: [Tutor] Looking for some direction

2019-05-18 Thread David L Neil
On 18/05/19 4:15 AM, Alan Gauld via Tutor wrote: On 16/05/2019 04:17, Alex Kleider wrote: Alt-Tab and the X cut 'n paste mechanism provides enough integration between windows. I tried this (Ubuntu 18.4) and Alt-Tab cycles between terminal and browser but I can't make it cycle from one termina

Re: [Tutor] Looking for some direction

2019-05-18 Thread David L Neil
On 13/05/19 6:13 AM, Alan Gauld via Tutor wrote: On 12/05/2019 10:15, David L Neil wrote: Interestingly, I split these into two - my laziness for running/testing is 'Save, Alt-Tab, Up-arrow, Enter' which would be 'ruined' by using the cmdLN for anything else. In a bash sh

Re: [Tutor] Looking for some direction

2019-05-12 Thread David L Neil
On 12/05/19 7:59 PM, Alan Gauld via Tutor wrote: On 12/05/2019 00:24, David L Neil wrote: "3 consoles": what is the purpose of each? (my first reaction stemmed from many editors including a built-in console) One for vim, yes - that 'replaces' the window/app running an

Re: [Tutor] Collating date data from a csv file

2019-05-12 Thread David L Neil
Hi Dave, I also volunteer to do PAT safety testing during my "20% time". Clambering around Snowdonia as a boy, I eschewed* the Rheilffordd yr Wyddfa/SMR in favor of shanks' pony... * OK, I was made to...! For the good of my soul??? On 9/05/19 8:04 AM, Dave Hill wrote: I have a csv file whic

Re: [Tutor] Looking for some direction

2019-05-12 Thread David L Neil
On 12/05/19 10:57 AM, Alan Gauld via Tutor wrote: On 11/05/2019 19:59, Cranky Frankie wrote: ... 1) For the IDE I'm most comfortable with Netbeans/Java, In that case use Netbeans. I use Netbeans myself when working with Java and have played with its Python implementation and its OK. Personall

Re: [Tutor] self.name is calling the __set__ method of another class

2019-04-30 Thread David L Neil
Hi Arup, On 30/04/19 5:55 AM, Arup Rakshit wrote: class NonBlank: def __init__(self, storage_name): self.storage_name = storage_name def __set__(self, instance, value): if not isinstance(value, str): raise TypeError("%r must be of type 'str'" % se

Re: [Tutor] When you think to setup the __class__ of a module object to a subclass of ModuleType

2019-04-28 Thread David
On Sun, 28 Apr 2019 at 02:57, Alan Gauld via Tutor wrote: > On 27/04/2019 01:22, David wrote: > > > It's no big deal, but I wonder why you wouldn't approve an address > > the first time you see that it is being used for legitimate discussion. > > Time... >

Re: [Tutor] When you think to setup the __class__ of a module object to a subclass of ModuleType

2019-04-27 Thread David
On Sat, 27 Apr 2019 at 02:14, Alan Gauld via Tutor wrote: > On 26/04/2019 13:48, Arup Rakshit wrote: > > > BTW, one thing I would like to know about this list is that, everytime I > > send an email I see it the in list after 2 hours approx. Is this for me > > or everybody? I am just curious. > > J

Re: [Tutor] [OT] Problem with auto-complete package installation in Atom [Was: Re: After virtualenv, how to use ide]

2019-03-24 Thread David L Neil
apologize in advance!  But that is okay.  I am not a professional nor expert programmer myself.  Because of this, I recall agonizing over the choice of code editor, or, possibly even worse, deciding whether to use an IDE or editor.  This is a difficult decision about which many wax poetic and expr

Re: [Tutor] Merge a dictionary into a string

2019-03-17 Thread David L Neil
On 18/03/19 6:05 AM, Mats Wichmann wrote: On 3/16/19 11:39 AM, Valerio Pachera wrote: Consider this: import collections d = OrderedDict(a='hallo', b='world') I wish to get a single string like this: 'a "hallo" b "world"' Notice I wish the double quote to be part of the string. In other words I w

Re: [Tutor] how to get the weeks of a month

2019-03-04 Thread David Rock
the output you had, I’d think something was broken because I think in terms of first day being Sunday, so maybe include a note in the output what the First day of the week is if that’s appropriate? — David Rock da...@graniteweb.com ___ Tutor mail

Re: [Tutor] how to get the weeks of a month

2019-03-04 Thread David Rock
, 0, 0, 0, 0, 1, 2] Which I’m sure is just a question of “defining the start of the week” properly, but if you just took it as-is, Mar 1 would be Thursday, not Friday if you translated literally. — David Rock da...@graniteweb.com ___ Tutor mailli

Re: [Tutor] how to get the weeks of a month

2019-03-04 Thread David Rock
r(2019,3) > [[0, 0, 0, 0, 1, 2, 3], [4, 5, 6, 7, 8, 9, 10], [11, 12, 13, 14, 15, 16, > 17], [18, 19, 20, 21, 22, 23, 24], [25, 26, 27, 28, 29, 30, 31]] >>>> > > That looks close to what you want? That seems close, but off by a day? — David Rock da...@graniteweb.com _

Re: [Tutor] systemd

2019-03-03 Thread David Rock
table of what each setting does, to help you pick the best option for your needs. You might also want to set the RestartSec to something other than zero. If you set it to something like 20 seconds, it would also give you time to manually disable the service i

Re: [Tutor] systemd

2019-03-03 Thread David Rock
s. Naming it TestVideo6.py would be less prone to “weird things” happening down the road. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] schedulers

2019-02-28 Thread David Rock
e? How long of a delay before you don’t try to start anymore? What about media resources? How long will you wait if you have tape devices all in use? Is this just a disk-based backup system? Good backup software is not trivial to write. Maybe if we better understood your goals, we could better

Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-20 Thread David
On Thu, 21 Feb 2019 at 14:35, Matthew Polack wrote: > > Just wanted to update this thread regarding a resource for beginning > students. We are now 4 weeks into the course and have found ... Hi Matthew, Thanks for sharing your progress here! I'm very pleased to hear you are finding classroom re

Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread David
On Tue, 5 Feb 2019 at 15:03, David wrote: > > 1) The given title is misleading, in my opinion its subtitle would be much > more > representative: "Enabling students [by] example-driven teaching". Hi again, Sorry for replying to myself, but I want to correct something wr

Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread David
On Tue, 22 Jan 2019 at 20:30, Matthew Polack wrote: > > Hi All, > > In our growing school we're teaching Python programming for the first time > as an elective subject with Year 9 and 10 students. (Had a dabble at this > last year with 3 students in Year 11) Hi Matthew and other readers, I wonde

Re: [Tutor] Implementation of list comparison operators

2019-01-17 Thread David Rock
> On Jan 17, 2019, at 16:13, Peter Otten <__pete...@web.de> wrote: > > David Rock wrote: > >> both a and nan are floats, so why does a == a work, but nan == nan >> doesn’t? > > It does "work", it's only produces a result you didn't expec

Re: [Tutor] Implementation of list comparison operators

2019-01-17 Thread David Rock
> On Jan 17, 2019, at 13:40, Peter Otten <__pete...@web.de> wrote: > > David Rock wrote: > >> >> Isn’t this a bit artificial, though? The reason this is False is because >> you explicitly tell it to return False when using equality. That’s not >&

Re: [Tutor] Implementation of list comparison operators

2019-01-17 Thread David Rock
. >>>> a = A() >>>> a == a > False Isn’t this a bit artificial, though? The reason this is False is because you explicitly tell it to return False when using equality. That’s not the same thing as using __eq__ without over

[Tutor] function question

2019-01-05 Thread David Lynch
n I type return(function) will it rerun the code from the top? I'd appreciate any advice! David Lynch print("Passive income from incentivised onboarding") capital = float(input("Amount of capital raised: ")) amount_invested = float(input("Amount invested: &qu

Re: [Tutor] Defining variable arguments in a function in python

2018-12-31 Thread David Rock
ke a concise, on topic, point would be helpful in this case. When discussions appear to ramble at length in odd tangents, the helpfulness to the beginner is diluted and the original point of the discussion is lost. — David Rock da...@graniteweb.com

Re: [Tutor] Borrowing free code

2018-12-04 Thread David Rock
> On Dec 4, 2018, at 13:31, Avi Gross wrote: > > David, > > What does it mean when someone says they cannot install a module? I can see > how a school assignment might require using only some limited set of > functionality. I note some installations add more t

Re: [Tutor] sftp using subprocess

2018-12-04 Thread David Rock
> On Dec 4, 2018, at 15:37, Alan Gauld via Tutor wrote: > > On 04/12/2018 18:30, David Rock wrote: >> you MUST stop trying to use batch mode, because it will never work. > > But you could presumably use interactive mode via Popen > by taking control of the stdin/out

Re: [Tutor] sftp using subprocess

2018-12-04 Thread David Rock
n the constraints you have proposed up to this point. 1. Can you set up ssh key passwordless authentication? if yes, then do it and what you have now will start working if no, then you can’t use sftp the way you are currently trying (the -b “batch mode”) and find a different solution (expe

Re: [Tutor] sftp using subprocess

2018-12-04 Thread David Rock
>> module . > > That looks like the problem that David already highlighted > with sftp. Yup. So, back to my other question regarding ssh key access… Do you have the ability to ssh to an account on the target system (i.e., use ssh to log in, not use sftp to grab a file)? If you

Re: [Tutor] sftp using subprocess

2018-12-03 Thread David Rock
tive authentication. You would need to set up an ssh key with a null passphrase, or set up an ssh-agent in order for that to work. Another option would be to use pexpect to automate console input — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Moving a conda environment to an off-line computer

2018-12-01 Thread David Rock
tasets in AWS. Unless you can use a web proxy, or possibly get a local mirror of the deepchem.io data on a university system you _can_ reach, this may not be possible to resolve. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@pyt

Re: [Tutor] encoder decoder problem

2018-11-27 Thread David Rock
ve: How would you get input? How would you break up a string into individual characters? How would you break up an encoded string into individual numbers? How would you put the characters/numbers back together for output? Have you started writing any code? What have you tried so far? — Da

Re: [Tutor] A required question

2018-11-23 Thread David Rock
ock and handle exceptions For the OS version, test against os.name or sys.platform The last one, “functionality,” is a bit vague. Probably another candidate for a try block. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] origins bootstrapped.

2018-11-21 Thread David Rock
rcuitpython These have been great to allow people learn not only python, but how to physically interact with the world outside the computer. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change su

Re: [Tutor] Problem using termcolor and colorama

2018-11-15 Thread David Rock
port displaying the colors. If you are trying this in the python interpreter, try making a basic test script and run it instead to see if it works outside the interpreter environment. I assume you are on Windows, too. What OS and what version of Python are you using? — David Rock da...@gr

Re: [Tutor] GPA calculator

2018-11-14 Thread David Rock
d-GPA let us know what you have tried so far and where you get stuck, and we will be better able to help. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread David Rock
on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import netifaces >>> gws = netifaces.gateways() >>> gws {'default': {2: ('192.168.69.1', 'e

Re: [Tutor] Request for help with code

2018-11-06 Thread David Rock
the top, I would suggest looking for a "plain text" selection on a dropdown. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-06 Thread David Rock
7; | cut -d"=" -f3" % (fs)* It’s probably because you have “ characters that are inside “ characters and it can’t tell where the string ends. It looks like you are trying to do cmd = "blkid -o export %s | grep 'TYPE' | cut -d” = " -f3"

Re: [Tutor] Best solution to modifying code within a distributed library

2018-09-19 Thread David Rock
. >> > > You'll want to get the original and work from there. You already know > where it is - you've included the github link. > There’s another option… Ask Adafruit directly. They are amazingly helpful and would be more than happy to hear if there’s a potentia

Re: [Tutor] [OT] Re: Need help in learning Python

2018-08-13 Thread David Rock
some lingering cruft in memory. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help in learning Python

2018-08-12 Thread David Rock
cs.kali.org/downloading/kali-linux-live-usb-install Doing it this way, you get better flexibility with having Kali without [potentially] destroying what’s currently on your system through trying to set up a multi-boot environment. Bite of smaller chunks instead of trying to learn everything at once

Re: [Tutor] Need help combining elements of a list of lists

2018-07-10 Thread David Rock
> On Jul 10, 2018, at 22:04, David Rock wrote: > >> On Jul 10, 2018, at 21:46, Jim wrote: >> >> ltrs = [['A', 'B'], ['C', 'D', 'E'], ['F', 'G', 'H', 'I']] > > A fairly s

Re: [Tutor] Need help combining elements of a list of lists

2018-07-10 Thread David Rock
for j in ltrs[1]: ... for k in ltrs[2]: ... print l,j,k A C F A C G A C H A C I A D F A D G A D H A D I A E F A E G A E H A E I B C F B C G B C H B C I B D F B D G B D H B D I B E F B E G B E H B E I Not the most elegant, but probably the easiest to follow. — David Rock da...@granitewe

Re: [Tutor] CSV Read

2018-06-30 Thread David Rock
every file look the same? is it always a header and data separated by empty lines? Hopefully we will get some feedback. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question about a python finction

2018-05-11 Thread David Rock
t; range(1,5) [1, 2, 3, 4] https://docs.python.org/2/library/functions.html#range — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Sam Kahraman Campus Middle School Advice

2018-04-27 Thread David Wolfe
with your questions and interview, as well as to give you pointers on next steps in learning and proficiency. Good Luck, David On Thu, Apr 26, 2018 at 4:00 PM, Kahraman, Sam K. < skahra...@cherrycreekschools.org> wrote: > Hello, > > I am a 8th grade student at Campus Middle Sch

Re: [Tutor] Beginner Level Projects

2018-04-19 Thread David Rock
nction using text is a pretty complete exercise that might help you visualize problems (and help with you other classes, too). Are you interested in making things move or turning stuff on/off? Using python on a Raspberry Pi is a great way to start with using a computer to control the “real world.

Re: [Tutor] PLEASE HELP

2018-04-13 Thread David Rock
rt separately, and it should be fairly straightforward. Look up methods for parsing formatted strings as a place to start. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with a task

2018-04-12 Thread David Rock
ere you have tried to go. I would also recommend talking to your classmates that are having more success as a first attempt to get some direction. 2 days is not much time for a mailing list to help you understand an unknown assignment. — David Rock da...@graniteweb.com ___

Re: [Tutor] pythonic

2018-04-02 Thread David Rock
ore) pythonic to use the standard libraries. It’s very common in a professional environment to not have access to outside (i.e., internet) resources. I wouldn’t venture into Pypi unless there’s something you can’t do well with what’s already provided by default. — David R

Re: [Tutor] Tutor Digest, Vol 169, Issue 20

2018-03-26 Thread David Brown
7; 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 Topi

[Tutor] Problems with Looping

2018-03-26 Thread David Brown
umber == 4: print("\n", prefix,"You will love the spicy shrimp and garlic.") elif number == 5: print("\n", prefix,"You will meet an old friend soon.") #input("\n\nPress the enter key to get another fortune.") -- *David* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 169, Issue 17

2018-03-23 Thread David Holland via Tutor
- Message: 2 Date: Thu, 22 Mar 2018 18:35:17 +0100 From: Peter Otten <__pete...@web.de> To: tutor@python.org Subject: Re: [Tutor] Oracle forms Message-ID: Content-Type: text/plain; charset="ISO-8859-1" David Holland via Tutor wrote: > Is there anyway I can use Py

[Tutor] Oracle forms

2018-03-22 Thread David Holland via Tutor
Is there anyway I can use Python to fill in an Oracle form rather than typing it in myself.I.e take values from a .csv file and put them into an Oracle form.Any ideas (I have googled it) what libraries to use? ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] PYTHON HELP

2018-03-15 Thread David Rock
Welcome, Your attachments did not come through. This list generally only works with in-line text. If you post your code, what you expect and what the errors are, we will have a better chance of helping. Being a tutor list, help with the selenium framework is not guaranteed, though.

[Tutor] I have a problem with def

2018-02-23 Thread David Bauer
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 is a keyword in Python, but that doesn't happen, anyone else hav

Re: [Tutor] What is day of week from either 20180211 or 02112018

2018-02-06 Thread David Rock
lem. You are importing date _from_ datetime, but then try to call datetime.date > from datetime import date You have _not_ imported date time, so the program doesn’t know what you mean when you say answer = datetime.date(year, month, day).weekday() Try just doing import datetime instead

Re: [Tutor] unable to locate python on mac

2018-01-31 Thread David Rock
ll (i.e., where did you get it from)? Different bundles install differently, so knowing exactly what you downloaded will help identify some of the other questions. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] How to sort float number from big numbers to small numbers?

2017-09-25 Thread David Rock
lly strings, so make sure you are storing them as floats 2. put them in a list. You can then use list built-ins to sort What have you tried so far? Are you trying to start at all, or are you trying things that aren’t working? — David Rock da...

Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread David Rock
me thing about python 3, and that’s not something I’m likely to be able to fix within the bounds of company procedures. So while the original statement is obviously false, the heart of why it was said is functionally true. — David Rock da...@graniteweb.com _

[Tutor] Installing NUMPY

2017-07-28 Thread David Torres
found. Please let me know if we can email each other or call. I would appreciate your help, I am very desperate! Thanks David A. Torres GitHub : https://github.com/dav1dt0rres -Man lives like a robot: mechanically efficient, but with no awareness. Department of Computer Science Departme

Re: [Tutor] Why use main() ?

2017-07-05 Thread David Rock
pts tend to be pretty self-contained and written for my own purposes, so that would rarely be an issue. How would you hide main() if you _were_ concerned about it? -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscri

Re: [Tutor] Why use main() ?

2017-07-05 Thread David Rock
* Alan Gauld via Tutor [2017-07-05 20:36]: > On 05/07/17 16:37, David Rock wrote: > > > This is a question about the benefits of using a main() function vs not. > > > Others have answered for the pros, but I confess that I don't > always use a main(), but

[Tutor] Why use main() ?

2017-07-05 Thread David Rock
f __name__ == '__main__': #code goes here vs def main(): #code goes here if __name__ == '__main__': main() I personally find using main() cumbersome, but many examples I come across use main(). Is there some fundamental benefit to using main() that I&

Re: [Tutor] Fahrenheit to Celsius Conversion another problem and Programming Paradigm

2017-06-15 Thread David Rock
> On Jun 15, 2017, at 13:16, William Gan wrote: > > Hi David, > > Very much thanks for taking time to help. > > Your explanation has helped me understand that syntax issue better. I have > resolved that error. > > Your counsel on the second issue has given me

Re: [Tutor] Fahrenheit to Celsius Conversion another problem and Programming Paradigm

2017-06-14 Thread David Rock
ust keep trying things. When you run into something like this, the most effective way to troubleshoot is narrow it down to the essential issue. In this case, “why is the if statement always evaluating to true?” Look at the parts and re-read what each does (eg, reread how the ‘or’ operator works

Re: [Tutor] Python - help with something most essential

2017-06-05 Thread David Rock
Which reads the entire file into memory. They specifically did not want you to do that. The implication is they were looking for a solution where you read the file maybe one line (or even one word) at a time and look for anagrams in smaller groups. — David ___

Re: [Tutor] Pycharm Edu Lesson 3, Task 7

2017-05-04 Thread David Wolfe
Thanks all for the help. Pycharm just posted an update to their Pycharm Edu product, and when I re-ran the script, everything was fine. Best, David On Tue, May 2, 2017 at 4:27 AM, Alan Gauld via Tutor wrote: > On 02/05/17 01:42, David Wolfe wrote: > > > I'm working through

[Tutor] Pycharm Edu Lesson 3, Task 7

2017-05-02 Thread David Wolfe
p getting the error message "Too short string in the output" Any suggestions? Thanks, David <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com <http://www.avg.com/email-signature

Re: [Tutor] CSV file Reading in python

2017-03-21 Thread David Rock
code and the errors you are getting so we can see what issue you are having. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem on parsing data

2017-03-13 Thread David Rock
> On Mar 13, 2017, at 16:19, jarod_v6--- via Tutor wrote: > > > What can I do for parse better that file and Have only the comma outside the > string ? > I recommend using the cvs module rather than try to write your own. https://docs.python.org/2/library/csv.html

Re: [Tutor] While until the end of a list

2017-03-13 Thread David Rock
ollow what you expect the output to be, though. What do you want the results of running the script to look like? — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
yours: You have a book, towel, shirt, pants, in your luggage. String concatenation with a loop is notorious for adding extra stuff at the end. To get it right, you have to take into account what to do at the end of the list, which adds code complexity. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
e he wasn't looking, and > sneaked in some commas and spaces ;) > > That's cheating... yeah, just a little. :-) You can use join for this: suitcase = ["book", "towel", "shirt", "pants"] output = ', '.join(suitcase) print ("You

Re: [Tutor] Q about .join() Thanks!

2017-02-13 Thread David Rock
e a specific order by design so will always be in the order they were created. What are you trying to do with join() on a dictionary in the first place? Is there a specific outcome you are trying to get? It’s unlikely that using join on a dictionary is what you actually want. — David Rock da...@g

  1   2   3   4   5   6   7   8   9   10   >