Hello Tutor,
I am having trouble finding a python 3.7.2 download for my MacOS Mojave
10.14.3 released mid 2014.
I would like to use Xcode to learn python.
Is my OS too old?
Please provide guidance.
Thanks.
___
Tutor maillist - Tutor@python.org
To un
Would this meet the requirements?
merged_list = list1.extend(list2).sort()
On Mar 4, 2016 3:34 PM, "Danny Yoo" wrote:
> > As we can see, we have to do a lot more consideration of what state
> > our values are in, due to all the mutation happening. It also shows
> > that the second recursive cal
it to play back the inverse of the array for a noise cancelling affect. Any
ideas would be great.
Thanks,
Robert
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
I like to use paramiko for these types of things. Of course I don't have
all the details but from the info you have provided it seems like you
should be able to do this with ansible itself.
Regards,
Robert
___
Tutor maillist - Tutor@python.o
To elaborate a little more this is comparing the 'one' bit. Any odd number
will have the 'one' bit set.
On Oct 14, 2015 6:30 PM, "Joel Goldstick" wrote:
> On Wed, Oct 14, 2015 at 4:47 PM, ਨਿਹੰਗ ਪੰਜਾਬੀ wrote:
>
> > 'if (n & 1)' below works but I don't understand why/how. Kindly help.
> >
> > =
I may be mistaken, but it looks like you are trying to open the socket on
port 2021. Standard ftp uses 21. Is the server listening on 2021?
On Sep 11, 2015 5:29 PM, "Martin A. Brown" wrote:
>
> Hi there Richard,
>
> Strictly speaking, it's no Python question, but... good ol' FTP.
>
> socket.error
cool, thanks guys :)
-Robert
On Thu, Oct 30, 2014 at 7:24 PM, Danny Yoo wrote:
>
>
> On Thu Oct 30 2014 at 7:58:32 AM Lukas Nemec wrote:
>
>> Hello,
>>
>> take a look at argparse library.
>>
>
>
> Hi Robert,
>
> As Lukas mentions, it sounds
in advance!
-Robert
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
here is probably a
better/more pythonic way to accomplish the same thing.
One thing to keep in mind is that the number of items in each list
will always be the same, ie... if list1, list2, list4 have 4 items
each, there will be 4 lists in list3.
Any advice would be
le. I have it working
now.
Bob
-Original Message-
From: Prasad, Ramit [mailto:ramit.pra...@jpmorgan.com]
Sent: Tuesday, September 24, 2013 6:23 PM
To: Treder, Robert (Research); tutor@python.org
Subject: RE: How to create dictionaries loadable with import
Treder, Robert wrote:
> H
Hi Python tutors,
I'm fairly new to Python. I'm working with Python v2.7.4 and the nltk package
on a couple of text mining projects. I create several dictionaries that are
pretty static. Will probably only be updated every or month or every couple of
months. I want to turn those dictionaries
Thanks to the OSA library, which works for SOAP requests with Python
3.x, I can now use SOAP services at http://www.chemspider.com.
The result is a list of accession numbers (which correspond to chemical
compounds) and I get them in the following format:
|(ArrayOfInt){
int[] = [
On 25 May 2013 14:42, Ken G. wrote:
> May I suggest that instead of:
> how about:
>
> flips = heads = tails = 0
>
> Ken
How about flips = heads = 0
tails can then be calculated from flips - heads.
--
best regards,
Robert S.
___
Tutor
the answer glossed over to begin with. I'm not entirely
sure how it works other than that you can edit answers and it's then
moderated by someone -- maybe the person who initially wrote the
answer? Or maybe you get moderator rights when reach a certain sco
Hi,
I have Mac OS X 10.7.5 and would like to install < = python 2.3 on it.
I need it as one of the s/w I would like to try is based on an older version
and does not seem to work with the new ones.
I am not sure if the s/w is wrong (doesn't seem like it) or is it really the
python version that i
plain; charset=UTF-8; format=flowed
>
> On 21/05/13 08:49, Treder, Robert wrote:
>> Hi python folks,
>>
>> I have a list of lists that looks something like this:
>>
>> tst = [ [], ['test'], ['t1', 't2'], ['t1', 't1',
Hi python folks,
I have a list of lists that looks something like this:
tst = [ [], ['test'], ['t1', 't2'], ['t1', 't1', 't2'] ]
I want to change the empty sets to a blank string, i.e., '' and the lists with
repeat values to the unique set of values. So I have done the following:
>>> for
y don't have that particular book, and I imagine many
others on this mailing list don't either, it'll be hard for us to
comment on the challenges, given that we don't know what they are.
--
best regards,
Robert S.
___
Tutor maillist
Message: 1
Date: Fri, 03 May 2013 23:05:32 +0100
From: Alan Gauld
To: tutor@python.org
Subject: Re: [Tutor] creating a corpus from a csv file
Message-ID:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 03/05/13 21:48, Treder, Robert wrote:
> I'm very new to python and a
Hi,
I'm very new to python and am trying to figure out how to make a corpus from a
text file. I have a csv file (actually pipe '|' delimited) where each row
corresponds to a different text document. Each row contains a communication
note. Other columns correspond to categories of types of com
y and go with my horrible expressions, but that seems
like a cheap way out of a problem I'd rather tackle in a good way to
begin with)
Much thanks in advance.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
is the best one I've
come across.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
) class (just writing the unittests
for it), after that I'll tackle the Bin class, at which point I will
definitely return for more questions. As I said before, thanks to
everyone who answered.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@p
= Outcome('Ray')
>>> c = Outcome('Bob')
>>> a == b
>>> a == c
True
>>> a != b
True
>>>
However, if I were to create a class without the __eq__ and __ne__
definitions, what is to prevent me from doing: a.na
re:
http://docs.python.org/3.3/library/pickle.html#module-pickle
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Mar 20, 2013 10:49 p.m., "xDog Walker" wrote:
>
> On Wednesday 2013 March 20 13:39, Robert Sjoblom wrote:
> > A word of advice: next is a keyword in python
>
> ~/Packages/Python/Notable-0.1.5b> python
> Python 2.5 (r25:51908, May 25 2007, 16:14:04)
> [
next1 + period line:
..
Entering while loop. next1 is: ..
If you don't have to use strings for this program, I would suggest you
check out lists, and especially list.append(). It is possible to write
a program that does what you want, but it'd be a convoluted solution.
--
best regards,
you:
a) didn't send HTML emails
b) actually gave us the error message, as it says a lot about your
error other than "syntax error".
[snipped code]
Since we can't see your games class, nor your error message, we can't
really help you.
--
best regards,
Robert S.
_
> What is the correct syntax to covert English characters from uppercase to
> lowercase and from lowercase to uppercase?
>
s.upper() and s.lower()
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change sub
four keys (shift, ctrl, 1 and 0) nearby).
Some people like to use the number keys (8456 for WASD) instead, as
they too are relatively close to more keys, but overall I think that
WASD is the standard.
At least that's what I suspect.
--
best regards,
Robert S.
___
>> Umm. No. Sorry, Mark, but that site and the core-mentorship list it
>> advertises are intended for progammers who want to be helped in the
>> development *of* Python, not development *in* Python. Ie, otherwise
>> experienced programmers who are unfamiliar with the Python codebase.
>>
>> TJG
>>
>
closely at the FRED API, but something
like (untested):
for key in dictionary:
print(key, dictionary[key])
could possibly get you started.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscri
e or
> alternative approaches would be helpful.
I can't help you with that question, since I'm still (!) wrapping my
head around objects and haven't really gotten around to looking at
data validation and when/how you should do it
I recommend it to anyone who wants to learn Python, but
there are probably better books for *specifically* programming
principles -- this book is more of a bundled deal.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
og/2011/08/11/recursion-explained-with-the-flood-fill-algorithm-and-zombies-and-cats/
If you just want to read the stack explanation, scroll down to
"Recursion is Just a Fancy Way of Using a Stack"
--
best regards,
Robert S.
___
Tutor maillist -
On Jan 3, 2013 2:22 a.m., "Conor Grevlos" wrote:
>
> I downloaded the python source folder, with chapters 1 through 12 I
think. But it just opens up the program that is already built, not one that
shows me the code.
Open the files in an editor of your choice, don't run them.
_
ttp://www.briggs.net.nz/snake-wrangling-for-kids.html
I've not had the chance to read "Invent your own computer games with
Python", so can't say anything about it.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To uns
> What's "who and whos"?
They're matlab functions:
who lists the variables currently in the workspace.
whos lists the current variables and their sizes and types. It also
reports the totals for sizes.
--
best regards,
Robert S.
___
():
myvalue = eval(name)
print name, "is", type(name), "and is equal to ", myvalue
There's also global(), local() and vars().
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
; y = random.choice(m_list)
>>> y
'message.'
>>> m_list.remove(y)
>>> m_list
['This', 'is', 'a']
>>> y
'message.'
You should probably move your y = random.choice() into the while loop.
A simpler way
to parse these files. We can't tell you how they're
structured so you'll have to figure that out yourself."? It's just so
much text that's it's hard to get a grasp on the structure, and
there's so much information contained in there as well; this is just
th
(and I knew that as well, but I wanted to first
make sure that I could find what I was after properly). The structure
looks like this (I opted to use \t instead of relying on the tabs to
getting formatted properly in the email):
\t\tkeyword=
\t\t{
5 72 88 77 90 92 \t\t}
--
best regards,
Robert S.
__
nt itself; it
would be best if it could run on any platform, but I'll take a Windows
machine with no changes to command line if I have to.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
just an educated guess, but it
doesn't really matter because it always comes back to the cp932 error.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
moving parts of a class to a new
class for instance or renaming methods to better say what they're
about, subclassing or superclassing things and such.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change sub
overall I'd say that Eclipse was a better experience, but
Eric was by no means bad. I guess it comes down to user preferences.
As for books, Dive Into Python 3 is one of the better books I've come
across.
http://eric-ide.python-projects.org/
--
best regards,
Robert S.
___
new try. Can you think of any way to solve
that?
And while this might not be entirely on topic, there's a wonderful
book for complete beginners -- I've used it as well -- that I'd like
to recommend: Python Programming for the Absolute Beginner. In fact,
one of the excerc
print("This is critter_import.py")
The output will only be:
This is critter_import.py
If I subsequently create critters in critter_import.py, I will indeed
get the output that we see in critter.py, but that's because of class
behaviour and not because the if '__name__' block
try it you will hook on to it for ever
>
> Thanks
> Best Regards
> Kapil
>
Pity it is only for Windows.
--
Robert Berman
The Torah says,
Love your neighbor as yourself.
The Buddha says,
There is no self.
So, maybe, we're off the hook.
___
t cards are available, too. Forgot about that part. I guess you can
do:
sample(deck, 52) #or instead of deck range(1,53)
for each new round, and pop items from the returned sample instead of
popping the deck list every time. In the end I suppose it's a matter
of style. Oh, a
I understand your problem. You are pickling a dictionary and
finding that it will not work unless there already is an existing
dictionary for your pickled dictionary to write over. Otherwise, there is
either no write at all or the write is followed by a
e category including python there are at least 1,100,000.
What is your experience level doing basic research?
Robert Berman
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
asciiValue += shiftedCypherNumber
#and so on
PEP 8 is really worth reading through: http://www.python.org/dev/peps/pep-0008/
there's also a link to PEP 257 in it. If you follow most of the
suggestions in PEP 8 it will be much easier to read your code, and
because of that easier to help you.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
uld know.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
> Some improvements to think about, in order of least secure (easiest) to most
> secure (hardest).
>
> (1) "my secret password.txt" is a crappy name. Is there a better name?
I'm going to go with "EULA.txt"; the reasons should be
On 15 December 2011 23:37, Calle wrote:
> -Ursprungligt meddelande- From: Robert Sjoblom
> Sent: Thursday, December 15, 2011 10:34 PM
> To: Calle
> Cc: tutor@python.org
> Subject: Re: [Tutor] [TUTOR]Code Deciphering
>
>
>> I was wondering, how do you use Python
ation that uses letters instead of phrases. Examples being the
standard Caesar cipher where "APPLE" might be written "BQQMB" (ie,
shifted one letter to the right).
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
ery well work but it doesn't actually time
anything for me. It's very frustrating, but I feel like I'm too stupid
to read the official documentation for it (that is, I might understand
the words in the documentation, but I can't get it to work). Please
help?
--
best regards,
n
print(k)
What Peter said is very important too. I very much doubt you'll find
the solution with those loops.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ur reply on top -- it makes it difficult to find (and to
keep track of who says what when).
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
> On 12/12/2011 01:38 AM, Pete O'Connell wrote:
>> Hi I have been writing python code for a while now and I never return
>> anything within any of my functions, I just (eg.) print stuff or make
>> directories or update a log or what have you. When I look at other
>> people's code they are always r
ial:Downloadcode/Factorials_with_prime_factorization_%28Python%29
(Well, excepting actually storing prime numbers in a list which would
be much, much faster)
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscripti
On 12/08/2011 05:03 PM, Steven D'Aprano wrote:
Robert Berman wrote:
Hi,
Assuming a list similar to this: l1=[['a',1],['b',2],['c',3]] and I
want to get the index of 'c'.
You will need to explain what you mean by "the index of 'c
On 12/08/2011 04:27 PM, bod...@googlemail.com wrote:
That won't work because l1[0] is ['a', 1]
What happens if you don't change the code?
l1.index('c')
Bodsda
Sent from my BlackBerry® wireless device
-----Original Message-
From: Robert Berman
Sender: t
rkable code to do that task reasonably well.
Thank you for your assistance.
Robert
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
cost.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
uns is because it
accidentally finds x = 25 and 5*25 = 200 (1000//5 = 200), thus ending
the loop.
I'm not sure how to fix that. Recursion? It obviously happens when the
answer is something like 2*2*5*5.
--
best regards,
Robert S.
___
Tutor maillist
> from math import sqrt
>
> def isprime(n, factor):
> if n == 1:
> return False
> for x in range(2, round(sqrt(n))):
Ooops, this should obviously read
for x in range(factor, round(sqrt(n))):
best regards,
Robert S.
actor):
factor = x
n = n // x
if n == 1:
return factor
else:
return factor
x += 2
print(factorization(600851475143))
>
> HTH,
> Wayne
--
best regards,
Robert S.
__
be honest. This wasn't too bad, but even for problems 1 and 2 I've
relied on brute forcing the answer instead of looking for a
mathematical solution.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
same subject and are unsolvable because the standard version
doesn't work. So just to give you a heads up: don't overextend your
welcome.
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
le is better because it does (for this purpose, at
least) and it stores the result in a list automatically.
Let's hope this email goes to the right thread. :/
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or
= random.sample(range(1,42), 7)
random.sample returns k unique random elements from a population
sequence; in this case the population sequence is range(1, 42) (I
think python 2.x it'd be xrange()?) and the second argument would be
the number of elements we wan
2index=='pumpkin' and wheel3index==
> 'candie':
>
> print ('wins pumpkin, ghost, and candy.')
Here you've misspelled "candy" as well as having it in the wrong case.
ANYWAY, I'm sure there's some better way to compare stuff lik
Wing IDE looks promising on my windows machine. I will start by checking out
their trial under OSX.
Thanks for all suggestions,
Robert
Från: tutor-bounces+robert.johansson=math.umu...@python.org
[mailto:tutor-bounces+robert.johansson=math.umu...@python.org] För Tom Tucker
Skickat: den 29
and OS 10.7). IDLE had serious problems and
TextWrangler had no interactive shell. There's a lot of other stuff to try and
I would be grateful if someone could spare me some time on this.
Cheers, Robert
___
Tutor maillist - Tutor@python.org
T
Well everybody, sorry for the incomplete sentences
and overall poor English but I wanted to make this
simple to read and understand for someone who
is completely inexperienced in any sort of programming,
as I am (very first day messing with this stuff, e.g.,
terminal). This is the result of hou
> shantanoo, Andre, and Robert:
>
> All of your solutions seem to work (and thank you for the tips!), however,
> with each solution there seems to be 2 MACs that should not be in the
> results.
>
> 00:1C:14:BA:D9:E9 and
> 00:16:3E:EB:04:D9
>
> should not be be tur
practice, so I'm going to suggest that
instead:
badMacs = [item for item in scanResults if item not in verifiedList]
Other than that, there's not much to say; the standard is 4 spaces
indentation, personally I feel that 1 space is too little, since it's
hard to see where on
even if there's a better way to handle it. I'll
probably send it through a function, something like (pseudocode):
def check_result(diceroll_result, initial_mins, initial_max):
check for success/failure and so on
return result
But even so, i
15:
if roll[1] >= 2:
print("Critical success!")
elif roll[2] >= 2:
print("Failure")
else:
print("Success")
This handles all the test cases I've come up with, but it feels very
ugly. Is there a better way to do this?
--
best
>> Are you using Python 3 and urllib, and not using httplib2? Because I
>> honestly can't get urllib.request.urlopen to work with
>> http://www.boursorama.com/ -- I only get b'' from there.
>
> Yes, Python 3.2 which version one are you using? I tried both with
> debug and without.
Python 3.2.1 64
>Don't know, works fine for me..
>
>Greets
>Sander
Are you using Python 3 and urllib, and not using httplib2? Because I
honestly can't get urllib.request.urlopen to work with
http://www.boursorama.com/ -- I only get b'' fro
ttplib2.Http('.cache') # I prefer to use
folders when working with httplib2
response, content = h.request(url)
Response headers are put in response, the content is accessible as a
byte object in content.
--
best regards,
Robert S.
__
e class
(remembering that an object is an instance of a class - the class is
the definition, the object is an instance of that data)
Credit where credit is due:
http://stackoverflow.com/questions/155609/what-is-the-difference-between-a-method-and-a-function
/Robert S.
_
the dirname() function, so if we try calling dirname()
we will get a TypeError exception because dirname now refers to a
string, and we can't call strings.
However, given that Tkinter is such a huge package to begin with, I'd
say that you should continue to use from
Now it works fine but I don't understand why the first example fails. I'm not
very pleased with any of these two solutions so I would be grateful for any
suggestions of improvements. I use Python 2.7.2 under Windows 7 and I ran this
in Python shell in IDLE.
Cheers, Robert
_
as does menu.py (except the search function, but that's a
different problem). Thank you (and everyone else who put time and
effort into trying to solve this)!
--
best regards,
Robert S.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
> Robert Sjoblom wrote:
>> I have a quite odd problem, and I've come across it before but
>> probably ignored it at the time because I had other concerns. I've
>> tried googling for the answer but haven't really come closer to
>> solving it.
>> This
ut when I run it in commandline it will just repeat
"is not a valid choice." Note that it does this no matter what I
actually enter, it won't actually get any kind of input except the
enter key. So I suppose it's a problem with input() (I'm using python
3.2 btw). Anyone
nt, most code is
understandable if you know python), wjile Python 3 is very dry and technical,
but really goes in-depth with OO programming and the philosophies behind it
(the first chapter really helped me wrap my head around OO and inheritance and
encapsulation and what have you). As for dia
before the exclamation mark. I want this:
Hello world!
I tried to solve the problem with e.g.:
print("Hello",name.strip(),"!")
but the result is the same.
Can anyone out there help me? Thank you.
Regards,
Robert
_
Is there a good tutorial out there somewhere about decorators? Google
doesn't bring up much.
--
Robert
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
o the telescope on earth the beam is about 9 miles wide.
Again, only 1 in 30 million *of the returning* photons will hit the
telescope. Now imagine scaling the retroflector in size to a dime.
To bring it back on topic: could python handle these numbers reliably?
--
best regards,
Robert S.
___
On 2 June 2011 22:50, Brett Ritter wrote:
> On Thu, Jun 2, 2011 at 4:06 PM, Robert Sjoblom
> wrote:
>> Python already has the urllib/urllib2 package that automatically
>> follow redirects, so I don't see why you'd need a 3rd-party module to
>> deal with it? Wh
dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ------
| Data and other attributes inherited from BaseHandler:
|
| handler_order = 500
best regards,
Robert S.
_
3 Web Development Beginner's Guide [Paperback]
I am not affiliated with the book at all...just saw it today.
--
Robert
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
nations I'm slowly getting my head around it
all. I'm sure I'll be back with more questions as soon as I can
formulate them. My biggest problem, which everyone (except this list)
skimmed over was the __init__ and self parts. Now that I've had those
explained to me, it's starti
t seem to grasp the concept or syntax very well, and none of the
sources I've found go to great lengths explaining them to someone as
thick-headed as me. So if anyone could take the time to explain, or point me to
sources to read, I'd be grateful
Thank
uot;
cities['_find'] = find_city
while True:
print "State? (Enter to quit)",
state = raw_input("> ")
if not state:
break
city_found = cities['_find'](cities,state)
print city_found
--
Grateful for any
1 - 100 of 381 matches
Mail list logo