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

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

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
encouragement. Thank you. I’m glad it helped. For completeness, in case you didn’t notice, your elif statement has the same issue. elif unit == 'F' or 'f’: c = (temp - 32) * 5 / 9 print(str(temp) + ' F is equivalent to ' +

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
> On Jun 5, 2017, at 09:36, Schtvveer Schvrveve wrote: > > > And I was rejected. I just wish to understand what I could have done for > this to be better? > > I am a Python beginner, so I'm sure there are things I don't know, but I > was a bit surprised at the abruptness of the rejection and I

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

Re: [Tutor] (no subject)

2017-02-07 Thread David Rock
while loop is testing for r, p, and s to all be equal to each other and set, which is not what you want to test. Basically, your while loop is immediately false as soon as you run your script. You need to rework your logic to test the player’s value. — 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] formatting xml (again)

2016-12-27 Thread David Rock
ml doesn't care about layout and whitespace etc. > > Which xml parser are you using - I assume you are not trying > to parse it manually using regex or string methjods - that's > rarely a good idea for xml. Yeah, since everything appears to be .., the "event" flags of [\

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
ter). That would artificially create "record" data that you could manipulate and combine partial segments into complete xml records to parse. Might be faster, might not, probably would get complicated pretty quickly but could be an option. Without seeing actual data, it's tough to spec

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
stx and etx (comment lines, other data that you don't want), then it gets a lot harder. If you don't have at least a marginally consistent input, your only real option is probably going to be scanning by character and looking for the \x02 and \x03 to get a glob of data, then parse that glob

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
in f1: if between [x02] and [x03]: output =+ line.strip() else: f2.write(output) output = "" Basically, you need to loop over everything between your markers and put them in a single entry, then send that one entry all

Re: [Tutor] Basic telnet question solved

2016-09-25 Thread David Rock
> On Sep 24, 2016, at 18:59, Phil wrote: > > On 25/09/16 07:17, David Rock wrote: >> header = tn.read_until("character is '^]’.”, timeout=5) >> print(header) > > Thank you David, read_until() led me to a result. It seems that the telnetlib > doesn'

Re: [Tutor] Basic telnet question

2016-09-24 Thread David Rock
> On Sep 24, 2016, at 15:49, Phil wrote: > > On 25/09/16 01:01, David Rock wrote: >> >> when you say "the client is not responding, certainly not as expected”, >> what, exactly, is the output you get? >> > > In my dazed state I think I responde

Re: [Tutor] Basic telnet question

2016-09-24 Thread David Rock
; it’s still trying to read everything until it times out. either add a short timeout value to your telnetlib.Telnet(), or try a different read method; for example, read_very_eager you could also try using telnetlib.set_debuglevel() to try and get more details about what’s actually

Re: [Tutor] syntax error help

2016-08-26 Thread David Rock
e thing, please)? Where does it say the syntax error is? — 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] Downloading Slack Files

2016-08-16 Thread David Rock
r stops is because this test is never true: >if len(response.json()["files"]) == 0: >break Since you are downloading and not removing anything, there’s always going to be files so you will never break out of the while loop. I think you need to get the lis

Re: [Tutor] Regex/Raw String confusion

2016-08-03 Thread David Rock
al sequences in the documentation). For example, \s means any whitespace character, \w means any alphanumeric or underscore, \d means any digit, etc. You can look them up in the docs: https://docs.python.org/2/library/re.html — David Rock da...@graniteweb.com ___

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
-many packages depending on the complexity. All you need to worry about is the thing you want, and let the system do the rest. :-) — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription o

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
say yes. It adds a layer of flexibility with you disk layout that you will be sad you don’t have later. > Thanks for all of the help even though this has been off-topic for this list! > > Meanwhile, more playing around with Mint!! have fun! — David Rock da...@graniteweb.com

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
> On Jun 29, 2016, at 12:32, boB Stepp wrote: > > On Wed, Jun 29, 2016 at 12:02 PM, David Rock wrote: >> >>> On Jun 29, 2016, at 11:20, boB Stepp wrote: >>> >>> My Christmas present of a Corsair mechanical gaming keyboard was not >>> _seen

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
ard do you have? Most Corsairs have a “BIOS switch” for exactly this issue. — 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] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread David Rock
is more important), try out Mint. You may or may not like it, but you won’t know until you try. I still say a dry run in a VM to get a feel for it would do wonders for you regardless. — David Rock da...@graniteweb.com ___ Tutor maillist - Tuto

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread David Rock
t be. The easiest thing to do is google for your distro name and the brand of device and see if there are any issues. If you follow my earlier advice on trying a liveCD of your chosen distro first, that will give you a really good idea if your hardware will work. — Davi

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread David Rock
herry-pick packages from testing; that’s a little advanced (but something to keep in mind). — 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] Study Tips

2016-05-30 Thread David Rock
oes something for you, it will be more satisfying and more likely to stick in your brain. -- 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] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-12 Thread David Rock
SCII > terminals? ~(:>) I'm using mutt in a screen session on raspbian. Looks fine to me. I have put a lot of effort into "properly" displaying "weird" things, though. -- 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] Recommendations for best tool to write/run Python :p:

2016-03-03 Thread David Rock
vironment but the OP > specifically mentioned writing longer programs and editing > files which is not what IPython does best. I suspect that's > why it didn't get a mention earlier. Very likely, but it's definitely worth mentioning as a runtime environmen

Re: [Tutor] PLEASE I NEED HELP URGENTLY

