Re: [Tutor] saving a numpy ndarray in sqlite3 (markus kossner)

2009-12-21 Thread Don Jennings
I am not familiar with numpy, but you might like to take a look at y_serial which allows you to store python objects in sqlite: http://yserial.sourceforge.net/ Take care, Don ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscripti

[Tutor] securely transmitting data via email

2005-06-01 Thread Don Jennings
Goal: to securely transmit data (collected on a form on a secure web site) to recipient Possible solutions, thus far: 1) create web page accessible through HTTPS; email link to recipient, BUT that adds extra steps for him. I'd like it to be as transparent as possible (doesn't everyone? ; >)

[Tutor] thanks!

2005-09-23 Thread Don Jennings
Hi, everyone. Just a note of thanks to all of you who participate on the tutor list. I recently finished my first python CGI program, but I didn't have to post a lot of questions because most had been asked and answered already : >) For example, I wondered how to get unique file names for dynam

[Tutor] web development

2005-09-27 Thread Don Jennings
Earlier this month, Kent posted that Jython and Velocity are a good way to develop dynamic web sites. After a little searching, it seems that there are quite a few options for web development in Python (perhaps too many?). So, rather than ask for recommendations of which one to use, what I woul

Re: [Tutor] [OT] Python Tutor like java mailing list

2006-01-01 Thread Don Jennings
I suggest the beginners' forum at javaranch.com (they even give away free books on occasion : >) http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=33 Take care, Don ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailma

[Tutor] build list of non-empty variables

2008-07-08 Thread Don Jennings
Hi, folks. >From within a class, I want to return a string with data from non-empty variables in a class. I could create a list of all the variables and then iterate over them, dropping the ones which are empty, then join() and return them; however, I am guessing there is another way to get that

Re: [Tutor] build list of non-empty variables

2008-07-08 Thread Don Jennings
if x != '': res.append(x) return ';'.join(res) Thanks! Don On Tue, Jul 8, 2008 at 11:56 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 9:14 AM, Don Jennings <[EMAIL PROTECTED]> wrote: > > Hi, folks. > > > > Fro

Re: [Tutor] build list of non-empty variables

2008-07-09 Thread Don Jennings
Ah! A list comprehension. Not at that point in the learning python book, yet, but I will be soon. Thanks! Don On Tue, Jul 8, 2008 at 9:34 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 6:35 PM, Don Jennings <[EMAIL PROTECTED]> wrote: > > >

Re: [Tutor] deltatime difficulty

2008-09-18 Thread Don Jennings
On 9/18/08, Wayne Watson <[EMAIL PROTECTED]> wrote: > What's the problem here. It seems right to me. line 9 is diff =... >> >> import time >> from datetime import datetime >> def adjust_ftime(afilename, sec): >> # Vmmdd_hhmmss+tag, seconds in, new mmdd_hhmmss out >> ts = afilename[1

Re: [Tutor] optparse example

2008-09-22 Thread Don Jennings
On 9/22/08, Tasos Latsas <[EMAIL PROTECTED]> wrote: > Hello list, > I tried the optparse example from the python library reference and it > doesn't seem to work..what am I doing wrong? > I keep getting the "incorrect number of arguments" message although i > use the correct number.. Actually, you

Re: [Tutor] cgi scripts

2008-11-08 Thread Don Jennings
(Oops! Forgot to include tutor in recipient.) On 11/8/08, Don Jennings <[EMAIL PROTECTED]> wrote: > Hi, Jim. Actually, improper HTML would cause a problem with the > browser and what it may or may not display. An "Internal Server Error" > does indicate that you had a

Re: [Tutor] Leaving PHP for Python

2008-11-25 Thread Don Jennings
Oops, I meant to say that django "has EXCELLENT documentation" Take care, Don On 11/25/08, Don Jennings <[EMAIL PROTECTED]> wrote: > Welcome! I suggest you take a look at django [1]. You'll find that it > has documentation [2] and an active developer community

Re: [Tutor] Leaving PHP for Python

2008-11-25 Thread Don Jennings
Welcome! I suggest you take a look at django [1]. You'll find that it has documentation [2] and an active developer community [3]. Of course, for your questions about learning python, you've already found a very helpful community : >) Take care, Don [1] http://www.djangoproject.com/ [2] http://d

