Re: [Tutor] Object creation query

2019-08-09 Thread bob gailer
On 8/9/2019 7:39 AM, Alan Gauld via Tutor wrote: On 09/08/2019 09:54, mhysnm1...@gmail.com wrote: updates and insertions. I have multiple tables with the same structure with differe I agree 100% with Peter and Alan's responses. -- Bob G

Re: [Tutor] instantiate and name a class from / with a string

2019-08-09 Thread bob gailer
asking for help in obtaining a value from a database? Or how to dynamically create instances assigned to root.channel attributes? Assuming the latter: name = # get from data base setattr(root.channel, name, SSE(name)) -- Bob Gailer ___ Tutor maillist

Re: [Tutor] Difference between decorator and inheritance

2019-08-02 Thread bob gailer
enter a command>') func = cmd_dict.get(cmd) -- Bob Gailer ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Stylometry Help

2019-07-20 Thread Bob Gailer
e tutor list does not forward attachments. If the files are not too big just include them in the body of the email. Otherwise you'll have to store them in the cloud and give us a link. Be sure to reply all so we all get to see your problem. Bob gailer

Re: [Tutor] pointers or references to variables or sub-sets of variables query.

2019-07-08 Thread bob gailer
Data = [    ['2019-01-19','Fred Flintstone',23], ['2019-02-01','Scooby doo', 99] ] Warning 3: age is not a fundamental attribute; it is a computed value! -- Bob Gailer ___ Tutor maillist - Tutor@python.o

Re: [Tutor] [Python-Help] Writing hello world

2019-06-29 Thread Bob Gailer
On Jun 28, 2019 9:26 AM, "Erastus muriithi" wrote: > > Iam a student..iam interested in learning python,,I don't know how to study this python.kindly help me how to go about it..Thankyou First make sure you have python installed on your computer. If you need help with that let us know what kind o

Re: [Tutor] Python 3.7 Grids

2019-06-29 Thread Bob Gailer
even better if it's not terribly complicated paste it into the reply. be sure to reply all so everyone on the tutor list will see your reply. > There are no viruses. That's kind of like a Salesman saying "trust me". Bob Gailer

Re: [Tutor] python

2019-06-25 Thread Bob Gailer
On Jun 25, 2019 8:52 AM, "Shaon Debnath" wrote: > > I just wanted to know all about map() function in python. See https://www.geeksforgeeks.org/python-map-function/. If after reading that you still have questions please come back and ask t

Re: [Tutor] How to store scores of a race's players

2019-03-26 Thread Bob Gailer
Please do not use a mangled return email address. It causes us a lot of pain when we fail to read your address to fix it and get the message bounced back. The only reason I'm even bothering to resend it is because I put a lot of work into it.: > On > Mar 26, 2019 6:55 AM, "^Bart" wrote: > > > > He

Re: [Tutor] How to store scores of a race's players

2019-03-26 Thread Bob Gailer
On Mar 26, 2019 6:55 AM, "^Bart" wrote: > > Hello! > > I need to store scores of three players for more than a race, after every race the user will read "Is the competition finished?", if the competition if finished the user will see the winner who got higest score: > Thank you for reaching out to

Re: [Tutor] How to create a structure from a Log file

2019-03-11 Thread Bob Gailer
On Mar 11, 2019 2:53 AM, "Asad" wrote: > > Hi All , > >I think this format would be easy in a row and table format > > Date > Time > Message > 1/21/2019 > 10:13:14.237 CET > Method Entry. workDir=/tmp frameworkHome=/u01/app/oracle/product/ 12.2.0.1/dbhome_1 For me the easiest would be

Re: [Tutor] How to create a structure from a Log file

2019-03-10 Thread Bob Gailer
Thank you for showing us a sample of the log file. That is half the battle. Would you now reformat a couple of the lines so that we can see how you'd like to see them. It also may be the case that the advice given by others will be sufficient to guide you __

Re: [Tutor] How to create a structure from a Log file

2019-03-09 Thread Bob Gailer
Would you give us more information? What is an example of a log file? How would you like to see it presented? The more information you give us the easier it is for us to help. On Mar 9, 2019 11:20 AM, "Asad" wrote: Hi All , I would like to know , how can I approach this problem to cr

