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...
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
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
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
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
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
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
, 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
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
__
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
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
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
> 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 ;)
>
> 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
>&
.
>>>> 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
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
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
> 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
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
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
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
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
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
___
.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
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
___
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
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
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
% (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
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
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
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
> 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]:
> .
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.
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
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
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
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
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
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
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
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
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
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
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
___
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
* 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
== '__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
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" %
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
_
> 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
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
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
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
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
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
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
_
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
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
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..
), 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
]:
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
> 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
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
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
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
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
___
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
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
> 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:
>>>
>>>
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
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
___
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
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
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
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
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
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
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
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
_
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
* 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
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
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
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
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
:
Think about:
while something = n:
and changing something and retesting.
--
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
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
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
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
.
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
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
. 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
* 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
['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
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
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
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
.
--
David Rock
da...@graniteweb.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
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 - 100 of 138 matches
Mail list logo