Re: [Tutor] Converting a string into dictionary references

2012-04-23 Thread Don Jennings
Remember, the keys for the dictionary in your example are simply strings. It just so happens that those strings are in another file. Read the file which contains the specified columns and split on the comma into variable names for your output: with open(spec_file, 'r') as f: outcol1, outco

Re: [Tutor] Looping over histogram plots

2012-06-26 Thread Don Jennings
> Message: 1 > Date: Tue, 26 Jun 2012 18:40:50 +1000 > From: Elaina Ann Hyde > To: tutor@python.org > Subject: [Tutor] Looping over histogram plots >set=(dat['a'+str(index)] == 1.00) You should not override the builtin set() type [1] as you've done here by assigning it. > #write the

Re: [Tutor] advice on global variables

2012-07-11 Thread Don Jennings
On Jul 11, 2012, at 4:48 AM, tutor-requ...@python.org wrote: > Message: 1 > Date: Tue, 10 Jul 2012 19:31:09 -0500 > From: Chris Hare > To: tutor@python.org > Subject: Re: [Tutor] advice on global variables > Message-ID: <38ebadce-c2b1-4f15-b6e1-cb725f800...@labr.net> > Content-Type: text/plain;

Re: [Tutor] get columns from txt file

2012-07-11 Thread Don Jennings
On Jul 11, 2012, at 10:21 AM, tutor-requ...@python.org wrote: > > Message: 4 > Date: Wed, 11 Jul 2012 16:20:05 +0200 > From: susana moreno colomer > To: > Subject: [Tutor] get columns from txt file > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > Hi! > > I have a group o

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
(Please use reply all so the message gets posted for all to see :>) On Jul 12, 2012, at 7:14 AM, susana moreno colomer wrote: > Hi! > Many thanks for your help. > Now I am trying this, but I get a blank excel document Not surprising as there are several errors in your code. In fact, I'm surprise

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
Oops! Still you forgot to cc: the tutor list. It's really important because if someone (like me, for instance) steers you in the wrong direction, others will jump in with corrections. On Jul 12, 2012, at 9:48 AM, susana moreno colomer wrote: > Hi! > Many thanks! You're welcome. I see that you

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
On Jul 12, 2012, at 10:55 AM, susana moreno colomer wrote: > Hi! > > I have a group of files in a directory: > bb_1.txt > bb_2.txt > bb_3.txt > bb_4.txt > bb_5.txt > bb_6.txt > ss_1.txt > > I want to extract from files whose names start with bb_ column number 5 > to an excel file. I have

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
On Jul 12, 2012, at 11:10 AM, susana moreno colomer wrote: > Hi! > It is attached on the email, called myprogram.txt and, here are the contents of that file: > #! /usr/bin/env python > > > import os > import fnmatch > import csv > > > path = '//../my_working_folder/' > csv_out=csv.writer(op

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
On Jul 12, 2012, at 12:06 PM, susana moreno colomer wrote: > > Hi! > This code is working fine! > The only one little thing is that the 6 columns appear together in one > column, what means, in eac cell I get 6 numbers. How can I get tit in 6 excel > columns? Programming is hard, so don't fee

Re: [Tutor] finally without try or except

2012-07-31 Thread Don Jennings
On Jul 31, 2012, at 12:26 PM, tutor-requ...@python.org wrote: > Message: 2 > Date: Tue, 31 Jul 2012 10:44:29 -0400 > From: Tino Dai > To: "Steven D'Aprano" > Cc: "tutor@python.org" > Subject: Re: [Tutor] finally without try or except > Message-ID: > > Content-Type: text/plain; charset="

[Tutor] better tools

2012-08-22 Thread Don Jennings
[slightly OT] After watching Bret Victor's talk[1], I want **much** better tools for programming (and all of the other stuff I do on the computer). John Resig, creator of jQuery, claims[2] that Victor's presentation inspired the new platform for learning javascript at Khan Academy[3]. I plan t

Re: [Tutor] 2.7.3 Popen argument issues

2012-08-26 Thread Don Jennings
On Aug 26, 2012, at 12:25 AM, tutor-requ...@python.org wrote: > Message: 2 > Date: Sat, 25 Aug 2012 17:46:08 -0700 > From: Ray Jones > To: tutor@python.org > Subject: [Tutor] 2.7.3 Popen argument issues > Message-ID: <503971d0.5040...@gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 >