Re: [Tutor] Python

2018-12-20 Thread Bob Gailer
On Dec 20, 2018 12:17 PM, "Mary Sauerland" wrote: > > Hi, > > I want to get rid of words that are less than three characters but I keep getting errors. I tried multiple ways but keep getting errors. Hi Mary welcome to the tutor list. We love to help. We are a few volunteers. It is very difficult

Re: [Tutor] Extract URL

2018-12-13 Thread Bob Gailer
On Dec 13, 2018 2:01 PM, "Sammy Lee" wrote: > > I need help on the problem stated below. > > > Given a URL, open the webpage and return the first anchor link url (a href). > > > def extract_url_link(url): Same comments as my other two emails. ___ Tutor

Re: [Tutor] Python function

2018-12-13 Thread Bob Gailer
On Dec 13, 2018 1:55 PM, "Sammy Lee" wrote: > > How do I create a python function that opens a CSV file and determines how many columns > of data are in the file? The CSV files have been randomly generated from https://www.mockaroo.com/ > > def csv_column_count(openfile): Same comments as I made

Re: [Tutor] Long Lines techniques

2018-12-13 Thread Bob Gailer
t if it starts at the beginning of a statement. Hope this helps Bob gailer ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Open webpage and save CSV

2018-12-13 Thread Bob Gailer
're using and what version of python. You will need the services of the urllib. request module to get the contents of a web page. So start with that. > Given a URL, open the webpage and save the CSV to a given file path. > > > def save_

Re: [Tutor] I need help with my project

2018-11-28 Thread Bob Gailer
tten any Python program? Show us the program. Tell us where you are stuck. We really like to help but we do not have any crystal balls to look into. Help us understand your situation fully. Bob Gailer ___ Tutor maillist - Tutor@python.org To unsubs

Re: [Tutor] seeking beginners tutorial for async

2018-11-19 Thread Bob Gailer
> Can you be more specific what you're looking for? For starters a minimal executable program that uses the async keyword. On the JavaScript side this is trivial and easily understood. I did find in the python documentation a hello world program that uses async IO. It helped me understand how t

[Tutor] seeking beginners tutorial for async

2018-11-18 Thread bob gailer
://javascript.info/promise-basics, but trying to map it to python is very frustrating. The python docs also do not help. Can you point me to any resources that are actually useful to a beginner? Bob Gailer guru of many languages including Python ( up till now

Re: [Tutor] how to print lines which contain matching words or strings

