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] 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 _

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] 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] 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] 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.

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] 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] 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] 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] 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] 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] 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] 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 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] [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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] sftp using subprocess

2018-12-04 Thread David Rock
ntage to this (and to using expect, for that matter) is plaintext storage of credentials on your system, but it’s pretty simple to use. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

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
> 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] Borrowing free code

2018-12-04 Thread David Rock
r than belabor the point. That said, hopefully we will get some feedback on the OS and ssh setup options. — 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] 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] 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

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
> 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] 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] 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] 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] 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] 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
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] 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

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] 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] 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] 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 trying to perform a si

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

<    1   2