Re: [Tutor] HELP PLEASE

2019-08-12 Thread Joel Goldstick
ht put this here: m = mean(data[0]) m2 = mean2(data[1]) then print m and m2 > > print("The mean of the first file is: ", mean) > print("The mean of the second file is: ", mean2) > main() > So, first, show the complete error message here. > ___

Re: [Tutor] Webinterface for python script

2019-01-30 Thread Joel Goldstick
ameworks, flask is one I can recall. There is a learning curve, but once you get past that, you could do this in a couple days -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays ___ Tutor maillist - Tutor@python.o

Re: [Tutor] Request for help with code

2018-11-06 Thread Joel Goldstick
; > total = len(ints) > > count = 0 > > while count < total: > >print(str(ints[count])) > >count +=1 > > > > count = 0 > > while count < total: > > print(str(ints[count])) > > count += 1 > > > > --- > > E

Re: [Tutor] Python Memory Allocation -- deep learning

2018-07-30 Thread Joel Goldstick
__ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor An id is not guaranteed to be a memory address. In the cases you cited, your version of python caches small integers, and

Re: [Tutor] tab separated file handling

2018-06-13 Thread Joel Goldstick
ubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor for i in rows: Gives you the complete line as a list. From there your test should be: if "NA" in i: # throw away this line -- Joel Goldstick http://joelgoldstick.com/blog

Re: [Tutor] Storing passwords and version control

2018-05-27 Thread Joel Goldstick
ion options: > https://mail.python.org/mailman/listinfo/tutor You can set environment variables on the system that runs the script. Then the script reads the environment variables. This keeps the secrets out of code anywhere. On your local machine you can ssh into the target mac

Re: [Tutor] Problems with Looping

2018-03-26 Thread Joel Goldstick
_ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor set a variable, say 'another_fortune' to True. surround your code in a while loop, checking the value of another

Re: [Tutor] help with code

2018-03-11 Thread Joel Goldstick
t; username = input("Please enter your username") > password = input("Please enter your password") > > def thank_you(): > print("Thank you for signing up at our website!.") > > elif choice == "q": > exit() > Sent from Mai

Re: [Tutor] Beginner's guessing game

2017-10-01 Thread Joel Goldstick
; Thank you, Steve > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > Welcome Steve Please copy and paste your code into your email body. Attachments don't come thro

Re: [Tutor] What's the difference between sort(aList) and aList.sorted()

2017-07-26 Thread Joel Goldstick
looked it up recently, but one sorts in place (object.method) i think, and the other (a function) returns a new sorted list -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] if/else statement

2017-07-18 Thread Joel Goldstick
out/doing_business/legal/cri/index.html > > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick

Re: [Tutor] call key on_press event multiple times when key is held down

2017-07-13 Thread Joel Goldstick
tener.stream.is_active())) #print("Stream is stopped? " + str(listener.stream.is_stopped())) #print("Stream is time? " + str(listener.stream.get_time())) elif listener.key_pressed == False and started == True: print("Key has been released"

Re: [Tutor] Need help with code

2017-04-19 Thread Joel Goldstick
ain(fin)) > > > Traceback (most recent call last): > File "", line 2, in > fin = open('words.txt', 'r') > FileNotFoundError: [Errno 2] No such file or directory: 'words.txt' > > > __

Re: [Tutor] understanding code testing

2017-04-15 Thread Joel Goldstick
://mail.python.org/mailman/listinfo/tutor This looks like a good book: http://www.obeythetestinggoat.com/ -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] Using Modules

2017-04-15 Thread Joel Goldstick
erstanding why I'm using those modules, or using modules that I'm actually > not using in the code. > > Sorry for the long email, I didn't initially intend or expect it to be this > long. > > Thanks, > Daniel > ___

Re: [Tutor] Help with function scoping

2017-03-22 Thread Joel Goldstick
f userGuess > computerGuess: > print('Too high') > getUser() > elif userGuess > computerGuess: > print('Correct!') > > #Add counter of guess later > > > Sent from my iPhone &