2018-11-18 Thread Bob Gailer
On Nov 18, 2018 1:19 PM, "Bob Gailer" wrote: > > On Nov 18, 2018 12:14 PM, "Asad" wrote: > > > > Hi All , > > > >I have a set of words and strings : > > > > like : > > > > p = [A ,"B is good" ,123456 , &

Re: [Tutor] how to print lines which contain matching words or strings

2018-11-18 Thread Bob Gailer
attern in p > > thanks, you are welcome, but I'm not sure what you're thanking us for. I don't see any kind of request in your email. There are various resources on how to ask effective questions. You might try Googling that topic. I have more that I will say later. Bob Gailer

Re: [Tutor] Require Python assistance

2018-11-09 Thread Bob Gailer
asier it becomes for us to help you. Google is your friend here. For example try searching Google for "Elliptic Curve Cryptography python" and suggestion so that I can improve my computing skills (please see the attached file) Bob Gailer __

Re: [Tutor] Request for help with code

2018-11-06 Thread Bob Gailer
On Nov 6, 2018 4:51 PM, "Joseph Gulizia" wrote: > > I'm using the bookazine "The Python Book" First Edition on pages 13-14 it > gives the code (listed further below). > > It asks for user to state a given number of integers (for example 4)...then > user enters integers. It doesn't stop seeking i

Re: [Tutor] (no subject)

2018-10-27 Thread Bob Gailer
On Oct 27, 2018 7:48 AM, "Jesse Stockman" wrote: > > Hi there > > I need to draw a patten with turtle in python 3.7 but I cant get it to work here are the specs of the pattern and my code so far can you please help Thank you for asking for help. It would help us if you were more specific. "Can't

Re: [Tutor] Python Help

2018-10-26 Thread Bob Gailer
On Oct 26, 2018 1:20 PM, "Adam Eyring" wrote: > > Try this cleaned up version with colons in the right places, dollar signs removed, and other corrections: Does it do what you want? > beefmeals=int(input("Enter number of beef meals: ")) > shitmeals=int(input("Enter number of vegan meals: ")) > p

Re: [Tutor] Python Help

2018-10-26 Thread Bob Gailer
On Oct 26, 2018 6:11 AM, "Ben Placella" wrote: > > I need to write code that runs a cost calculating program with many > different variables and I honestly don't understand it Could you be more specific? What exactly don't you understand, or even better what do you understand? my code is: How

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
More comments on code: guess = raw_input("[pod #]> ")     if int(guess) != good_pod: If user enters something that will not convert to integer an exception will be raised. For example >>> int('a') Traceback (most recent call last):   File "", line 1, in ValueError: invalid literal

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
On 10/14/2018 1:42 PM, Mats Wichmann wrote: Hint here: don't use 'map' as your own variable name, since it's a built-in function. Absolutely, I am always warning others about this gotcha. In this case map is local to add_to_map so it does not affect then global namespace. The reason I used it

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
More comments: User Friendly? I hope this game is not intended for actual use. No one will be able to guess the correct actions in a reasonable time. or 3 digit random code given 10 tries for any one code. I for one would give up pretty quickly. The original colossal

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
On 10/13/2018 4:25 AM, Mariam Haji wrote: ... Your problem intrigued me enough to spend some time "fixing" your program so it will compile with no errors and run at least the initial case where I entered "shoot!" Here are the problems I found: (line numbers refer to your original code) - spell

Re: [Tutor] python game error

2018-10-13 Thread Bob Gailer
suggestions: 1-Use triple-quoted strings: print """take the short-cut!""' 2 - make the program much simpler to start with. The usual approach to developing programs like this is to start simple get the simple things working right then add more complicated scene descriptions. Even better: separa

Re: [Tutor] Python programming help!

2018-09-23 Thread Bob Gailer
On Sep 23, 2018 3:33 AM, "V E G E T A L" wrote: > > Hello folks! So, I'm pretty much a noob still experimenting with basic > commands. I wanted to make a code that checks if the value of one variable > is less, equal or greater than the other. Pretty simple right? But then, > this problem emerged

Re: [Tutor] help with code

2018-03-11 Thread Bob Gailer
On Mar 11, 2018 6:25 AM, "Leslie SimondeMontfort via Tutor" < tutor@python.org> wrote: > > Hi, I wondered if there is someone that can help me with this code. I have to assume that you are very new to python. Have you written a Python program that runs the way you want it to? It is often useful t

Re: [Tutor] I have a problem with def

2018-02-23 Thread Bob Gailer
On Feb 23, 2018 3:58 AM, "David Bauer" wrote: > > it doesn't work, you are suppsed to declare a function as def func() and it > comes back as: > > File "", line 1 > def func() > ^ > SyntaxError: invalid syntax > > that is not expected I would also expect def to turn red because it

Re: [Tutor] Data Structures printing and Python Package creation

2018-02-03 Thread Bob Gailer
On Feb 3, 2018 2:09 PM, "Daniel Bosah" wrote: > > I'm in a research group for school, and my first task is to learn how to > make a Python package and to learn how to print out all types of data > structures. Are there resources I can be pointed to to help me out. https://python-packaging.readthe

Re: [Tutor] Writing to a file

2018-01-19 Thread Bob Gailer
= On Jan 18, 2018 5:45 PM, "Devansh Rastogi" wrote: > > Hello, > > I'm new to python and programming as > > from collections import Counter > import json > I don't see any value for having a class. All you need are functions and global variables > class Files: > def __init__(self, filename):

Re: [Tutor] application development

2017-12-09 Thread bob gailer
On 12/9/2017 2:09 PM, Ayanlade Timilehin via Tutor wrote: Goodday, I'm a Windows user and I am interested in developing android applications but I can't find any tutorial resource online. Please how can you help. Google "android development tutorial". If you can't find what you are looking for

Re: [Tutor] Counting iterations of a function

2017-11-30 Thread Bob Gailer
On Nov 30, 2017 12:56 PM, "Michael Dowell" wrote: > > Hello, I'm trying to code a magic 8-ball program and it needs to include a > counter for the number of questions asked. I'm having a hard time > implementing a count, and need a little help. I had tried to implement it > in the main() function,

Re: [Tutor] beginning to code

2017-09-10 Thread Bob Gailer
On Sep 10, 2017 8:40 AM, "Senthil Kumaran" wrote: > > > unindent does not match any outer indention level > > Means that your Intendentaion is not proper. You should align your print > statement and rest to the same level as if statement. > > Use a proper editor that supports Python Syntax. > Also

Re: [Tutor] unknown syntax error

2016-12-15 Thread bob gailer
On 12/11/2016 11:30 AM, oliver patterson wrote: hey i dont know if this is the right place but i was just coding in idle and kept getting this syntax error and i can not see m to fix it here is my bit of code: my_age=14 age=input("How old are you?:") print("type start()") def start(): pri

Re: [Tutor] (no subject)

2016-12-10 Thread Bob Gailer
On Dec 10, 2016 12:15 PM, "Tetteh, Isaac - SDSU Student" < isaac.tet...@jacks.sdstate.edu> wrote: > > Hello, > > I am trying to find the number of times a word occurs on a webpage so I used bs4 code below > > Let assume html contains the "html code" > soup = BeautifulSoup(html, "html.pa

Re: [Tutor] 1 to 49 numbered grid

2016-12-08 Thread Bob Gailer
On Dec 8, 2016 8:52 AM, "M Ali" wrote: > > Hi Team > > I was wondering if you can help me, as I am struggling to create a numbered grid in Python. I am trying to be able to create a snakes and ladders game in Python and it must have a numbered grid and involve 2 players. I would appreciate it if y

Re: [Tutor] String within a string solution (newbie question)

2016-10-27 Thread Bob Gailer
BubOn Oct 27, 2016 8:38 AM, "Wish Dokta" wrote: > > Hello Alan, > > Thank you for the reply. > > I have actually fixed that bug. If you are bored or for some other reason > would like to assist a newbro my code is here: > > main: http://pastebin.com/LgbeywiB > functions: http://pastebin.com/vU7zzJ

Re: [Tutor] String within a string solution (newbie question)

2016-10-26 Thread Bob Gailer
On Oct 26, 2016 2:07 PM, "Wish Dokta" wrote: > > Hello, > > I am currently writing a basic program to calculate and display the size of > folders with a drive/directory. To do this I am storing each directory in a > dict as the key, with the value being the sum of the size of all files in > that d

Re: [Tutor] Adding numbers within a string

2016-10-12 Thread Bob Gailer
On Oct 12, 2016 4:09 AM, "LQ Soh" wrote: > > To whom it may concern, > Can someone enlighten me as to how you can create a function such > that sum_numbers('10 5 8'), when run, will give an answer of 23, without > using str.split() and using a for loop def sum_numbers(x): for x in [1]:

Re: [Tutor] Python Word Problems(Student) MORE ISSUES

2016-10-06 Thread bob gailer
On 10/6/2016 10:15 AM, Zeel Solanki wrote: def filter_long_words(words, n): for x in words.split(): return filter(lambda x: len(x) > n, words) print filter_long_words(raw_input("Enter a list of words with spaces in between."), raw_input("Enter a number.")) raw_input() always returns a st

Re: [Tutor] Python Word Problems(Student)

2016-10-06 Thread bob gailer
On 10/6/2016 10:15 AM, Zeel Solanki wrote: def filter_long_words(words, n): for x in words.split(): return filter(lambda x: len(x) > n, words) print filter_long_words(raw_input("Enter a list of words with spaces in between."), raw_input("Enter a number.")) raw_input() always returns a st

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

2016-09-17 Thread Bob Gailer
On Sep 17, 2016 4:55 PM, "Sharon Wallace" wrote: > > Would you please help me with the last piece of this assignment? > > > > This is my code: > > > > largest = None > > smallest = None > > > > while True: > > num = raw_input("Enter a number: ") > > if num == "done

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

2016-09-16 Thread Bob Gailer
On Sep 16, 2016 8:12 PM, "Sharon Wallace" wrote: > In addition to showing us your code , Please show us whatever Trace back you got when you ran the code. I would guess you are either getting an indentation error or syntax error in the vicinity of line that begins if num =. > inp = raw_input > >

Re: [Tutor] Python Assignment

2016-08-02 Thread Bob Gailer
On Aug 2, 2016 4:42 AM, "Justin Korn via Tutor" wrote: > > To whom it may concern, > > I need help on this assignment: > > > Create a new class, SMS_store. The class will instantiate SMS_store objects, similar to an inbox or outbox on a cellphone: > my_inbox = SMS_store() > This store can hold mul

Re: [Tutor] Help me out please

2016-07-19 Thread Bob Gailer
On Jul 19, 2016 9:24 AM, "Marc Sànchez Quibus" wrote: > > Hi, > First of all I'm gonan introduce myself. My name is Marc and I'm a student > and also a python's programmer begginer. I've been studying/learning python > and now I need some help to finish my project. > I have two scripts, one of the

Re: [Tutor] rock paper scissor lizard spock help

2016-06-14 Thread Bob Gailer
On Jun 14, 2016 4:05 PM, "Katelyn O'Malley" wrote: > > Hi I am just getting into python and I am trying to create a rock paper > scissor lizard spock game for 3 people and I cannot figure out the scoring > of the players I attached the code below, any help/ideas is much > appreciated. Welcome to p

Re: [Tutor] How to make object disappear?

2016-05-09 Thread Bob Gailer
On May 9, 2016 8:01 AM, "Lisa Hasler Waters" wrote: > > Dear Tutor, > > My students and I are creating a maze game in tkinter. We are trying to > make the ball disappear when it hits the wall (black lines). We are not > having much luck. The following code has run the best, but still, the ball > d

Re: [Tutor] Python Homework CORRECTION rules -> tools (programs)

2016-05-04 Thread Bob Gailer
On May 3, 2016 2:38 PM, "Katie Tuite" wrote: > > So I know what a color gradient is, I don't know how to compute it though. As far as programs, they told us we should use matplotlib, NumPy, and SciPy to display graphs. Thanks. Always reply to the list as well as me. Computing gradient. Each colo

Re: [Tutor] Python Homework CORRECTION rules -> tools (programs)

2016-05-03 Thread bob gailer
On May 3, 2016 3:04 AM, "Katie Tuite" > wrote: > > So the question is: > > "a contour plot is a graphic representation of the relationships among three numeric variables in two dimensions. Two variables are for X and Y axes, and a third variable Z is for contour lev

Re: [Tutor] Dictionary Question

2016-05-02 Thread Bob Gailer
On May 2, 2016 5:27 PM, "Jason N. via Tutor" wrote: > > Hello, > Wanted to ask if its possible to have a dictionary that can be looked up by either values? > For example, > mydic = {"A: "Apple", "B": "Banana"}When user inputs "A" I want "Apple" to come. But if the user enter "Apple" I want "A" to

Re: [Tutor] Python Homework

2016-05-01 Thread Bob Gailer
On May 1, 2016 4:33 AM, "Katie Tuite" wrote: > > I'm trying to do a python homework question and cannot figure out how to > start at all. > > This is the question > > [image: pasted1] As you can see attachments don't work. Include the code in your post. > __

Re: [Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Bob Gailer
On May 1, 2016 8:04 AM, "Olaoluwa Thomas" wrote: > > The novice Python programmer is back. Welcome back. We are here to help you when you are stuck. Telling us something is broken is not adequate. Tell us-what you are expecting the program to do and what results you're getting. > > I'm trying to i

Re: [Tutor] "List" object is not callable

2016-04-30 Thread bob gailer
On 4/30/2016 3:27 PM, Alex Kleider wrote: On 2016-04-30 11:51, Jason N. via Tutor wrote: Hello, I found this simple script online but when I execute it I get the following error: "TypeError: 'list' object is not callable" Here is the code sample:import subprocess ls_output= subprocess.check_o

Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Bob Gailer
On Mar 29, 2016 2:03 PM, "Lisa Hasler Waters" wrote: > > I continually get this error: > > > Traceback (most recent call last): > File "/Users/lwaters/Desktop/pygameTest.py", line 1, in > import pygame, sys > File > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pac

Re: [Tutor] Advice on multi-dimensional data storage

2016-03-19 Thread Bob Gailer
On Mar 16, 2016 5:59 AM, "Matt Williams" wrote: > > Dear Tutors, > > I am looking for some advice. I have some data that has three dimensions to > it. I would like to store it such that one could manipulate (query/ update/ > etc.) by dimension - so it would be feasible to ask for all of the data >

Re: [Tutor] Can This Script Be Modified to Read Many Files?..

2016-01-25 Thread Bob Gailer
On Jan 25, 2016 6:26 PM, "Sam Starfas via Tutor" wrote: > > Hi,I am very new to Python, but having fun learning. > I need to have a script read all of the XML files contents that are in a directory, pull out the contents of an element, in my case , and list them in an output file. I have this scri

Re: [Tutor] new line to list of strings send by email

2016-01-08 Thread Bob Gailer
On Jan 8, 2016 11:03 AM, "Emil Natan" wrote: > > Hello list, > > I have a function which receives a string and sends it as a body of an > email. > > It is a part of a program which does certain checks on network > infrastructure. When a check fails I append error message to a > error_collector lis

Re: [Tutor] noob python question

2015-10-26 Thread Bob Gailer
Welcome to the tutor list. In order for us to help you please post the following: Python version Operating system The code you are running To trace back you are getting The trace back will be several lines of references to various programs and line numbers Once we have that information then it bec

Re: [Tutor] I don't understand why this program is said to be "not defined" when I test it.

2015-10-17 Thread Bob Gailer
Also: Briefly describe problem 22 Show us what you did to test the program It would be better to test for integer before doing a numeric comparison There is no need ever to compare a boolean expression to true or false. All you need is either if condition or if not condition. A good short cut for a

Re: [Tutor] Why should modules or packages should define their own domain-specific base exception class?

2014-04-14 Thread bob gailer
On 4/14/2014 10:09 PM, brian arb wrote: I don't quite understand why the google python style guide recommends that packages and modules we write should avoid using the catch-all except. Instead the guide encourages you to write domain specific exception classes. class Error(Exception): """.

Re: [Tutor] Python & algorithms (Lang line simplification algorithm)

2014-04-14 Thread bob gailer
On 4/14/2014 11:30 AM, Laura Kauria wrote: Thanks a lot for all the help! I got the courage to start at least.. Some requests regarding posts. 1) put your comments following the relevant text rather than at the top. 2) delete old (irrelevant) text. 4) be more clear with your questions. I star

