[Tutor] Trouble Downloading To MacOS Mojave 10.14.3 released mid 2014

2019-03-13 Thread Robert Landers
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

Re: [Tutor] recursivity and lists

2016-03-05 Thread Robert Nanney
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

[Tutor] Need help with audio manipulation

2016-02-11 Thread Swift, Robert
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

Re: [Tutor] responding to command line

2015-11-25 Thread Robert Nanney
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

tutor@python.org

2015-10-14 Thread Robert Nanney
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. > > > > =

Re: [Tutor] ftp socket.error

2015-09-11 Thread Robert Nanney
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

Re: [Tutor] passing named arguments through command line

2014-10-31 Thread Robert Sokolewicz
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

[Tutor] passing named arguments through command line

2014-10-30 Thread Robert Sokolewicz
in advance! -Robert ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Unpacking lists

2014-07-08 Thread Robert Nanney
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

Re: [Tutor] How to create dictionaries loadable with import

2013-09-25 Thread Treder, Robert
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

[Tutor] How to create dictionaries loadable with import

2013-09-24 Thread Treder, Robert
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

[Tutor] Convert SOAP response (ArrayOfInt) to Python list

2013-07-10 Thread Robert Winkler
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[] = [

Re: [Tutor] Flip the coin 10x and count heads and tails: It works now!

2013-05-25 Thread Robert Sjoblom
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

Re: [Tutor] keyboard interrupt

2013-05-24 Thread Robert Sjoblom
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

[Tutor] installing old versions of python on Mac OS X

2013-05-23 Thread Robert R
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

Re: [Tutor] reducing lists within list to their set of unique values

2013-05-21 Thread Treder, Robert
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', &#x

[Tutor] reducing lists within list to their set of unique values

2013-05-20 Thread Treder, Robert
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

Re: [Tutor] Python Programming for the Absolute Beginner

2013-05-15 Thread Robert Sjoblom
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

Re: [Tutor] creating a corpus from a csv file

2013-05-13 Thread Treder, Robert
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

[Tutor] creating a corpus from a csv file

2013-05-03 Thread Treder, Robert
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

[Tutor] Dictionaries and multiple keys/values

2013-03-25 Thread Robert Sjoblom
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

Re: [Tutor] (no subject)

2013-03-24 Thread Robert Sjoblom
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

Re: [Tutor] Overriding equality tests in Python

2013-03-23 Thread Robert Sjoblom
) 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

[Tutor] Overriding equality tests in Python

2013-03-22 Thread Robert Sjoblom
= 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: [Tutor] Importing data from a file.

2013-03-21 Thread Robert Sjoblom
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

Re: [Tutor] Help