Re: [Tutor] Tutor Digest, Vol 102, Issue 98

2012-08-30 Thread Don Jennings
On Aug 30, 2012, at 8:15 PM, tutor-requ...@python.org wrote: > Message: 6 > Date: Fri, 31 Aug 2012 00:15:41 + > From: Ashley Fowler > To: "tutor@python.org" > Subject: [Tutor] Printing a list as a column > Message-ID: > > <6962c976ae76ac4298cbf6fd6d0c63561f37c...@bl2prd0710mb363.namp

[Tutor] find('') returns 0

2012-09-16 Thread Don Jennings
This behavior seems strange to me: the find method of a string returns the position zero when you search for an empty string (granted, I can't quite figure out why you'd search for an empty string, either). >>> 'abc'.find('') 0 Anyone care to share a good explantion for this behavior and possi

Re: [Tutor] For - if - else loop; print selective output

2012-10-24 Thread Don Jennings
On Oct 24, 2012, at 12:27 PM, tutor-requ...@python.org wrote: > Hi, > > a = [['jimmy', '25', 'pancakes'], ['tom', '23', 'brownies'], ['harry', > '21', 'cookies']] > for i in a: >if (i[1] == '25' or i[1] == '26'): >print 'yes' > else: >print 'Not found' Suggestion: use names whi

Re: [Tutor] Tutor Digest, Vol 105, Issue 55

2012-11-21 Thread Don Jennings
On Nov 21, 2012, at 5:57 AM, tutor-requ...@python.org wrote: > On Wed, Nov 21, 2012 at 3:53 PM, Timo wrote: > > > I can create a torrent using py3createtorrent locally, but am unable to > figure how it will work via a django web app. > > To make it work locally, i specified the local location

[Tutor] MIT python video [WAS: Re: Hi Don,]

2012-11-22 Thread Don Jennings
On Nov 22, 2012, at 8:11 AM, Waters, Mike [ITSCA Non-J&J] wrote: > Hi Don, first thanks for the support on Python, I find the information very > helpful. You're welcome. You'll find it even more helpful if you send your questions to the whole python tutor list which I've cc'd :>) > I have bee

Re: [Tutor] MIT python video [WAS: Re: Hi Don,]

2012-11-23 Thread Don Jennings
On Nov 22, 2012, at 9:48 PM, Jan Karel Schreuder wrote: > > > On Nov 22, 2012, at 5:47 PM, Don Jennings wrote: > >> >> On Nov 22, 2012, at 8:11 AM, Waters, Mike [ITSCA Non-J&J] wrote: >> >>> Hi Don, first thanks for the support on Pytho

[Tutor] reading web page with BeautifulSoup

2012-12-12 Thread Don Jennings
On Dec 12, 2012, at 8:54 PM, tutor-requ...@python.org wrote: > Date: Wed, 12 Dec 2012 20:47:58 -0500 > From: Ed Owens > To: tutor@python.org > Subject: [Tutor] reading web page with BeautifulSoup > Message-ID: <50c933ce.5010...@gmx.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flow

Re: [Tutor] Python gmail script for conky

2013-01-20 Thread Don Jennings
On Jan 19, 2013, at 8:15 PM, tutor-requ...@python.org wrote: > Date: Sat, 19 Jan 2013 18:27:46 -0500 > From: Polo Heysquierdo > To: Tutor@python.org > Subject: [Tutor] Python gmail script for conky > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > I'm getting the follo

Re: [Tutor] Tutor Digest, Vol 108, Issue 75

2013-02-22 Thread Don Jennings
On Feb 22, 2013, at 9:12 PM, tutor-requ...@python.org wrote: > Message: 5 > Date: Fri, 22 Feb 2013 21:03:00 -0500 > From: Dave Angel > To: tutor@python.org > Subject: Re: [Tutor] How to break long lines? > Message-ID: <51282354.3030...@davea.name> > Content-Type: text/plain; charset=ISO-8859-1;

Re: [Tutor] A CSV field is a list of integers - how to read it as such?

2013-03-03 Thread Don Jennings
On Mar 3, 2013, at 9:24 PM, DoanVietTrungAtGmail wrote: > Dear tutors > > I am checking out csv as a possible data structure for my records. In each > record, some fields are an integer and some are a list of integers of > variable length. I use csv.DictWriter to write data. When reading out u