Re: [Tutor] Refining Code

2014-04-11 Thread bob gailer
On 4/10/2014 6:26 PM, Saba Usmani wrote: My task is : Welcome to the tutor list. In what school are you learning Python? What version of Python? What operating system? What do you use to write and run your code? What Python elements have you studied so far? Your code can be greatly simpli

Re: [Tutor] Range within a range

2014-04-11 Thread bob gailer
On 4/11/2014 1:13 PM, Andoni Gorostiza wrote: Hi tutor. I need your help with something I don't understand. In the tutorial, it mentions an example of a range within a range. I'll keep it simplified. How exactly does this work? I'll provide a few examples. >>> for x in range(0,5): ...for n in

Re: [Tutor] difference between expressions and statements

2014-04-10 Thread bob gailer
On 4/10/2014 5:48 PM, Jared Nielsen wrote: Thanks for the thorough answer, Bob. I now understand the difference. Thanks for the ACK. It helps me remember I have something to contribute. ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] difference between expressions and statements

2014-04-10 Thread bob gailer
Caveat: I began this before there were any other responses. So this may be overkill - but I ike to be thorough. On 4/9/2014 12:49 PM, Jared Nielsen wrote: Hi Pythons, Could someone explain the difference between expressions and statements? I know that expressions are statements that produce a