Re: [Tutor] Help!! Code ridden with Bugs

2017-03-09 Thread Joel Goldstick
) > > self.assertEqual(self.cart.checkout(25), 'Cash paid not enough', > msg='Balance of checkout not correct') > > > > def test_shop_is_instance_of_shopping_cart(self): > > self.assertTrue(isinstance(self.shop, ShoppingCart), msg='S

Re: [Tutor] help :making window

2016-12-31 Thread Joel Goldstick
s vital in python, and yours has been destroyed. Also, you seem to be writing in a dialect that is from some other language. Semicolon (;) isn't used in python as a statement separator > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription opti

Re: [Tutor] New to Python, Already Confused

2016-09-20 Thread Joel Goldstick
ion is that if the > score is <100, the lowest score is properly displayed, but if the score is > >=100, then the lowest score is equal to the highest score. Doesn't make > sense to me. Do you have any ideas? Thanks! > -- > Terry Gampper > Adjunct INF

Re: [Tutor] Help with Max Number and Min number script

2016-09-16 Thread Joel Goldstick
smallest : > > smallest = num > > > > print 'Maximum is:', largest > > print 'Minimum is:', smallest > > > What is your question? What works, or doesn't work? > > > > >

Re: [Tutor] python memory management

2016-09-01 Thread Joel Goldstick
k about memory... but most of the time, just write your code and let > the Python garbage collector manage it for you. > > > > Feel free to ask questions if anything is unclear! > > > > -- > Steve > ___ >

Re: [Tutor] __init__

2016-08-29 Thread Joel Goldstick
Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor The class will be instantiated.. but no attributes will be set -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays _

Re: [Tutor] Problem

2016-08-28 Thread Joel Goldstick
On Sun, Aug 28, 2016 at 10:46 AM, shahan khan wrote: > Hello > I'm teching myself Python using MIT opencourse ware. I'm a beginner and > have some what knowledge of c and c++. I'm using Python version > > Here is the problem: > McDiophantine: Selling McNuggets > In mathematics, a Diophantine equat

Re: [Tutor] Variables

2016-08-02 Thread Joel Goldstick
> ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor Also, lookup cron. It will start your program at a certain time you select, every day -- J

Re: [Tutor] isinstance versus 'is'?

2016-07-05 Thread Joel Goldstick
t; > -- > Alex Hall > Automatic Distributors, IT department > ah...@autodist.com > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor is denotes identity. 5 is not the type int. It is an int, bu

Re: [Tutor] Why are expressions not allowed as parameters in function definition statements?

2016-06-18 Thread Joel Goldstick
ction is defined once. The parameters name the arguments to be passed when the function is invoked. They can have defaults, but you are asking it to perform a calculation, which would only be done when the function is defined. > ___ > Tutor m

Re: [Tutor] rock paper scissor lizard spock

2016-06-13 Thread Joel Goldstick
> appreciated. > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor Welcome. This list doesn't show attachments. Cut and paste your code in your

Re: [Tutor] Hello everybody

2016-06-13 Thread Joel Goldstick
Rich PR >+79099012930 >** > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor You are an hour and a half too lat

Re: [Tutor] Urgent: unicode problems writing CSV file

2016-06-08 Thread Joel Goldstick
un with the full traceback. Show what your data to be printed looks like >> What else can I do? As I said, I really have to get this working soon, but >> I'm stuck on this stupid unicode thing. Any ideas will be great. Thanks. > > What's the type of "info"? >

Re: [Tutor] Curses Module

2016-05-16 Thread Joel Goldstick
amming? Thank you. > > > Sincerely, > > Brian Rosen > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor Which operating system are you using? -- Joel Goldst

Re: [Tutor] is there a better way to do this?

2016-05-09 Thread Joel Goldstick
to: > > date = list(curs) > I thought I nailed it earlier (and others) but this is great. An expressive language, python > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.

Re: [Tutor] is there a better way to do this?

2016-05-09 Thread Joel Goldstick
7;t know a better way to do this, it seems a bit awkward, is there > a better way? > > > Thank you > Chris Roy-Smith > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.p

Re: [Tutor] Practice python

2016-05-08 Thread Joel Goldstick
http://www.flickr.com/photos/alangauldphotos > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballstats.info/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Detect the folder of a file

2016-04-28 Thread Joel Goldstick
, say django 1.4, and it works I can leave that code to run in a virtual environment that uses django 1.4. Then I can create another environment for a new project that uses django 1.9. If I loaded the new version of django as a system level package, this would break the first projec

Re: [Tutor] URGENT: PYTHON QUESTION

2016-03-31 Thread Joel Goldstick
rst parameter a string specifying the data structure to > be used "list", "set" or "dictionary" Accepts as the second parameter the > data to be manipulated based on the data structure specified e.g [1, 4, > 9, 16, 25] for a list data structure Based off th

Re: [Tutor] How to calculate the total cost

2016-03-30 Thread Joel Goldstick
("Enter the amount of drinks") > while drink_amount >10 or drink_amount<0: > drink_amount = input (" You can only have upto 10 drinks, Please try > again") > > print ("") > print ("Calculating bi

Re: [Tutor] python smtplib 'Message denied - From address spoofing attempt detected via SMTP

2016-03-25 Thread Joel Goldstick
address spoofing attempt > detected via SMTP ( From address: IP: 111.118.215.222 AuthenticatedID: > no-re...@jsshs.org Protocol: esmtpa) data: (250, 'Message denied - > From address spoofing attempt detected via SMTP ( From address: IP: > 111.118.215.222 AuthenticatedID: no-re...@jsshs.org Pr

Re: [Tutor] Help with recursion

2016-03-22 Thread Joel Goldstick
If you get stuck, as Steven posted, show some code, and ask a question > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joel

Re: [Tutor] really basic - finding multiline chunk within larger chunk

2016-02-16 Thread Joel Goldstick
tifulSoup to parse html. And where did you find that HTML? Code like that should have died 19 years ago when CSS came on the seen. > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscriptio

Re: [Tutor] Help with date range

2016-02-09 Thread Joel Goldstick
ptions: > https://mail.python.org/mailman/listinfo/tutor > Its hard to tell what you want to do. You should show a small (10 lines?) input table, and show the results you want. This is probably much easier to solve by importing csv to a sqlite database, then running some simple date range queries. Do you know any sql? -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help needed

2016-02-04 Thread Joel Goldstick
__ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Hi Dear!

2016-02-04 Thread Joel Goldstick
ease tell my why Python3 doesn't work? > > Sincerely! > Alexander > _______ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > >>> flat

Re: [Tutor] Help with error

2016-02-02 Thread Joel Goldstick
previous_data = functions2.dictionary() > filename = raw_input("What file do you want to use?") > previous_data.populate_dict(filename) > previous_data.total_counts() > previous_data.grouped_counts() > previous_data.json_output() > p

Re: [Tutor] Help with printing to text file

2016-02-01 Thread Joel Goldstick
with open('testdoc.txt', 'w') as text_file > for line in searchfile: > if 'PBI 43125' in line: > text_file.write(line + '\n' ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help!

2016-01-26 Thread Joel Goldstick
__ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tuto

Re: [Tutor] Noob: nested if-clauses

2016-01-24 Thread Joel Goldstick
es? Not one more > or one less? > yes. you can use 1 or 2 or any number of spaces, but do spacing consistently. 4 is recommended. Don't mix tabs and spaces > > Thanks in advance. > ___ > Tutor maillist - Tuto

Re: [Tutor] Combine Scripts to Work Together...

2016-01-22 Thread Joel Goldstick
On Fri, Jan 22, 2016 at 1:48 PM, Joel Goldstick wrote: > > > On Fri, Jan 22, 2016 at 1:16 PM, Sam Starfas via Tutor > wrote: > >> >> >> >> Hi,I am new to Python, but learning. (Hopefully the layout is readable) >> I am having trouble getting two s

Re: [Tutor] Combine Scripts to Work Together...

2016-01-22 Thread Joel Goldstick
ite a script to run on > one a single file you input into the script, but getting a script to run on > a directory I am not understanding how to do this. > Thanks in advance for any and all help.Really appreciate the help. > Sam > > > ___ >

Re: [Tutor] HELP!!

2016-01-12 Thread Joel Goldstick
name2, 3 name1, 4 you can read the file line by line, split on , and add the second value to a dict with the first value as a key. You will need to check for the exception of their being no key with that value (the first time it appears). But first, resend in plain text >

Re: [Tutor] Tutor Digest, Vol 143, Issue 15

2016-01-06 Thread Joel Goldstick
On Wed, Jan 6, 2016 at 9:57 AM, yehudak . wrote: > Not a question, just ranting. > > My 2 commonest coding errors are forgetting the : before a block, and > mismatch between the number of ('s and )'s. The error message is a simple > 'Syntax Error', but the line quoted is not the offending line. I

Re: [Tutor] Help with loops

2016-01-05 Thread Joel Goldstick
_count.most_common(5)) >text_file.close() > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > This code is quite a

Re: [Tutor] lists+sort

2016-01-04 Thread Joel Goldstick
ou may also take a look at this link: http://stackoverflow.com/questions/7237875/linear-merging-for-lists-in-python It appears that the poster was going through Googles python tutorials -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] lists+sort

2016-01-04 Thread Joel Goldstick
turn result > > > I don't think this code will work if the original lists are unsorted to begin with. You should give some sample data and your results for both methods > > Can you please tell me if there is a problem in the first code? > > Thank you. > _

Re: [Tutor] Lists+sorting

2016-01-04 Thread Joel Goldstick
ickr.com/photos/alangauldphotos > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to plot amount of lines but the amount is a input

2015-12-30 Thread Joel Goldstick
;Projectile motion') > > > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python trouble

2015-12-29 Thread Joel Goldstick
print ("finished") > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays

Re: [Tutor] Algorithm

2015-12-28 Thread Joel Goldstick
r") AssertionError: Incorrect number > Using unittest > > Can you show your unittest code? > I look forward to your response, > Thank you! > _______ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mai

Re: [Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Joel Goldstick
__ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > def problem(6174625): return 115160371 You haven't really described your problem, so above is a solution for what you asked.

Re: [Tutor] Squaring every digit in number

2015-11-21 Thread Joel Goldstick
'149' >>> int(d_squared) >>> 149 > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] File operation query

2015-10-15 Thread Joel Goldstick
? Can you add that to your question? > ## > > > Regards, > RD. > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/ma

tutor@python.org

2015-10-14 Thread Joel Goldstick
On Wed, Oct 14, 2015 at 7:39 PM, Laura Creighton wrote: > In a message of Wed, 14 Oct 2015 19:29:47 -0400, Joel Goldstick writes: > >& is a bitwise operator, so any odd number and 1 will be one (true), and > >any even number will be zero (false) > > You and Ben seem to h

tutor@python.org

2015-10-14 Thread Joel Goldstick
; Thanks > Ni > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays _

Re: [Tutor] Beautiful Soup

2015-09-29 Thread Joel Goldstick
Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > many people find this package to be easier to use than the built in python support for reading urls: http://docs.python-requests.org/en/latest/ -- Joel Goldstick h

Re: [Tutor] syntax error

2015-09-14 Thread Joel Goldstick
ist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Type Error

2015-09-14 Thread Joel Goldstick
gt; I don't understand the error > -- > > All internal models of the world are approximate. ~ Sebastian Thrun > I'm not sure if you want to remove src or dst, but whichever one you want to remove, use the name, not the file object, eg: os.remove(src) ___

Re: [Tutor] Problem using lxml

2015-08-22 Thread Joel Goldstick
any suggestions? > > Thanks! > Anthony Not an answer, but have you checked out Beautiful Soup? It is a great html parsing tool, with a good tutorial: http://www.crummy.com/software/BeautifulSoup/bs4/doc/ > _____

Re: [Tutor] Complications Take Two (Long) Frustrations.

2015-08-21 Thread Joel Goldstick
isdom. > -- Isaac Asimov > > Roel Schroeven > so: print -max(-A, -B) > > _______ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem with code (Alan Gauld)

2015-08-20 Thread Joel Goldstick
ttachment: Python code file. > No attachments allowed here. Paste your code in your message Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] iteration help

2015-08-20 Thread Joel Goldstick
ly. 2. In your else: code, you want = not == since you want to assign the new value to the serverHr. That line does nothing now since it is comparing two values, but making no decision based on the comparison. 3. I'm guessing you are coming from another language. In python people generally use lower case names with underscores between words. -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] variable naming conventions

2015-08-15 Thread Joel Goldstick
> instill good habits while I'm learning. > > Thanks in advance, > -- > Deb Wyatt in WA > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listi

Re: [Tutor] DEALING WITH API

2015-08-07 Thread Joel Goldstick
>> Tutor maillist - Tutor@python.org >> To unsubscribe or change subscription options: >> https://mail.python.org/mailman/listinfo/tutor >> > > > _______ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https

Re: [Tutor] who makes FOR loop quicker

2015-08-06 Thread Joel Goldstick
On Thu, Aug 6, 2015 at 4:34 AM, John Doe wrote: > Can You, please, elaborate this "..Passing in Python is different than in C > or other languages..." > I hesitate, because this question is usually the fuel of flaming wars. So in short: C can pass a value or a reference to a value (the address of

Re: [Tutor] who makes FOR loop quicker

2015-08-05 Thread Joel Goldstick
rable while interating over it. I'm guessing that this is what is confusing you. One way to remove items from a list is to create a new list, and append items you want to it, skipping the ones you don't. You don't really need the index at all since python interation

Re: [Tutor] Basic question about docstrings

2015-07-30 Thread Joel Goldstick
the built in help facility: >> >> https://docs.python.org/2/library/functions.html#help >> > > I understand that 'help' works with modules that I have imported. But if I've > just written a script called main.py (which contains get_value()) I don't

Re: [Tutor] Variables in email addresses

2015-06-17 Thread Joel Goldstick
y done this for you. > > Interesting tutorial here: > http://pymotw.com/2/smtplib/ > But be warned, this uses Python 2 syntax, not Python 3. > > Laura > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscripti

Re: [Tutor] (no subject)

2015-06-10 Thread Joel Goldstick
. They are a more concise way of writing various for loops. You can google to learn much more -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] creating a dictionary for capital quiz program

2015-06-02 Thread Joel Goldstick
'California': 'Sacramento', \ > > You don't need these backslashes as long as you're inside parens, brackets > or braces. Python will happily accept dicts, lists etc. that spread over > multiple lines. > > > > ___

Re: [Tutor] League Secretary Application

2015-05-30 Thread Joel Goldstick
Take a look at django. The tutorial takes a couple of hours and gives you a good feel for whether it would suit you. You could say its overkill, but it makes it very easy to do CRUD stuff with validation built in. Displaying the results would be very easy as well. You could have your data pr

Re: [Tutor] introspection

2015-04-20 Thread Joel Goldstick
a = 3 >>> b = 6 >>> c = a >>> locals() {'a': 3, 'c': 3, 'b': 6, '__builtins__': , '__package__': None, '__name__': '__main__', '__doc__': None} >>> a is b False >>> a is c True >>> > > > _

Re: [Tutor] OT: Is there a good book that covers the history/evolution of software? [Inspired by the thread: lists, name semantics]

2015-04-19 Thread Joel Goldstick
f garbage collection details > going on I find quite interesting. > > -- > boB you might start here: https://en.wikipedia.org/wiki/History_of_programming_languages -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@

Re: [Tutor] lists, name semantics

2015-04-19 Thread Joel Goldstick
ot. > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] =Linked List Using Map

2015-04-18 Thread Joel Goldstick
my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.pyth

Re: [Tutor] where is the wsgi server root?

2015-04-14 Thread Joel Goldstick
/p/modwsgi/ It isn't like php. You can put your code anywhere. > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor -- Joel Goldstick http://joelgoldst

Re: [Tutor] list semantics

2015-04-11 Thread Joel Goldstick
; py> gen() # This actually is a generator. > > Thanks for the tip Steve > > > -- > Steve > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/t

Re: [Tutor] list semantics

2015-04-11 Thread Joel Goldstick
> Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Joel Goldstick
On Mon, Apr 6, 2015 at 11:20 AM, Joel Goldstick wrote: > On Mon, Apr 6, 2015 at 10:54 AM, boB Stepp wrote: >> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit >> (Intel)] on win32 >> Type "copyright", "credits" or "license()&qu

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Joel Goldstick
ample: >>> def f(6): File "", line 1 def f(6): ^ SyntaxError: invalid syntax >>> You can't pass a value as a parameter to a function definition. You need to provide a name. The actual value is supplied when you c

Re: [Tutor] Tuple indexing

2015-03-11 Thread Joel Goldstick
t-tuple-bytearray-buffer-xrange It wasn't around until 2.4 according to what I read somewhere > > > Thanks. > > > > I am using Python 2.7 at moment. > > > > > > > ___ > Tutor maillist - Tutor@python.org >

Re: [Tutor] Help

2015-03-07 Thread Joel Goldstick
e. Sorry for clumsy answer. I was trying to say that using a list with i as an index was a solution rather than trying to build names on the fly with some text concatenated to the value of i -- Joel Goldstick http://joelgoldstick.com ___ Tutor

Re: [Tutor] Help

2015-03-07 Thread Joel Goldstick
ist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor You could certainly use I as an index into a list called x. This doesn't look like a good idea though -- Joel Goldstick http://joelgoldstick.com __

Re: [Tutor] What exactly is "state"?

2015-03-02 Thread Joel Goldstick
__ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor 'State' is the present value of all variables related to the code that is running. Often code execution is dependent on t

Re: [Tutor] Potential problem with Game Over 2.0 problem in "Python Programming for the Absolute Beginner, 3rd Ed."

2015-02-17 Thread Joel Goldstick
result look like gibberish. So far I cannot find a setting to > eliminate this undesired behavior. Argh! Do you have gmail set to plain text mode? > -- > boB > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change su

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-14 Thread Joel Goldstick
you use the str.split() method. It > will put each item in a list. > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] trivial simple program..can it be made more concise?

2015-02-13 Thread Joel Goldstick
t need the \r. print will print each line on a new line > > > Thanks, > > Steve > > > _______ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/

Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread Joel Goldstick
wise, I will brute-force my way through with if-elif-else > statements. > > Thanks! > > First, its best to cut and paste your code along with the traceback for the errors you got. You might want to look up python *args and *kwargs. > -- > boB > _____

Re: [Tutor] Error 22

2015-01-07 Thread Joel Goldstick
ttp://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > > ___ > Tutor maillist - Tutor@python.org > To unsub

Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-29 Thread Joel Goldstick
stem, and public health, what have the Romans > ever done for us? > > ~~ > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subsc

Re: [Tutor] Problem

2014-12-26 Thread Joel Goldstick
- Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor print baseurl -- Joel Goldstick http://joelgoldstick.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor

2014-12-05 Thread Joel Goldstick
about what you need to learn. There are lots of people here to help. > > Thank you, > > Marina Woodson > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mail

Re: [Tutor] Python

2014-12-03 Thread Joel Goldstick
2.x since you are using raw_input > > Thank you, > > Jack Jasper > jackjas...@mac.com > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://

  1   2   3   4   5   6   >