2013-03-20 Thread Robert Sjoblom
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) > [

Re: [Tutor] Help

2013-03-20 Thread Robert Sjoblom
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,

Re: [Tutor] Loop Exception Handles

2013-03-15 Thread Robert Sjoblom
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. _

Re: [Tutor] converting upper case to lowercase and vice-versa

2013-03-15 Thread Robert Sjoblom
> 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

Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-12 Thread Robert Sjoblom
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. ___

Re: [Tutor] There's a Programmer in Me

2013-02-26 Thread Robert Sjoblom
>> 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 >> >

Re: [Tutor] getting and using information dict objects

2013-02-23 Thread Robert Sjoblom
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

Re: [Tutor] object attribute validation

2013-02-22 Thread Robert Sjoblom
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

Re: [Tutor] following on

2013-02-19 Thread Robert Sjoblom
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

Re: [Tutor] following on

2013-02-18 Thread Robert Sjoblom
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 -

Re: [Tutor] Python Programming for Absolute Beginner

2013-01-02 Thread Robert Sjoblom
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. _

Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread Robert Sjoblom
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

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Robert Sjoblom
> 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. ___

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Robert Sjoblom
(): 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

Re: [Tutor] Lists and While Loops

2012-03-28 Thread Robert Sjoblom
; 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

Re: [Tutor] Finding a specific line in a body of text

2012-03-11 Thread Robert Sjoblom
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

[Tutor] Finding a specific line in a body of text

2012-03-11 Thread Robert Sjoblom
(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. __

Re: [Tutor] UnicodeEncodeError: 'cp932' codec can't encode character '\xe9' in position

2012-03-10 Thread Robert Sjoblom
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

[Tutor] UnicodeEncodeError: 'cp932' codec can't encode character '\xe9' in position

2012-03-10 Thread Robert Sjoblom
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

Re: [Tutor] Refactoring

2012-03-08 Thread Robert Sjoblom
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

Re: [Tutor] new to programming and wondering about an IDE for Python on Linux

2012-02-27 Thread Robert Sjoblom
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. ___

Re: [Tutor] Help with Python Program

2012-02-26 Thread Robert Sjoblom
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

Re: [Tutor] __name__=='__main__'

2012-02-20 Thread Robert Sjoblom
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

Re: [Tutor] Pyhton editor

2012-02-17 Thread Robert Berman
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. ___

Re: [Tutor] Debugging While Loops for Control

2012-02-17 Thread Robert Sjoblom
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

Re: [Tutor] general basic question

2012-02-08 Thread Robert Berman
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

Re: [Tutor] Sandbox Game

2012-02-05 Thread Robert Berman
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

Re: [Tutor] Still the Python Challenge - Conclusion

2012-01-05 Thread Robert Sjoblom
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

Re: [Tutor] Parse multi line with re module.

2012-01-03 Thread Robert Sjoblom
uld know. -- best regards, Robert S. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reset password program

2011-12-16 Thread Robert Sjoblom
> 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

Re: [Tutor] [TUTOR]Code Deciphering

2011-12-15 Thread Robert Sjoblom
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

Re: [Tutor] [TUTOR]Code Deciphering

2011-12-15 Thread Robert Sjoblom
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

[Tutor] timeit() help

2011-12-15 Thread Robert Sjoblom
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,

Re: [Tutor] where I am going wrong?

2011-12-14 Thread Robert Sjoblom
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

Re: [Tutor] Running a script!

2011-12-12 Thread Robert Sjoblom
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

Re: [Tutor] return, why do I need it?

2011-12-11 Thread Robert Sjöblom
> 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

Re: [Tutor] how to handle big numbers

2011-12-09 Thread Robert Sjoblom
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

Re: [Tutor] list.index() question

2011-12-08 Thread Robert Berman
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

Re: [Tutor] list.index() question

2011-12-08 Thread Robert Berman
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

[Tutor] list.index() question

2011-12-08 Thread Robert Berman
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

Re: [Tutor] Python Saved the Day

2011-12-04 Thread Robert Sjoblom
cost. -- best regards, Robert S. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Prime Factorization Tool

2011-12-01 Thread Robert Sjoblom
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

Re: [Tutor] Prime Factorization Tool

2011-12-01 Thread Robert Sjoblom
> 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.

Re: [Tutor] Prime Factorization Tool

2011-12-01 Thread Robert Sjoblom
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. __

[Tutor] Prime Factorization Tool

2011-12-01 Thread Robert Sjoblom
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

Re: [Tutor] Hello again. Still the same problem, different question.

2011-11-12 Thread Robert Sjoblom
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

Re: [Tutor] 6 random numbers

2011-10-17 Thread Robert Sjoblom
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

Re: [Tutor] 6 random numbers

2011-10-16 Thread Robert Sjoblom
= 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

Re: [Tutor] Running a loop

2011-10-15 Thread Robert Sjoblom
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

Re: [Tutor] Mac IDE

2011-09-29 Thread Robert Johansson
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

[Tutor] Mac IDE

2011-09-29 Thread Robert Johansson
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

Re: [Tutor] Running .py files in shell

2011-09-21 Thread Robert Layne
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

Re: [Tutor] Finding the differences between two lists

2011-08-25 Thread Robert Sjoblom
> 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

Re: [Tutor] Finding the differences between two lists

2011-08-25 Thread Robert Sjoblom
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

Re: [Tutor] Help with if-elif-else structure

2011-08-25 Thread Robert Sjoblom
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

[Tutor] Help with if-elif-else structure

2011-08-25 Thread Robert Sjoblom
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

Re: [Tutor] issues with urllib and loading a webpage

2011-08-23 Thread Robert Sjoblom
>> 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

Re: [Tutor] issues with urllib and loading a webpage.

2011-08-23 Thread Robert Sjoblom
>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

[Tutor] issues with urllib and loading a webpage.

2011-08-23 Thread Robert Sjoblom
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. __

Re: [Tutor] methods vs. functions

2011-08-22 Thread Robert Sjoblom
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. _

Re: [Tutor] Tkinter: no module named messagebox (brandon w)

2011-08-14 Thread Robert Sjoblom
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

[Tutor] function remember calls?

2011-08-09 Thread Robert Johansson
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 _

Re: [Tutor] commandline unable to read numbers?

2011-08-07 Thread Robert Sjoblom
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

Re: [Tutor] commandline unable to read numbers? (Steven D'Aprano)

2011-08-07 Thread Robert Sjoblom
> 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

[Tutor] commandline unable to read numbers?

2011-08-06 Thread Robert Sjoblom
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

Re: [Tutor] "Object designer" applications - are there any?

2011-08-05 Thread Robert Sjöblom
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

[Tutor] Hello World in Python without space

2011-07-10 Thread Robert H
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 _

[Tutor] decorators

2011-06-23 Thread 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

[Tutor] [OT] Re: Floating Point Crazines

2011-06-12 Thread Robert Sjoblom
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. ___

Re: [Tutor] Strategy to read a redirecting html page

2011-06-02 Thread Robert Sjoblom
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

Re: [Tutor] Strategy to read a redirecting html page

2011-06-02 Thread Robert Sjoblom
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. _

Re: [Tutor] Python and the web

2011-05-22 Thread Robert
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

Re: [Tutor] Help with understanding classes

2011-05-22 Thread Robert Sjoblom
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

[Tutor] Help with understanding classes

2011-05-21 Thread Robert Sjöblom
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

[Tutor] Python Hard_way 40

2011-05-11 Thread Robert .
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   2   3   4   >