Re: [Tutor] Vending machine problem.

2014-04-02 Thread bob gailer
On 4/2/2014 5:06 PM, Sebastien Gomez wrote: i am using python 3.2 windows vista This is my last email to you. Communicating with you is way too time consuming; you consistently do not provide all the information I request, nor do you include the tutor list in your responses. If you want any

Re: [Tutor] Vending machine problem.

2014-04-02 Thread bob gailer
On 4/1/2014 5:09 PM, Sebastien Gomez wrote: I have started my code but there are some errors including indentation and syntax, please fix it if you can: Did you miss my request that you send a copy to the tutor list (tutor@python.org)? Were there any more specifications in the assignment? P

[Tutor] Vending machine problem.

2014-04-01 Thread bob gailer
On 4/1/2014 3:26 AM, Sebastien Gomez wrote: The vending machine must have 5 prices with items it should accept 10p, 20p 50p and £1 coins it should allow the user to purchase a item and give him a choice of purchasing something else. it should display the remaining credit once the item is purcha

[Tutor] Vending machine problem.

2014-04-01 Thread bob gailer
I'm posting this to include you in this conversation. Recently I got the following Request: can you write me a code in python please or if you have one already my response: print('hello world') what more can I do for you? (next two lines are best guesses as I can't find the relevant emails.

