Re: [Tutor] Search for Text in File

2019-08-15 Thread David Rock
y 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. — David Rock da...

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

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
t 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 ___ Tutor

Re: [Tutor] Hii

2019-06-20 Thread David Rock
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 applicati

Re: [Tutor] Pickles and Shelves Concept

2019-06-07 Thread David Rock
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 unsubsc

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

2019-03-04 Thread David Rock
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 maillist

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
9,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
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 if you need

Re: [Tutor] systemd

2019-03-03 Thread David Rock
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
ow 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 dire

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 expect ;) >

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
u 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
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@python.org To unsubscribe or change subscription

Re: [Tutor] encoder decoder problem

2018-11-27 Thread David Rock
reak 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? — David Rock da...@graniteweb.com ___

Re: [Tutor] origins bootstrapped.

2018-11-21 Thread David Rock
.com/circuitpython 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
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...@graniteweb.com ___

Re: [Tutor] GPA calculator

2018-11-14 Thread David Rock
hted-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', 'en0')}, 2: [('192.168.69.1

Re: [Tutor] Request for help with code

2018-11-06 Thread David Rock
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
% (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" % (fs)* which doesn’t make sense. Try using

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

2018-09-19 Thread David Rock
want. >> > > 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 potential issue wi

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
nloading/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 and you will

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 straightforward way is to use nested loops: > >>>> for l in ltrs[0]: > .

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

2018-07-10 Thread David Rock
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...@graniteweb.com ___ Tutor maillist - Tutor@python.

Re: [Tutor] CSV Read

2018-06-30 Thread David Rock
s 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
range(1,5) >>> 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
making a graph of a function 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 t

Re: [Tutor] PLEASE HELP

2018-04-13 Thread David Rock
ts into a specific format Tackle each part 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
but only if we can see where 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. — D

Re: [Tutor] pythonic

2018-04-02 Thread David Rock
es) It’s just as (if not more) 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. — D

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

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

2018-02-06 Thread David Rock
age tells you the problem. 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 imp

Re: [Tutor] unable to locate python on mac

2018-01-31 Thread David Rock
you actually install (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

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

2017-09-25 Thread David Rock
ink about: 1. inputs are usually 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

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

2017-09-03 Thread David Rock
n’t say the same 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
s, my scripts 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 T

Re: [Tutor] Why use main() ?

2017-07-05 Thread David Rock
* Alan Gauld via Tutor <tutor@python.org> [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

[Tutor] Why use main() ?

2017-07-05 Thread David Rock
== '__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'm missing? -- David Rock da

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

2017-06-15 Thread David Rock
sel on the second issue has given me 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 ' + "%.2f" %

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

2017-06-14 Thread David Rock
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). You are doing fine. :-) — David Rock da...@graniteweb.com _

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

Re: [Tutor] CSV file Reading in python

2017-03-21 Thread David Rock
rd, Please post your 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
n.org/2/library/csv.html — 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 until the end of a list

2017-03-13 Thread David Rock
I don’t really follow 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
dding 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
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 have a %s in your luggage

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

2017-02-13 Thread David Rock
ill 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...@graniteweb.com _

Re: [Tutor] (no subject)

2017-02-07 Thread David Rock
p 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
nd 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" fl

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
ta 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 speculate what the best approach would be. -- David Rock da..

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
), 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 with some kind of xml

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
]: 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 at once instead of piecemeal. I can come up wi

Re: [Tutor] Basic telnet question

2016-09-24 Thread David Rock
> On Sep 24, 2016, at 15:49, Phil <phil_...@bigpond.com> 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 d

Re: [Tutor] Basic telnet question

2016-09-24 Thread David Rock
ou don’t see any new data; 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 w

Re: [Tutor] syntax error help

2016-08-26 Thread David Rock
u get (copy and paste the entire 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
ver 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 list of fi

Re: [Tutor] Regex/Raw String confusion

2016-08-03 Thread David Rock
special 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
In some cases, that can be many-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 unsub

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

2016-06-29 Thread David Rock
want to use LVM, 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...@gran

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 <robertvst...@gmail.com> wrote: > > On Wed, Jun 29, 2016 at 12:02 PM, David Rock <da...@graniteweb.com> wrote: >> >>> On Jun 29, 2016, at 11:20, boB Stepp <robertvst...@gmail.com> wrote: >>> >>>

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

2016-06-29 Thread David Rock
d this earlier Which keyboard 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
you value Alan’s opinion (and arguably, your wife’s 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 ___

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

2016-06-28 Thread David Rock
though some advanced features may not 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 hardw

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
actical use that does 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
es? Angry users of pure ASCII > 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

Re: [Tutor] Recommendations for best tool to write/run Python :p:

2016-03-03 Thread David Rock
n is great as an interactive environment 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 e

Re: [Tutor] PLEASE I NEED HELP URGENTLY

2016-01-09 Thread David Rock
ted: TestOutcomeEvent(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

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

2016-01-05 Thread David Rock
r 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 apply the LUN as the value for the key d) when you hit a new mpath line, simply update your LUN value

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

2016-01-04 Thread David Rock
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
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 unsubscribe or change subscription options: https

Re: [Tutor] Pep 8, about indentation

2015-08-10 Thread David Rock
* Alex Kleider aklei...@sonic.net [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 those 4 spaces you just inserted). I

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

2015-05-12 Thread David Rock
where is your list of files coming? Is it truly just read and forget? Your needs will dictate what option is best. It may be what you've already done yourself, it may be fileinput, or it may be something completely different. -- David Rock da...@graniteweb.com

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

2014-10-19 Thread David Rock
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
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
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
: Think about: while something = n: and changing something and retesting. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Help Noob Question

2014-03-28 Thread David Rock
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 maillist - Tutor@python.org

Re: [Tutor] Parse text with python

2013-10-17 Thread David Rock
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

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

2013-06-22 Thread David Rock
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 string? a = '060713' -- David Rock da...@graniteweb.com signature.asc Description: Digital signature ___ Tutor maillist

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

2013-05-09 Thread David Rock
. 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@python.org To unsubscribe or change subscription options: http

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

2013-05-09 Thread David Rock
more of a this is a cool baked-in capability for working with lousy network connections, which you can also do with things like VNC for a remote GUI. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change

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

2013-05-08 Thread David Rock
. I wouldn't like that setup. All options are valid options. Try them all and find what you like. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

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

2013-05-08 Thread David Rock
* Steven D'Aprano st...@pearwood.info [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 was suggested that console apps

Re: [Tutor] Dictionaries and multiple keys/values

2013-03-26 Thread David Rock
['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
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

Re: [Tutor] First Python Test

2013-02-02 Thread David Rock
on 10.6.8 -- 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] Binary/Decimal convertor

2013-01-11 Thread David Rock
thinking about some pseudocode to determine your program's flow and then try to build something to accomplish that. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

Re: [Tutor] how to control putty window

2012-12-20 Thread David Rock
. -- 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] What are all those letters after terminal commands?

2012-08-23 Thread David Rock
and arguments. Options are the switches that change the program's behavior and arguments are the inputs to the program (filenames, etc). -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

  1   2   >