Re: [Tutor] argparse iterable

2013-04-01 Thread Don Jennings
On Apr 1, 2013, at 8:31 PM, wrote: > > > print("But this doesn't iter through a b and c:") > for k,v in parser.parse_args(): >print('This arg is %s %s' % k, k[str(v)]) > $ > - > > My error: > $ h.py -a -b hi -c 42 >

Re: [Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-08 Thread Don Jennings
On Apr 8, 2013, at 7:58 PM, Steven D'Aprano wrote: > On 09/04/13 06:38, brian arb wrote: >> An Introduction to Interactive Programming in PythonJoe Warren, Scott >> Rixner, Stephen Wong and John Greiner >> >> This course is designed to be a fun introduction to the basics of >> programming in Pyt

Re: [Tutor] building a website with python

2013-04-09 Thread Don Jennings
On Apr 9, 2013, at 5:31 PM, Benjamin Fishbein wrote: > Hello. I learned Python this past year (with help from many of you) and wrote > many programs for my small business. Now I want to build a website. I > acquired the domain name through godaddy.com (bookchicken.com) but have not > found hos

Re: [Tutor] building a website with python

2013-04-10 Thread Don Jennings
On Apr 9, 2013, at 11:07 PM, Benjamin Fishbein wrote: >> >> You've gotten some good feedback, but I suspect you will get better >> information if you provide more information about your goals for the site. >> > > Thanks for your help, everyone. There are some specific things I want the > sit

Re: [Tutor] design question (Django?)

2013-04-14 Thread Don Jennings
On Apr 14, 2013, at 7:06 AM, Albert-Jan Roskam wrote: > > > > Subject: Re: [Tutor] design question (Django?) >> >> On 13/04/13 09:48, Albert-Jan Roskam wrote: >> >>> I think I have to make a diagram of this. This stuff is quite hard >> >> You could use a simple UML class diagram (class -> t

Re: [Tutor] oops - resending as plain text

2013-04-16 Thread Don Jennings
On Apr 16, 2013, at 1:48 PM, Jim Mooney wrote: > I accidentally sent as HTML so this is a resend in case that choked > the mailing prog ;') > > I was doing a simple training prog to figure monetary change, and > wanted to avoid computer inaccuracy by using only two-decimal input > and not using

Re: [Tutor] How to find reverse pair words in a list of Words that has to be accessed through a URL

2013-04-19 Thread Don Jennings
On Apr 19, 2013, at 4:56 PM, Chetan Sai wrote: > Here is my question: > > "Two words are a “reverse pair” if each is the reverse of the other. Write a > program that finds all the reverse pairs in the word list. The word list can > be downloaded athttp://www.puzzlers.org/pub/wordlists/pocket.t

Re: [Tutor] Why do I get an "unvalid syntax" on the print line for number1

2013-04-23 Thread Don Jennings
On Apr 23, 2013, at 2:19 PM, Chris “Kwpolska” Warrick wrote: > On Sat, Apr 20, 2013 at 10:33 PM, Pat Collins > wrote: >> Any help appreciated. >> >> >> #!/usr/bin/env python >> """ >> number.py Demonstrates collecting a number from the user. >> """ >> >> number_string1 = float(input("Give me

Re: [Tutor] Fwd: Re: Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-14 Thread Don Jennings
On Jun 14, 2013, at 9:27 AM, Matt D wrote: > im sorry i dont get it. there is too many brackets in this lin: > > tmplist.append(field_values["nac"]) > > Thats where the error is but i dont see too many brackets? Please don't top post. The error is not on this line, but on the previous

Re: [Tutor] i need help with the following question

2013-08-26 Thread Don Jennings
On Aug 26, 2013, at 4:29 AM, isaac Eric wrote: > describe different ways of displaying output using python! Well, that's not really a question now, is it? I would be happy to help, but which part of the task is confusing for you? Take care, Don ___

Re: [Tutor] i need help with the following question

2013-08-27 Thread Don Jennings
On Aug 27, 2013, at 3:40 AM, isaac Eric wrote: > print "For a circle of radius %s the area is %s" % (radius,area) > Question: What is the purpose of %s ? Okay, so you're just getting started with python. We're happy to do some hand-holding, but we encourage you to think first. You've follow

Re: [Tutor] XMLRPC question

2013-08-29 Thread Don Jennings
On Aug 29, 2013, at 3:37 AM, Ismar Sehic wrote: > Hello, > I should write a python script(s) that listens to an existing XMLRPC service > on my company's dev server. Yes, you should do that. Then, if you have problems, you should show some of your code to the fine tutors here, and they'll be

Re: [Tutor] Python 2 & 3 and unittest

2013-09-04 Thread Don Jennings
On Sep 4, 2013, at 9:30 AM, Albert-Jan Roskam wrote: > Hi, > > I am trying to make my app work in Python 2.7 and Python 3.3 (one codebase) > and I might later also try to make it work on Python 2.6 and Python 3.2 (if I > am not too fed up with it ;-). You might like to read Armin Ronacher's (

Re: [Tutor] cs student needs help import math

2013-09-07 Thread Don Jennings
On Sep 7, 2013, at 6:02 PM, Byron Ruffin wrote: > > >>> math.ceil(math.pi) > 4 > ... but I get the error when using ceil... > > pepsticks = ceil(peplength / StickLength) > Traceback (most recent call last): > File "", line 1, in > pepsticks = ceil(peplength / StickLength) > NameError

Re: [Tutor] Copy and paste python on Microsoft word

2013-09-18 Thread Don Jennings
On Sep 18, 2013, at 12:59 AM, Sammy Cornet wrote: > I'm using python 3.3.0, I have made a program on my script and output it. I > have tried several times to copy and paste the output and the script on > Microsoft word, every time I select the part that I need and right click on > it, this mes

Re: [Tutor] Two subsequent for loops in one function

2013-11-22 Thread Don Jennings
On Nov 22, 2013, at 9:24 AM, Rafael Knuth wrote: > Hej there, > > newbie question: I struggle to understand what exactly those two > subsequent for loops in the program below do (Python 3.3.0): > > for x in range(2, 10): >for y in range(2, x): >if x % y == 0: >print(x, "

Re: [Tutor] Two subsequent for loops in one function - I got it!

2013-11-23 Thread Don Jennings
On Nov 23, 2013, at 2:57 PM, Rafael Knuth wrote: > > The output of > >for y in range (2,2): > > should be ... none - correct? No, it's not none. It's an empty list; thus, python executes nothing inside the inner loop. >>> range(2,2) [] >>> for y in range(2,2): ... print 'yes, I m

Re: [Tutor] Patchwork Help

2013-11-25 Thread Don Jennings
On Nov 25, 2013, at 10:54 AM, Callum Wilson wrote: > Hi, > > I am a relatively beginner to python. I am currently studying Digital > Forensics at University and programming using Python is currently a unit i am > studying. > > I have to complete a worksheet for Friday 29th, but i am having

Re: [Tutor] strip and split?

2013-11-30 Thread Don Jennings
On Nov 30, 2013, at 1:40 PM, richard kappler wrote: > I'm using psutil to generate some somatic data with the following script: > > import psutil as ps > > cpu = ps.cpu_percent() > mem = ps.virtual_memory() > disk = ps.disk_usage('/') > > All works well, but except for cpu I am struggling to l

Re: [Tutor] strip and split?

2013-11-30 Thread Don Jennings
On Nov 30, 2013, at 4:32 PM, Wolfgang Maier wrote: > richard kappler gmail.com> writes: > >> >> I'm using psutil to generate some somatic data with the following script: >> >> import psutil as ps >> >> cpu = ps.cpu_percent() >> mem = ps.virtual_memory() >> disk = ps.disk_usage('/') >> >> Al

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Don Jennings
On Dec 16, 2013, at 11:56 AM, eva maria gualandi wrote: > Good afternoon, > I installed from https://pypi.python.org/pypi/statsmodels the package > statsmodels for python 2.7 (32bit) , i have to do some test statistics for a > time series analysis that i can find under statsmodels.tsa. In part

Re: [Tutor] another better way to do this ?

2014-01-11 Thread Don Jennings
On Jan 11, 2014, at 4:24 PM, Roelof Wobben wrote: > Hello, > > I try to learn python by following the audicity page. > > Now I have the following problem. > > I have two strings a and b > > Now I have to check if the characters of b are all in a. > But they do have to be in the same ord