Re: [Tutor] How to create a sqlite table schema dynamically

2014-03-20 Thread bob gailer
On 3/19/2014 8:19 AM, Toni Fuente wrote: Hello everyone, I am stack with a problem that I can't find a solution: I need to create a sqlite schema dynamically, I've got a dictionary with text keys: "RedHat", "CentOS", "SLES9",..., "etc", "etc" My intention was at the time of creating the table

Re: [Tutor] improvements on a renaming script

2014-03-09 Thread bob gailer
On 3/9/2014 3:22 PM, street.swee...@mailworks.org wrote: Hello all, A bit of background, I had some slides scanned and a 3-character slice of the file name indicates what roll of film it was. This is recorded in a tab-separated file called fileNames.tab. Its content looks something like: p01

Re: [Tutor] i dont understand this code

2014-02-22 Thread bob gailer
On 2/22/2014 7:26 AM, piyush joshi wrote: Can anyone help me out in understanding this code Your question is kinda vague. Exactly what do you not understand? # import os rotationMatrix1 = [7, 1, 5, 3, 0, 6, 2, 5, 2, 3, 0, 6, 1, 7, 6, 1, 5, 2, 7, 1, 0, 3, 7, 6, 1, 0, 5, 2, 1, 5, 7, 3, 2, 0