2016-01-09 Thread David Rock
comeEvent(handled=False, test=, > result=, outcome='error', exc_info=(, TypeError('this constructor takes no > arguments',), ), reason=None, expected=False, shortLabel=None, > longLabel=None) is not JSON serializable This doesn't appear to be all of your code. What&#

Re: [Tutor] how to grep a word and make a dictionary from multiple lines.

2016-01-05 Thread David Rock
path" 2. looking up by value would work, but maybe you should do it the other direction. Your SCSI values will be unique, so use that as the key a "simpler" logic is probably: a) read file b) store the LUN value from your mpath line c) iterate over lines and find SCSI key, then

Re: [Tutor] how to grep a word and make a dictionary from multiple lines.

2016-01-04 Thread David Rock
ay to break out of your logic when the next mpath is seen. You will also want to think about what to do with all your LUNs. You have four per mpath, not one. Do you want to capture only one, or do you need all of them? -- David Rock da...@graniteweb.com

Re: [Tutor] Pep 8, about indentation

2015-08-10 Thread David Rock
* Alex Kleider [2015-08-10 11:26]: > On 2015-08-10 08:33, David Rock wrote: > > > You might want to add softtabstop as well. > > set softtabstop=4 > > > > It's very handy for allowing the delete key to go back TAB number of > > spaces (ie, deletes thos

Re: [Tutor] Pep 8, about indentation

2015-08-10 Thread David Rock
p as well. set softtabstop=4 It's very handy for allowing the delete key to go back TAB number of spaces (ie, deletes those 4 spaces you just inserted). -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] reading lines from a list of files

2015-05-12 Thread David Rock
ile reader, plus a host of other useful methods for info about the file you are reading. Part of what you really need to define is the context of your question of "better." What is your use case? From where is your list of files coming? Is it truly just "read and forget"? Your

Re: [Tutor] A question about using stdin/out/err vs named files

2014-10-19 Thread David Rock
nput(). A single file name is also allowed." It gives a fairly clean way to just "do the Right Thing" whether you are feeding files, or reading from stdin. -- 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 all text that begins with "25"

2014-10-02 Thread David Rock
ch would be to change the command you are running. I've never heard of hamachi list before; does it have any commandline options to display only IP addresses? -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Question about O(N**2)

2014-05-03 Thread David Rock
#x27;, 'ignore').strip()] is an O(N**2)? 2. How do you know that fullPath.append(line.decode('utf-8', 'ignore').strip()) is not? -- 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] while loop

2014-03-31 Thread David Rock
So, instead of while n <= 10: Think about: while something <= n: and changing something and retesting. -- David Rock da...@graniteweb.com __

Re: [Tutor] Help Noob Question

2014-03-28 Thread David Rock
he merits of one place over the other, just that simple organization is a good thing. Put it wherever you want, but at least keep it organized. Dropping everything in Desktop is not organized. -- David Rock da...@graniteweb.com ___ Tutor maill

Re: [Tutor] help (Splitting a word into letters)

2014-03-18 Thread David Rock
ne 1, in IndexError: string index out of range >>> Can you be a little clearer what you need? Are you looking to store them in variables, an array, print them? If printing them, are you looking to output one per line, or spaced out? -- David Rock da...@graniteweb.com

Re: [Tutor] Parse text with python

2013-10-17 Thread David Rock
: INUSE field may be empty, so you will grab the wrong value 1700 might be somewhere other than where you expect it etc -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mai

Re: [Tutor] How convert an int to a string

2013-06-22 Thread David Rock
thought str() would do it but it didn't. Reading about str() it talks of > string representation. So how can I convert it to a true string I can > slice and build my date look a like? Is there a requirement to store them as numbers in the first place? Why not just store them as a st

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-09 Thread David Rock
* Alan Gauld [2013-05-09 16:50]: > On 09/05/13 15:42, David Rock wrote: > > >> Or use emacs... :-) > > > > There's always one. You aren't helping the case for console apps with > > that one at all. :-) > > But then emacs can also be considered

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-09 Thread David Rock
moment. Yes, the disconnect/reconnect is nice (I use it a lot). It's not exactly relevant to merits of console interfaces vs GUI, though. That's more of a "this is a cool baked-in capability for working with lousy network connections", which you can also do with things like V

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-09 Thread David Rock
ich again, works well, but is not necessarily intuitive. > Or use emacs... :-) There's always one. You aren't helping the case for console apps with that one at all. :-) -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@p

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-08 Thread David Rock
* Steven D'Aprano [2013-05-09 10:29]: > On 09/05/13 02:57, David Rock wrote: > > > > Well, not to start a flame war, but that is all subjective. > > Did I say otherwise? I was very careful to say "more natural FOR ME, > faster FOR ME". Not at all, but it w

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-08 Thread David Rock
So it's really more about personal taste than anything. If you _like_ what you are using, that's fine. I wouldn't like that setup. All options are valid options. Try them all and find what you like. -- David Rock da...@graniteweb.com _

Re: [Tutor] Dictionaries and multiple keys/values

2013-03-26 Thread David Rock
x27;) >>> data ['French'] Then just put the list as the value. d['characteristics'] = data >>> data = 'Canadian, Pub Food'.split(',') >>> d['characteristics'] = data >>> d['characteristics'] ['Canadian', ' Pub Food'] -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] First Python Test

2013-02-04 Thread David Rock
oogling for "cocoa emacs" returns: http://emacsformacosx.com/ Perhaps that will work for you. I've tested that it works on my system, at least ("works" = it ran). -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

  1   2   >