Re: [Tutor] looking for tutor

2010-01-14 Thread Ken G.
maxwell hansen wrote: I have a decent amount of knowledge with QBASIC and am looking for a tutor who can help me learn the pythonic equivalent of QBASIC features and commands such as COLOR, LOCATE, IF...THEN, GOTO, loops, etc. as well as visual things and objects, which arent available in QBAS

[Tutor] Future Appointments...

2010-01-31 Thread Ken G.
Below is a program to determine when my next appointment is. Line numbers are provided for reference only. 01 import time, datetime, sys 02 from datetime import date 03 today = date.today() 04 print 05 print "Today date is:", today 06 todaystr = str(today) 07 print 08 print "Corrected d

[Tutor] Complied Python program...

2010-01-31 Thread Ken G.
In using Geany, I have the ability to complied a Python program. For example, I can complied "program.py" to program.pyc." What is the purpose of a complied Python program? Can it be transported to another computer without Python installed as run as it is? For example, use "run program.pyc"

Re: [Tutor] Future Appointments...

2010-01-31 Thread Ken G.
python.org [mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of Ken G. Sent: Sunday, January 31, 2010 10:41 AM To: tutor@python.org Subject: [Tutor] Future Appointments... Below is a program to determine when my next appointment is. Line numbers are provided for reference only.

[Tutor] rstrip in list?

2010-02-09 Thread Ken G.
I printed out some random numbers to a list and use 'print mylist' and they came out like this: ['102\n', '231\n', '463\n', '487\n', '555\n', '961\n'] I was using 'print mylist.rstrip()' to strip off the '\n' but kept getting an error of : AttributeError: 'list' object has no attribute 'rstrip

Re: [Tutor] rstrip in list?

2010-02-09 Thread Ken G.
Kent Johnson wrote: On Tue, Feb 9, 2010 at 10:28 AM, Ken G. wrote: I printed out some random numbers to a datafile and use 'print mylist' and they came out like this: ['102\n', '231\n', '463\n', '487\n', '555\n', '961\n

Re: [Tutor] rstrip in list? (SOLVED)

2010-02-09 Thread Ken G.
ile.readlines(): print line.strip('\n'), mylist.append(line.strip('\n')) Further work and studying needed here. LOL. Ken Steven D'Aprano wrote: On Wed, 10 Feb 2010 02:28:43 am Ken G. wrote: I printed out some random numbers to a list and use 'print mylist&

[Tutor] Embarrassed...

2010-02-09 Thread Ken G.
I am a little embarrassed. I just happen to found a program I wrote in December that create random numbers into a file, copy the numbers into a list, print the numbers unsorted and sorted from the list without printing '\n'. Nevertheless, I do thanks you all for trying to help me out. Ken

Re: [Tutor] Bowing out

2010-03-03 Thread Ken G.
Thanks for helping out. I enjoyed readying your posts. Good luck on your future endeavors. Ken Kent Johnson wrote: Hi all, After six years of tutor posts my interest and energy have waned and I'm ready to move on to something new. I'm planning to stop reading and contributing to the list. I

[Tutor] Changing the value in a list

2010-03-11 Thread Ken G.
If the following program change list[2] to 2010, replacing 1997 (and it does), why doesn't the second program work in changing line[ 9:11] to 20 from 08? FIRST PROGRAM: list = ['physics', 'chemistry', 1997, 2000] print list[2] list[2] = 2010 print list[2] OUTPUT: 1997 2010

Re: [Tutor] Changing the value in a list

2010-03-11 Thread Ken G.
Okay, now, it is understood. Thanks. Ken Andre Engels wrote: On Thu, Mar 11, 2010 at 4:32 PM, Ken G. wrote: If the following program change list[2] to 2010, replacing 1997 (and it does), why doesn't the second program work in changing line[ 9:11] to 20 from 08? FIRST PROGRAM:

Re: [Tutor] Changing the value in a list

2010-03-11 Thread Ken G.
Okay, I understand now. Thanks! Ken Steve Willoughby wrote: On Thu, Mar 11, 2010 at 10:32:45AM -0500, Ken G. wrote: list = ['physics', 'chemistry', 1997, 2000] This is a list of 4 elements, and lists allow elements to be changed, so list[2] = 2010

Re: [Tutor] First program

2010-03-13 Thread Ken G.
I am using Ubuntu 9.04 and I have versions 2.6.2 and 3.0.1+ installed. Look for IDLE in Add/Remove Applications. Perhaps, you may have a different version of Ubuntu. Ken Ray Parrish wrote: Yes, I'm using 2.45.2 as that is the highest version available in the Ubuntu repositories, and I'd l

[Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
What is a method I can use to find duplicated entry within a sorted numeric file? I was trying to read a file reading two lines at once but apparently, I can only read one line at a time. Can the same file be opened and read two times within a program? For example, a file has: 1 2 2 3 4 4

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks! You gave me something to do for the rest of the afternoon. Ken Steven D'Aprano wrote: On Sun, 21 Mar 2010 03:34:01 am Ken G. wrote: What is a method I can use to find duplicated entry within a sorted numeric file? I was trying to read a file reading two lines at onc

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
20, 2010 at 11:34 AM, Ken G. <mailto:beach...@insightbb.com>> wrote: What is a method I can use to find duplicated entry within a sorted numeric file? I was trying to read a file reading two lines at once but apparently, I can only read one line at a time. Can the

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks for letting me know. Corrective actions taken. Ken Luke Paireepinart wrote: On Sat, Mar 20, 2010 at 4:50 PM, Ken G. <mailto:beach...@insightbb.com>> wrote: Thanks for the info. I already adopted a program from another person and it works like a charm. As

[Tutor] Looking for duplicates within a list

2010-06-11 Thread Ken G.
I have been working on this problem for several days and I am not making any progress. I have a group of 18 number, in ascending order, within a list. They ranged from 1 to 39. Some numbers are duplicated as much as three times or as few as none. I started with one list containing the numbe

Re: [Tutor] Looking for duplicates within a list

2010-06-11 Thread Ken G.
vijay wrote: Check out this code l= [1, 2, 3, 3, 4] d={} for item in l: d.setdefaut(item,0) d[item] +=1 print d {1: 1, 2: 1, 3: 2, 4: 1} with regard's vijay Thanks. Very interesting concept. Ken ___ Tutor maillist - Tutor@python.or

Re: [Tutor] Looking for duplicates within a list

2010-06-11 Thread Ken G.
Alex Hall wrote: On 6/11/10, Ken G. wrote: I have been working on this problem for several days and I am not making any progress. I have a group of 18 number, in ascending order, within a list. They ranged from 1 to 39. Some numbers are duplicated as much as three times or as few as none

Re: [Tutor] Looking for duplicates within a list [SOLVED]

2010-06-11 Thread Ken G.
Sander Sweers wrote: On 11 June 2010 15:57, Ken G. wrote: In any event, if a number is listed more than once, I would like to know how many times, such as 2 or 3 times. For example, '3' is listed twice within a list. If you do not have top keep the order of the number this

Re: [Tutor] Looking for duplicates within a list [SOLVED]

2010-06-11 Thread Ken G.
Jose Amoreira wrote: On Friday, June 11, 2010 02:57:34 pm Ken G. wrote: I have been working on this problem for several days and I am not making any progress. I have a group of 18 number, in ascending order, within a list. They ranged from 1 to 39. Some numbers are duplicated as much as

Re: [Tutor] Looking for duplicates within a list [SOLVED]

2010-06-11 Thread Ken G.
Alan Gauld wrote: "Ken G." wrote In any event, if a number is listed more than once, I would like to know how many times, such as 2 or 3 times. For example, '3' is listed twice within a list. Have you looked at the count method of lists? Something like:

Re: [Tutor] Looking for duplicates within a list [SOLVED]

2010-06-11 Thread Ken G.
Dave Angel wrote: Ken G. wrote: I have been working on this problem for several days and I am not making any progress. I have a group of 18 number, in ascending order, within a list. They ranged from 1 to 39. Some numbers are duplicated as much as three times or as few as none. I started

Re: [Tutor] Looking for duplicates within a list [SOLVED]

2010-06-11 Thread Ken G.
Steven D'Aprano wrote: On Sat, 12 Jun 2010 12:58:19 am Alan Gauld wrote: Have you looked at the count method of lists? Something like: counts = set(( item, mylist.count(item)) for item in mylist if mylist.count(item) > 1) That's a Shlemiel the Painter algorithm. http://www.joelons

Re: [Tutor] Looking for duplicates within a list [SOLVED]

2010-06-11 Thread Ken G.
Hugo Arts wrote: On 11 jun 2010, at 17:49, Steven D'Aprano wrote: On Sat, 12 Jun 2010 12:58:19 am Alan Gauld wrote: Have you looked at the count method of lists? Something like: counts = set(( item, mylist.count(item)) for item in mylist if mylist.count(item) > 1) That's a

Re: [Tutor] Looking for duplicates within a list [SOLVED]

2010-06-11 Thread Ken G.
davidheise...@gmail.com wrote: How about this? List = [1, 2, 3, 3, 3, 4, 5, 5] for Item in list(set(List)): print Item, List.count(Item) - Original Message - *From:* Ken G. <mailto:beach...@insightbb.com> *To:* Steven D'Aprano <mailto:st...@pearwood

[Tutor] Sorting the Dictionary Set?

2010-07-06 Thread Ken G.
Is there a way to sort a dictionary? Assuming I have a dictionary set containing the following: {'02': 1, '03': 1, '12': 1, '15': 2, '14': 2, '04': 3, '05': 1, '19': 1, '32': 1, '28': 1, '27': 1, '17': 2, '25': 1} and using the following code: print ('Printing the result of numbers that

Re: [Tutor] Which version to start with?

2009-10-06 Thread Ken G.
I am just starting on Python 2.6.2 on Ubuntu 9.04 and I am slightly confused with the numerous tutorials and books available for learning the language. Is there any good recommendation for a good but easy tutorial on the Internet to learn Python? Ken wesley chun wrote: On Mon, Oct 5, 2009 a

[Tutor] Using IDLE v2.6

2009-10-24 Thread Ken G.
I just reinstalled Python v2.6.2 due to a computer crash. I reinstalled IDLE v2.6 but I was wondering if there is something better than IDLE. I am using Ubuntu 9.04 so they do have some limited choices available. Thanks for your input. Ken ___ Tuto

[Tutor] Printing Sideway...

2009-11-07 Thread Ken G.
It is possible to print letters sideway in Python? Instead of printing from left to right on the long side of a #10 envelope, I wish to print sideway, printing from the left short edge of envelope to its right short edge. Thanks, Ken ___ Tutor mailli

Re: [Tutor] Printing Sideway...

2009-11-08 Thread Ken G.
Okay, thanks. Understood. It's not a big thing here. Thought I would ask. Ken Alan Gauld wrote: Ken G. wrote: I am using Ubuntu 9.04 as my primary OS. I have Windows XP installed in the first partition (dual boot). I have Python 2.6.2 installed on both OS. The printer is a C

[Tutor] Outputting Data to Printer

2009-11-19 Thread Ken G.
Is there a Python command to send data to printer? I have a Canon MX300 hooked up by USB. I can print from Firefox and Thunderbird. I am using Ubuntu 9.04 and Python 2.6.2. I could print to a file and then use gedit to print out the content of the file but I was wondering if there was an e

Re: [Tutor] Outputting Data to Printer

2009-11-20 Thread Ken G.
Alan Gauld wrote: "Ken G." wrote Is there a Python command to send data to printer? I have a Canon MX300 hooked up by USB. I can print from Firefox and Thunderbird. I am using Ubuntu 9.04 and Python 2.6.2. There is no universal easy way to print stuff unfortunately. In conso

Re: [Tutor] Outputting Data to Printer

2009-11-20 Thread Ken G.
ALAN GAULD wrote: > > There is no universal easy way to print stuff unfortunately. > > In console mode on Unix its not too bad, you can send data > > to lpr, just as you would from the shell. > That is a surprise! I was so use to using lprint as in Basic. BASIC ran on a predefined platform

[Tutor] Breaking out of loop...

2009-11-20 Thread Ken G.
I am trying to break out of a loop posted below. When asked for monthdate, it should break out if I entered the number zero and it does not. GRRR. Been working on this for almost an hour. monthdate = 999 while monthdate <> 0: monthdate = raw_input('Enter the month and date in t

Re: [Tutor] Breaking out of loop...

2009-11-20 Thread Ken G.
Alan Gauld wrote: "Ken G." wrote I am trying to break out of a loop posted below. When asked for monthdate, it should break out if I entered the number zero and it does not. GRRR. Been working on this for almost an hour. monthdate = 999 while monthdate <&

[Tutor] Sorting Data in Databases

2009-11-22 Thread Ken G.
Greeting: Can someone give me a brief outline of sorting data in databases? I have five databases with numeric values for each item. To be more precise, they are sorted by date and if necessary, by time. Currently, I am using Ubuntu 9.04 in the language of Linux and Python is my choice of pr

Re: [Tutor] Sorting Data in Databases

2009-11-22 Thread Ken G.
I have not use the DBMS as I am unaware of them in both languages. Lie Ryan wrote: Ken G. wrote: The way I use to do it in another programming language (Liberty Basic in Windows) was: 1. Count number of data entry in database. 2. Dimension or create an array to equal the maximum number of

Re: [Tutor] Rép. : Sorting Data in Databases

2009-11-23 Thread Ken G.
Luhmann wrote: I'd suggest you load all your data into a list of lists, then use the .sort() method to sort it. The sort method takes a key= argument, which should be a function that does some transformation to your data, then returns something to be compared. for instance: >>> l=[[1,2,3],[

Re: [Tutor] R?p. : Sorting Data in Databases

2009-11-23 Thread Ken G.
Albert Sweigart wrote: Ken, You should probably use the sorting functionality that your DBMS provides. However, if you have a list of strings that end with a new line and start with an apostrophe, you can use list comprehensions to remove them: newlist = [x[1:-1] for x in newlist] You can look

Re: [Tutor] Sorting Data in Databases

2009-11-23 Thread Ken G.
Che M wrote: Ken, I would also recommend trying out databases, if you have an interest. I found them a fun new aspect of using Python. I would recommend using SQLite, which very conveniently comes with Python. Alan Gauld's tutorial that you've read part of has a nice section on Working w

[Tutor] Error writing to file...

2009-12-25 Thread Ken G.
In writing the following program in creating random numbers and writing them to the file, I get an type error in writing to file. I have tried number = random(10,99), number = randint(10.99), and number = random.random(10,00) and still get various errors of writing to file. If I were to REM o

Re: [Tutor] Error writing to file...

2009-12-25 Thread Ken G.
Thinking it was a reply to me on Python Tutor, I translated the following into English for the board. Ken � DIAGORN wrote: Bonjour, Je suis absente jusqu'au 03/01/10 inclus. En cas d'urgence Soprane, contacter notre adresse générique projet.sopr...@teamlog.com. Joyeuses fêtes de fin d'année.

Re: [Tutor] Error writing to file...(SOLVED)

2009-12-25 Thread Ken G.
Thanks! So a file will only take a numeric as a string? Lesson learned. Again, thanks. Ken Amit Sethi wrote: It is as the Error says a type error , the function takes a string and u are passing an int if you put file.write(str(number)) you will not get error .. __

[Tutor] Printing data to a printer...

2010-01-02 Thread Ken G.
Wow, I looked and looked. I can print out my program listing but can not print the resulted data produced by the program. How do I print out on my USB printer the data output of my Python program I ran in my Ubuntu terminal via Geany IDE? I already wrote several programs using raw_input, fil

Re: [Tutor] Printing data to a printer...

2010-01-02 Thread Ken G.
Rich Lovely wrote: 2010/1/2 Ken G. : Wow, I looked and looked. I can print out my program listing but can not print the resulted data produced by the program. How do I print out on my USB printer the data output of my Python program I ran in my Ubuntu terminal via Geany IDE? I already

Re: [Tutor] Python printing to LPT

2011-02-12 Thread Ken G.
On 02/12/2011 10:14 AM, Bill Allen wrote: Is is possible to print directly to an LPT port printer from Python? --Bill I use the following format in my Ubuntu 10.04 usage. It set up a printing file. import os # declare values month = "02"; date = "11"; year = "2011" # open up fi

Re: [Tutor] Python printing to LPT

2011-02-12 Thread Ken G.
On 02/12/2011 09:53 PM, Bill Allen wrote: Ken, Thanks for the great info on doing this on a Linux platform. I am sure I will be trying this with Linux sometime and I'll refer back to this. --Bill I discovered some more information on this at the following link: http://mail.python.org/

Re: [Tutor] New to programming

2011-03-18 Thread Ken G.
You may want to check out a short article entitled "Instant Hacking" by Magnus Lie Hetland. It is an introduction to programming using Python as an example. In the first paragraph thereby mentioned, there is a link to another easy article titled "Instant Python" written by the same author. H

Re: [Tutor] Replying

2011-03-29 Thread Ken G.
I am using v3.1.8 for Mozilla Thunderbird. Ken On 03/28/2011 06:17 PM, Steven D'Aprano wrote: Corey Richardson wrote: Thunderbird has a "reply list" button that I use. It does? What version are you using? ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Beginning Python From Perl

2011-11-08 Thread Ken G.
Not necessary learning from Perl but I would recommend Alan Gauld's online website for learning Python from scratch: http://www.alan-g.me.uk/ Good luck in learning Python. Ken On 11/08/2011 05:14 PM, Jihad Esmail wrote: Hi! I am new to this list so stick with me. I've recentl

Re: [Tutor] [off-topic] Any thread for linux troubleshooting

2011-11-12 Thread Ken G.
On 12/11/11 17:54, Bikash Sahoo wrote: Can you please refer some threads for linux troubleshooting queries ?? Not so much a thread but the Ubuntu web forum is a good starting place and thereare tons of Linux news groups. Try a search on Google groups as your starting point. Also the Linux

[Tutor] File vs. Database (possible off topic)

2011-11-21 Thread Ken G.
It occurred to me last week while reviewing the files I made in using Python, it could be somewhat similar to a database. What would be a different between a Python files and Python databases? Granted, the access in creating them are different, I really don't see any different in the format o

Re: [Tutor] File vs. Database (possible off topic)

2011-11-22 Thread Ken G.
On 11/22/2011 08:13 AM, Steven D'Aprano wrote: Ken G. wrote: It occurred to me last week while reviewing the files I made in using Python, it could be somewhat similar to a database. What would be a different between a Python files and Python databases? Granted, the access in creating

[Tutor] Weird Error

2011-12-17 Thread Ken G.
I have use 'sleep.time(5)' in most of my program but the following error is throwing me for a loss. import time Traceback (most recent call last): File "/home/ken/Python2/Blood Glucose/BloodGlucose04ReadingTimed.py", line 63, in time.sleep(2) AttributeError: 'str' object has no attribut

Re: [Tutor] Weird Error

2011-12-17 Thread Ken G.
On 12/17/2011 10:40 AM, Peter Otten wrote: Ken G. wrote: I have use 'sleep.time(5)' in most of my program but the following error is throwing me for a loss. import time Traceback (most recent call last): File "/home/ken/Python2/Blood Glucose/BloodGlucose04ReadingTimed.p

Re: [Tutor] Github Pygame Example Repository

2011-12-17 Thread Ken G.
The second link should be read as follow: http://flossstuff.wordpress.com/2011/12/17/github-repository-for-pygame-examples/ You had an extra period after http: Ken On 12/17/2011 01:00 PM, ANKUR AGGARWAL wrote: I have created an pygame example repo on github to promote the learning of this API

[Tutor] Which should it be, lists, tuples, dictionary or files?

2012-01-02 Thread Ken G.
I have been using an Open Office Spreadsheet containing basically, the food name, basic serving amount, calories, sodium and carbohydrate. Daily, I entered the servicing amount being eaten and its calculate the amount of calories, sodium and carbohydrate. For some odd reason, I kept losing th

Re: [Tutor] Which should it be, lists, tuples, dictionary or files?

2012-01-02 Thread Ken G.
On 01/02/2012 05:47 PM, Steven D'Aprano wrote: Ken G. wrote: I have been using an Open Office Spreadsheet containing basically, the food name, basic serving amount, calories, sodium and carbohydrate. Daily, I entered the servicing amount being eaten and its calculate the amount of cal

Re: [Tutor] Which should it be, lists, tuples, dictionary or files? [SOLVED]

2012-01-03 Thread Ken G.
On 01/03/2012 06:28 AM, Alan Gauld wrote: On 03/01/12 07:31, Devin Jeanpierre wrote: It's probably worth mentioning that shelve is not secure; loading a saved shelf can involve executing arbitrary python code embedded inside it. This probably isn't important for this particular project, but may

[Tutor] Using a Blackjack Chart...

2012-05-22 Thread Ken G.
I would like to create a Python program in the manner of an using flash card format. That is, a question is asked and you can respond according and you will be notify if you are correct or incorrect. Using such format stated above, I would like to create a Blackjack program. I wish to utiliz

Re: [Tutor] Using a Blackjack Chart...

2012-05-23 Thread Ken G.
On 05/23/2012 09:56 AM, Prasad, Ramit wrote: How can I best utilize such a chart in the Python program? Lists, Tuples, Dictionary or perhaps, a database format such as SQL? I tried using MySQLdb but was unable to use it since I am using Ubuntu 10.04.4 (Linux) as my main OS. My other OS is

Re: [Tutor] sqlite3 question

2012-05-23 Thread Ken G.
On 05/23/2012 12:51 PM, Joel Goldstick wrote: On Wed, May 23, 2012 at 12:11 PM, Khalid Al-Ghamdi wrote: hi all, I'm using Python 3 and have read that you need sqlite to be installed to use the sqlite3 module, but when it is imported it seems to work ok. so, do you need to install it? also, w

Re: [Tutor] Using a Blackjack Chart...

2012-05-24 Thread Ken G.
On 05/23/2012 09:36 PM, Steven D'Aprano wrote: Ken G. wrote: I would like to create a Python program in the manner of an using flash card format. That is, a question is asked and you can respond according and you will be notify if you are correct or incorrect. Is this supposed to

Re: [Tutor] Using a Blackjack Chart...

2012-05-24 Thread Ken G.
On 05/24/2012 10:27 AM, Prasad, Ramit wrote: There's no need for the 200lb sledgehammer of a database to crack this peanut. Thank you Steven for saving me from database hell. LOL. Yes, it would be a text based program. I will start working on this approach today. Again, my thanks. This wou

[Tutor] OT: Searching Tutor Archives

2015-08-19 Thread Ken G.
While searching in Google several months ago, I came across a response addressed to me regarding on how to read, correct and write to the same file at the same time without using a secondary file as a temporary file to hold the corrected entries and rewriting to the original file. The entry wa

Re: [Tutor] OT: Searching Tutor Archives

2015-08-19 Thread Ken G.
On 08/19/2015 06:09 PM, Ben Finney wrote: "Ken G." writes: Could someone explain how to found such an article At the end of every message to this forum you'll see this footer: ___ Tutor maillist - Tutor@python.org To unsubs

Re: [Tutor] OT: Searching Tutor Archives

2015-08-19 Thread Ken G.
On 08/19/2015 07:34 PM, Alan Gauld wrote: On 19/08/15 18:43, Ken G. wrote: explain how to found such an article or kindly refresh my memory on how to correct an original file without using a secondary file. Thanks. Others have explained the search. Let me just point out that the number of

[Tutor] Unable to get out of loop

2016-02-26 Thread Ken G.
I have been unable to get out of the following loop. No matter what I entered, I can not get get out of the loop. The only way I can stop the routine is CTRL-C. If an entry is either 1, 2 or 3, then I should be able to proceed. I am sure the correct solution is very simple but I don't see it. Th

Re: [Tutor] Unable to get out of loop [RESOLVING]

2016-02-27 Thread Ken G.
On 02/26/2016 09:26 PM, Steven D'Aprano wrote: On Fri, Feb 26, 2016 at 08:30:19PM -0500, Ken G. wrote: side = "" while side != "0" or side != "1" or side != "2": That will only exit if side == "0", "1" and "2" **at t

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ken G.
On 03/02/2016 01:26 PM, Lisa Hasler Waters wrote: Hello everyone, I am new to Python, as are my middle school students. We are using Python 3.5.1 IDLE to write and run our (simple) code. However, this tool does not seem to be the best way to write longer code or to be able to re-edit code that

[Tutor] Best way to install Python 3 onto Windows 10

2016-03-15 Thread Ken G.
Having acquired a new laptop yesterday with Windows 10 installed and up-to-date, what would be the best way to install the latest version of Python 3? The laptop is an Dell Latitude E5500 and I am still learning the bells and whistles of it. I last used Windows XP 3-4 years back so this usage is a

Re: [Tutor] Best way to install Python 3 onto Windows 10 [RESOLVED]

2016-03-15 Thread Ken G.
On 03/15/2016 05:45 PM, Alan Gauld wrote: On 15/03/16 21:31, Ken G. wrote: Having acquired a new laptop yesterday with Windows 10 installed and up-to-date, what would be the best way to install the latest version of Python 3? Personally I always install ActiveState Python on Windows so that I

[Tutor] Sorting a list in ascending order

2016-04-29 Thread Ken G.
In entering five random number, how can I best sort it into ascending order, such as 0511414453? Using Linux 2.7.6 in Ubuntu 14.04.4. Thanks. number01 = "41" number02 = "11" number03 = "05" number04 = "53" number05 = "44" line = number01 + number02 + number03 + number04 + number05 print print lin

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Ken G.
On Fri, Apr 29, 2016 at 3:01 PM, Ken G. <mailto:beachkid...@gmail.com>> wrote: In entering five random number, how can I best sort it into ascending order, such as 0511414453? Using Linux 2.7.6 in Ubuntu 14.04.4. Thanks. number01 = "41" number02 = &quo

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Ken G.
On 04/29/2016 05:10 PM, Martin A. Brown wrote: Greetings Ken and welcome to Python, Using Linux 2.7.6 in Ubuntu 14.04.4. Thanks. Thank you for this information. I have one tip for you: While Python 2.x will still be around for a while, if you are learning Python today, I'd suggest Python 3

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-29 Thread Ken G.
On 04/29/2016 07:40 PM, Alan Gauld via Tutor wrote: On 29/04/16 23:58, Ken G. wrote: print ''.join(list1) #making it again as a single string Thanks, Meena, that is great! I changed your last line to: print "".join(list1) and it came out as below: 051141445

[Tutor] Quote and double quotes opens up File Explorer in Windows 10

2016-07-09 Thread Ken G.
Hi: In gradually moving over my Python programs (2.7.6) to Windows 10 and using Geany 1.27 to modify or write up a program there, it is noted that whenever I typed in a quote (') or double quote ("), Windows 10 File Explorer opens up. I end up closing it by typing ALT-F4 to resume typing as bef

Re: [Tutor] Quote and double quotes opens up File Explorer in Windows 10 (RESOLVED)

2016-07-13 Thread Ken G.
On 07/09/2016 01:02 PM, eryk sun wrote: On Sat, Jul 9, 2016 at 2:22 PM, Ken G. wrote: Hi: In gradually moving over my Python programs (2.7.6) to Windows 10 and using Geany 1.27 to modify or write up a program there, it is noted that whenever I typed in a quote (') or double quote ("

[Tutor] Program won't print out in Windows 10

2016-07-24 Thread Ken G.
While the following program prints out fine using Python 2.7.6 in Ubuntu 14.04.4 as developed using Geany 1.23.1, same program won't print out to printer under Windows 10 Pro (64 bit). Geany uses there is version 1.28 using Python 2.7.12. I can use CTRL-P to print out the listing. ==

[Tutor] Where is win32print in Windows 10 Pro

2016-08-11 Thread Ken G.
Currently in my Windows 10 Pro, 64-bit operating system, x64-bit based processor, using Python-2.7.12.amd64, I have for the first few lines: ``` import os, sys import win32print ` and get the following error message: `

Re: [Tutor] Where is win32print in Windows 10 Pro [RESOLVED]

2016-08-11 Thread Ken G.
On 08/11/2016 11:34 AM, Steven D'Aprano wrote: On Thu, Aug 11, 2016 at 10:28:44AM -0400, Ken G. wrote: import win32print ImportError: No module named win32print I have searched high and low within my Windows computer and have been unable to find '

Re: [Tutor] Where is win32print in Windows 10 Pro [RESOLVED]

2016-08-11 Thread Ken G.
On 08/11/2016 01:19 PM, Alan Gauld via Tutor wrote: On 11/08/16 17:14, Ken G. wrote: Unfortunately, no printing is done yet. Still working on it. Your reference to duckduckgo.com provided a list of useful pywin32 attibutes but no examples was provided. Will keep looking. Thanks. PyWin32 is a

Re: [Tutor] Where is win32print in Windows 10 Pro

2016-08-13 Thread Ken G.
On 08/12/2016 11:56 PM, eryk sun wrote: On Thu, Aug 11, 2016 at 2:44 PM, Joaquin Alzola wrote: import win32print ImportError: No module named win32print That module doesn't exist on your python path 'pywin32' is its canonical name. http://sourceforge.net/projects/pywin32/ I'm not certain w

Re: [Tutor] Python Idle Crashing

2013-05-17 Thread Ken G.
On 05/17/2013 02:19 PM, Alan Gauld wrote: On 17/05/13 18:16, bob gailer wrote: On 5/16/2013 8:49 PM, Alan Gauld wrote: don't run programs on real data using IDLE. IDLE is for developing programs not running them. That is really scary. Why do you say that? The IDLE documentation does NOT say

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

2013-05-25 Thread Ken G.
On 05/25/2013 05:25 AM, Rafael Knuth wrote: Gents, thank you all for your help. One of you guys asked me to try out your suggestions and then tell you how it goes. Here we go! First, let me recap briefly what the expected outcome of my program was and which difficulties I encountered at the beg

Re: [Tutor] Saving files in Python, IDE's & editors

2013-12-18 Thread Ken G.
For what it may be worth, I use Geany on my Ubuntu OS, 12.04 LTS. I also have IDLE installed and I can use the Terminal Window in running Command Line. Ken On 12/17/2013 09:28 PM, Keith Winston wrote: On Tue, Dec 17, 2013 at 7:26 PM, > wrote: What else do I

Re: [Tutor] most useful ide

2014-02-02 Thread Ken G.
On 02/02/2014 03:10 PM, Pierre Dagenais wrote: On 14-02-02 01:16 PM, Kodiak Firesmith wrote: Pycharm is nice for bigger projects (since tou can collapse any section); but it's crazy resource intensive. For Linux Gedit can be made very nice I prefer Geany as it will run my code with a click o

[Tutor] Finding numeric day in a year...

2014-06-28 Thread Ken G.
I know the correct answer should be 001, but I keep getting 179 which is the correct answer for June 28, 2014 (I think). I tried using datecode in various places instead of today but I am still getting 179. Currently using Ubuntu 12.04.4 and Python 2.7. Thanks for any feedback and suggestion.

Re: [Tutor] Finding numeric day in a year...

2014-06-28 Thread Ken G.
On 06/28/2014 02:13 PM, Mark Lawrence wrote: On 28/06/2014 18:59, Ken G. wrote: I know the correct answer should be 001, but I keep getting 179 which is the correct answer for June 28, 2014 (I think). I tried using datecode in various places instead of today but I am still getting 179

Re: [Tutor] Finding numeric day in a year...

2014-06-28 Thread Ken G.
On 06/28/2014 02:20 PM, Albert-Jan Roskam wrote: From: Ken G. To: tutor@python.org Sent: Saturday, June 28, 2014 7:59 PM Subject: [Tutor] Finding numeric day in a year... I know the correct answer should be 001, but I keep getting 179 which is the correct

Re: [Tutor] Finding numeric day in a year...

2014-06-28 Thread Ken G.
On 06/28/2014 02:36 PM, Steven D'Aprano wrote: On Sat, Jun 28, 2014 at 01:59:04PM -0400, Ken G. wrote: I know the correct answer should be 001, but I keep getting 179 which is the correct answer for June 28, 2014 (I think). Day 179 of 2014 is June 28 according to my diary, which happens

Re: [Tutor] Finding numeric day in a year...[SOLVED]

2014-06-28 Thread Ken G.
On 06/28/2014 02:39 PM, Alan Gauld wrote: On 28/06/14 18:59, Ken G. wrote: datecode = "20140101" # from database on file month = datecode[4:6] day = datecode[6:8] year = datecode[0:4] use strptime() to parse dates, its much more reliable. datecode = year + "-" + mon

Re: [Tutor] Finding numeric day in a year...[SOLVED]

2014-06-28 Thread Ken G.
On 06/28/2014 04:35 PM, Mark Lawrence wrote: On 28/06/2014 19:39, Alan Gauld wrote: On 28/06/14 18:59, Ken G. wrote: BTW You say you get it from "database on file". Now if that is a real database such as SQLite you will find functions there to convert it to julian at source... which

[Tutor] Error in printing out totalSystolic on paper (1018)

2014-08-10 Thread Ken G.
Receiving the following error from the terminal screen: Traceback (most recent call last): File "Blood Pressure05Print45.py", line 95, in pr.write(totalSystolic) TypeError: expected a character buffer object Portion of strip: = pr.write (" "), pr.write (pulse), pr.write (

Re: [Tutor] Error in printing out totalSystolic on paper (1018)

2014-08-10 Thread Ken G.
On 08/10/2014 10:38 AM, Alex Kleider wrote: On 2014-08-10 06:41, Ken G. wrote: Receiving the following error from the terminal screen: Traceback (most recent call last): File "Blood Pressure05Print45.py", line 95, in pr.write(totalSystolic) TypeError: expected a character buf

Re: [Tutor] Error in printing out totalSystolic on paper (1018) [SOLVED]

2014-08-10 Thread Ken G.
Thanks you to the list for helping me solve my problem. I never had problem using and printing on paper "pr.write" in my coding until this latest one popped up. Yeah, this old dog is still learning new tricks here. LOL. Again, thanks. Ken ___ Tutor m

Re: [Tutor] eval use (directly by interpreter vs with in a script)

2014-11-02 Thread Ken G.
On 11/02/2014 04:49 PM, Danny Yoo wrote: Hi Alex, Just as a side note, someone has probably already told you something like this, but: I would strongly recommend not to use Python's eval() or exec(). Those language features are dangerous. Every eval() or exec() is a possible vector for injec

Re: [Tutor] eval use (directly by interpreter vs with in a script)

2014-11-03 Thread Ken G.
On 11/03/2014 12:37 AM, Danny Yoo wrote: I use exec to jump to another program within the same directory, such as: execfile("BloodPressure02Sorting.py") and let the program terminate there. Should I do it differently or are you talking about a different horse? This is related. Rather than u

  1   2   >