Re: [Tutor] Code runs in interpreter but won't output to stdout

2014-01-31 Thread bob gailer
On 1/29/2014 8:59 PM, scurvy scott wrote: Please always reply to the tutor list so we can all play with your question. On 1/28/2014 9:12 PM, scurvy scott wrote: Hi guys, I'm trying to figure out why my code won't output to terminal, but will run just fine in interpreter. I'm using

Re: [Tutor] Code runs in interpreter but won't output to stdout

2014-01-29 Thread bob gailer
On 1/28/2014 9:12 PM, scurvy scott wrote: Hi guys, I'm trying to figure out why my code won't output to terminal, but will run just fine in interpreter. I'm using python 2.7.3 on Debian Linux/Crunchbang. Here is my code. import requests from bs4 import BeautifulSoup as beautiful import sys de

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread bob gailer
On 1/24/2014 10:28 PM, bob gailer wrote: Sorry for misspelling parens. My reason for requesting the various names is that it makes communication clear, explicit and terse. When someone says just "brackets" what does he actually mean? For more grins see http://www.codinghorror.com

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread bob gailer
On 1/24/2014 4:47 AM, Steven D'Aprano wrote: Hi Tobias, and welcome. On Thu, Jan 23, 2014 at 07:34:18PM -0700, Tobias Quezada wrote: hello community,i am a newbie to python and program in general. the script below works in python 2.7.3 on windows but not in the python 2.7.3 ubuntu terminal.

Re: [Tutor] Suggestion required on python as scripting language

2013-12-08 Thread bob gailer
On 12/8/2013 1:59 AM, Shankar Donepudi wrote: Hi All, I am working as test engineer in Networking in storage domain. We have decided to automate our testing and have chosen python for the same. We have basic knowledge on python so can anyone suggest good tutorials for writing automation scrip

Re: [Tutor] Automation

2013-11-03 Thread bob gailer
elements in a list. Apply min() and max() to the list. Use list.index() to get the position of the value in the list. Or write your own program to examine each value, tracking when it gets smaller (bigger) and also tracking the index where that change occurs, -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
t;Phone Translator " phoneNumber = raw_input ("Please enter the phone number: ").upper() phoneNumber = phoneNumber.translate(trans) print phoneNumber[:3] + "-" + phoneNumber[3:] def backwardString(): print "not implemented" main() -- Bob Gailer

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
rmatting. Each %s is replaced by the next string in the tuple. Just be sure you have exactly 7 characters in the list or this will fail. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscri

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
red output. One is: collect the characters in one list, say numberList Then use slicing to insert the "-" e.g. numberList[3:3] = "-" Then print "".join(numberList) -- Bob Gailer 919-636-4239 Chapel Hill NC __

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
ot;L": n = 5 all the numbers should be characters e.g. n = "5" etc. There are many ways to get the desired output. One is: collect the characters in one list, say numberList Then use slicing to insert the "-" e.g. numberList[3:3] = "-&

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
inting out this way. 5 5 5 5 6 Please post the new program. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dictionary from a text file

2013-10-31 Thread bob gailer
x27;Patch_501', 'release' : '13/09/11' }, 'ESXi500-20001' : { 'call' : Patch, 'name' :'ExpressPatch501', 'release' : '13/09/11' }, }, }, [snip] Does it have to be in a dictionary format? I'd rather use sq

Re: [Tutor] Help with converting a string into a integer

2013-10-31 Thread bob gailer
" > elif n == "J" or n == "K" or n == "L": > n = 5 > elif n == "M" or n == "N" or n == "O": > n = 6 > elif n == "P" or n == "Q" o

Re: [Tutor] Geometric sequence

2013-10-30 Thread bob gailer
On 10/30/2013 1:08 PM, Peter O'Doherty wrote: Hi List, I know a geometric sequence can be produced by: series = [2**x for x in range(7)] But I would like to curtail the sequence before the last element excedes a certain value. import itertools series = [2**x for x in itertools.takewhile(lamb

Re: [Tutor] Python String Help

2013-10-29 Thread bob gailer
nts that tell me "You may want to iterate over the letters ch in s as in the for loop above, and inside that for loop, count the number of letters that are in s and come before the loop variable ch. You will also need an accumulator to build the permutation t

Re: [Tutor] UnicodeDecodeError while parsing a .csv file.

2013-10-28 Thread bob gailer
byte"and therefore a continuation byte was expected but where the 0xe9was found. BTWhen I divide 1173 by 126 I get something close to 9 characters per lne. That is not possible, as there would have to be at least 16 characters in each line. Best you send us at least the first 130 lines so we can play with the file. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Want to keep to two decimal places for currency

2013-10-24 Thread bob gailer
On 10/24/2013 2:09 PM, Danny Yoo wrote: Related: I saw a picture the other day on Google+ of an mailing envelope whose zip code was written in scientific notation. That;s odd - since ZIP codes are character, not integer, -- Bob Gailer 919-636-4239 Chapel Hill NC

Re: [Tutor] [OT] Programming practice was: Re: string list in alphabetical!

2013-10-22 Thread bob gailer
ations. I recall one student struggling with his first Basic program. I recommended he walk thru it line by line, and I demonstrated that technique. Amazed he exclaimed "In that much detail?". -- Bob Gailer 919-636-4239 Chapel Hill NC __

Re: [Tutor] Tutor] string list in alphabetical!

2013-10-21 Thread bob gailer
rily complex and somewhat hard to read. Especially for a rank beginner (the OP) Also has an unnecessary statement (input_content = []) IMHO it is more customary and a lot simpler to process the lines in a file thusly: for line in open(file1, 'r'): process the line -- Bob

Re: [Tutor] Cannot understand object initiation

2013-10-12 Thread bob gailer
a callable object that is an attribute of User. filter_by is a callable object that is an attribute of query. first is a callable object that is an attribute of filter_by. Nothing in the above suggests object creation. HTH -- Bob Gailer 919-636-4239 Chap

  1   2   3   4   5   6   7   8   9   10   >