[Tutor] any cons to using a module of functions?

2012-02-02 Thread Che M
I have a bunch of functions that do various utility-type tasks in an application (such as prettifying date strings, etc.), and they are used in many modules. Much of the time, I have just been lazily copying and pasting the functions into whichever modules need them. I realize that is very ba

Re: [Tutor] Creating custom GUI elements

2010-09-05 Thread Che M
> Would Pygame allow me to code all of the bricks instead of drawing them out? I've never used Pygame; I have no idea. What I was suggesting was just getting a picture of a real or Lego-like brick from somewhere and using that image in your program. No drawing required.

Re: [Tutor] Creating custom GUI elements

2010-09-04 Thread Che M
> How would I go about creating custom GUI elements? For example, > if I wanted to make a simple LEGO maker app, how would I write the > code for the bricks so that the user could drag them around and then > build LEGO models? For 2D legos, using the wxPython widget toolkit, you could probab

Re: [Tutor] Databases in Python

2010-08-24 Thread Che M
> The other day, I wrote a little database just to fiddle around, > but when I try to run it it says that it has an unexpected indent. > From what I can tell, it doesn't. Here's the code. I'm using SPE. In the future, you should copy/paste error message you get into your email. This way it ind

Re: [Tutor] Distributing Python Code for Commercial Porpoises?

2010-08-06 Thread Che M
> #, showing his output. We need to make sure we are on the same playing > ground with numpy and scipy. I don't think we are. He barely knows > Python, but did, supposedly, a install of it, numpy and scipy from the > same written direction I use. I think he mistakenly installed a > different

Re: [Tutor] global exception handling?

2010-08-04 Thread Che M
> > But, the issue is, I have many places where I write to the database and > > would have to embed each of these in a try/except block. I can do that, > > but wondered if there is a "global" way to catch this 'database is locked' > > error? I found someone asking this sort of question onlin

Re: [Tutor] web-based python?

2010-08-02 Thread Che M
Thanks, Alan, for this set of helpful pointers. Just a few responses. > Actually web apps are all pretty similar. They consist of three basic > parts > (maybe 4): > 1) A mechanism for mapping a URL to a Python function or method. > 2) A mechanism for generating HTML with embedded data values

[Tutor] global exception handling?

2010-08-02 Thread Che M
A week or two back I asked this list about how to deal with SQLite database errors like 'database is locked'. Since then I figured out one way to reproduce that error (*see p.s. below if anyone is interested). I can also then catch the error with a try/except block and prevent it from causing

Re: [Tutor] Where to start with Unit Testing

2010-08-02 Thread Che M
> Che, from the analogies you made, it looks like you might not have very > clear what Unit Testing is for. > > True, UT is a way to automate tests that otherwise you should do > manually (as per your analogy), but the test you automate with UT are > not a "one off" thing (as it is processing t

Re: [Tutor] Where to start with Unit Testing

2010-08-01 Thread Che M
> > The idea of unit testing/test driven development has remained > > foreign to me throughout my time trying to learn Python--by choice. > > I want to make desktop GUI applications and I don't use MVC, so > > the idea of writing tests strikes me as far more work--and a major > > delayer of gett

Re: [Tutor] web-based python?

2010-08-01 Thread Che M
> > There is a myriad of python web development frameworks. Here's a link > > with a ton of info: > > > > http://wiki.python.org/moin/WebFrameworks > I had looked into Django before. What is confusing me is that it > sounds like it is meant to be run on the server directly. I do not > have direc

Re: [Tutor] Where to start with Unit Testing

2010-08-01 Thread Che M
> Do any of you have any feedback, strategies and best practices > related to unit testing within Python. This is a relatively new topic > for me. I was thinking of starting with reading the documentation > associate with the unittest module. The idea of unit testing/test driven development

Re: [Tutor] SQLite database locked problem

2010-07-21 Thread Che M
Date: Tue, 20 Jul 2010 07:28:45 +0200 From: cwi...@compuscan.co.za To: pine...@hotmail.com CC: tutor@python.org Subject: Re: [Tutor] SQLite database locked problem On 20/07/2010 06:48, Che M wrote: I'm using an SQLite3 database (with Python 2.5) and every so ofte

[Tutor] SQLite database locked problem

2010-07-19 Thread Che M
I'm using an SQLite3 database (with Python 2.5) and every so often the application crashes or hangs because somewhere there is this error, or something like it: OperationalError: database is locked. This is probably because I am viewing and sometimes changing the database through SQLite Data

Re: [Tutor] What books do you recommend?

2009-12-11 Thread Che M
> I won't continue to divert this thread from good books, but I will continue > to look > for more and more tutorials and will post it The more the more merrier... > Becky Just on that topic of tutorials, have you seen www.ShowMeDo.com? They have right now 516 screencast tutorials relat

Re: [Tutor] What books do you recommend?

2009-12-09 Thread Che M
> But the reason I ask this, is because there are SO many different approaches > you could > take to a single problem, I guess that depends a lot on what sorts of problems you are thinking in terms of. At least in many cases, perhaps one of the points of the Zen of Python is useful: "Ther

Re: [Tutor] What books do you recommend?

2009-12-09 Thread Che M
> My problem, though, is I still find it difficult to write meaningful code or > use the built in libraries > effectively and/or correctly because I can't find example code to mimic. I > tried sifting through > ActiveState recipes page, but most of the code seems uninteresting or useful >

Re: [Tutor] functions--how long is too long?

2009-12-08 Thread Che M
Thank you to all who replied. That does help me get a better idea of all this. I think if I apply a number of the thoughts expressed I can come to a good, readable re-do of these longer functions. Che _

[Tutor] functions--how long is too long?

2009-12-07 Thread Che M
I have some functions that seem kind of long to me. One of them, with white space, comments, print statements, and some commented-out lines, is 118 lines long. If I remove all that, it is 57 lines long. I get the sense that is inappropriately long for a Python function. The length of it is d

Re: [Tutor] Class understanding

2009-11-24 Thread Che M
> Date: Tue, 24 Nov 2009 10:27:05 -0600 > From: jammer10...@gmail.com > To: tutor@python.org > Subject: [Tutor] Class understanding > > Hi all... Have been attempting to understand classes... Been getting > along without them for a while now and feel it's time to jump in > > What I want to

Re: [Tutor] Sorting Data in Databases

2009-11-24 Thread Che M
> That is a surprise to me. I did not know that Python would work with SQLite. Sure, as someone else said, Python comes with a LOT of libraries built right in when you download Python. This is known as "batteries included", that is, what comes with the standard distribution of Python. >

Re: [Tutor] Sorting Data in Databases

2009-11-23 Thread Che M
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 with Databases,

Re: [Tutor] SQLite database not update correctly

2009-11-09 Thread Che M
> It's working fine now, but actually I didn't write exactly what you > suggested. > The "commit" method belongs to the connection, not to the cursor. Therefore, > in my script it should be conn.commit(). Whoops, you're quite right. Went a little too fast there. :D Che

Re: [Tutor] SQLite database not update correctly

2009-11-08 Thread Che M
> I've got a functions that should update an sqlite database, among other > things. However > the database doesn't get updated. When used in isolation, the update > statement works > fine. What am I doing wrong? > Below is the function. The whole script can be found at > http://past

Re: [Tutor] Methods that return instances of their own class?

2009-10-15 Thread Che M
> In particular, I'm trying to run a simple prisoner's dilemma game, and > I want to make a "game" object that has a method which returns the > "game" object with the payoffs reversed; that is, the payoff matrix > from the other player's point of view. Basically a kind of transpose > wh

Re: [Tutor] What language should I learn after Python?

2009-10-06 Thread Che M
> programming language. The problem is, I don't know which to learn. I want a > language > that will be good for me to learn, Good for you in what way? Is there a general "good for you" for programming, or do you need to achieve a certain goal? From a jobs point of view, Java seems prett

Re: [Tutor] Challenge

2009-09-22 Thread Che M
> I wrote this code but I know its wrong. Although it works properly: > flips=0 > h='heads' > t='tails' > while True: >flips+=1 >if flips>100: >break >if True: >print(flips,'=',h or t) > But it prints every number with the string 'heads'. I'm really blank at this. It

Re: [Tutor] wxpython question

2009-09-09 Thread Che M
Date: Wed, 9 Sep 2009 15:52:53 -0400 From: krissy.amb...@gmail.com To: tutor@python.org Subject: [Tutor] wxpython question Hi, I'm not sure if I could ask questions about wx in this list or not, hopefully it's okay? If not I guess disregard this question. But, does anyone have any idea of if i

Re: [Tutor] simple plots

2009-08-21 Thread Che M
> I would like to make some simple plots using matplotlib (or any python > plotting > modules) and I can find lots of examples that generate random data and then > plot those, but I cannot find any that read in data from excel or a text > file, > manipulate the data and then plot the data. D

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Che M
> Start a CMD window and run the python command by typing the command > at the DOS prompt. > > eg > > C:\Windows> python some\path\to\myscript.py > > > That way you will still see the error message after the > program finishes. Or what about using IDLE? _

Re: [Tutor] mnemonics to better learn Python

2009-07-31 Thread Che M
> To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Fri, 31 Jul 2009 17:09:48 +0100 > Subject: Re: [Tutor] mnemonics to better learn Python > > > "Eduardo Vieira" wrote > > > Hello, would anybody have a good memorization technique for boolean > > results? Like when using 'or'/'a

Re: [Tutor] Currency conversion module in python

2009-07-30 Thread Che M
Did you actually look at what happens when you click that link? (i.e. where you are brought to?). Because upon viewing this I achieved enlightenment! :D Date: Thu, 30 Jul 2009 10:02:39 +0200 From: zebr...@gmail.com To: amit.pureene...@gmail.com CC: tutor@python.org Subject: Re: [Tutor] Curr

Re: [Tutor] self.name vs. passing a name

2009-07-28 Thread Che M
> > The "answer" to each function is then used in the next function. > > I can think of two ways to make that answer available ... > > 1) pass it in, or > > 2) declare it as self.answer Thank you Alan, Kent, and Dave. Full agreement, and it makes sense to me. (Maybe this is also an example

[Tutor] self.name vs. passing a name

2009-07-27 Thread Che M
This is another very basic structural question, related to one I asked last week, and again is not necessarily germane only to Python. Let's say you have a sequence of two calculations or manipulations you need to do, each one done as a function called by an overall calculate_something() funct

Re: [Tutor] simple text replace

2009-07-26 Thread Che M
> I am scanning a text file and replacing words with alternatives. My > difficulty > is that all occurrences are replaced (even if they are part of another > word!).. Could you search for the string ' word ' with the white spaces around it? Shouldn't that only replace words that are not par

Re: [Tutor] Need to start learning again

2009-07-25 Thread Che M
> From: fredp...@mac.com > To: tutor@python.org > Date: Sat, 25 Jul 2009 16:24:13 -0700 > Subject: [Tutor] Need to start learning again > > I started learning python, but then life got busy... I need some help > finding good resources to start learning again. > > My main need for python at

Re: [Tutor] mnemonics to better learn Python

2009-07-23 Thread Che M
> Date: Thu, 23 Jul 2009 14:05:36 +0800 > From: ld...@gmx.net > To: Tutor@python.org > Subject: [Tutor] mnemonics to better learn Python > > Dear List, > > in order to memorize which Python sequences are mutable or immutable, I > focused on the SHAPE of the brackets that are associated with ea

Re: [Tutor] code structure terminology and advice

2009-07-22 Thread Che M
> To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Wed, 22 Jul 2009 08:46:04 +0100 > Subject: Re: [Tutor] code structure terminology and advice > > > "Che M" wrote > > You pretty much answered your own question. > > The ultima

[Tutor] code structure terminology and advice

2009-07-21 Thread Che M
Hi, this is really more of a general programming question than a Python question, though perhaps there is a Python-relevant set of terms/answers to it... I'm trying to refactor some code to be more structurally "proper", more easily maintained, etc. Doing some "thinking out loud", and I have t

Re: [Tutor] hitting a wall (not a collision detection question :P)

2009-07-19 Thread Che M
So, I'm just wondering what I should be doing at this point. Sorry for the vague question, but I'm pretty lost right now and this is about as specific as I can be. Thanks in advance for any help. Michae I started from scratch a 3 years ago and my advice would be: - Accept confusion. Marinate

Re: [Tutor] weather scraping with Beautiful Soup

2009-07-17 Thread Che M
> Date: Sat, 18 Jul 2009 01:09:32 +0200 > From: sander.swe...@gmail.com > To: tutor@python.org > Subject: Re: [Tutor] weather scraping with Beautiful Soup > > 2009/7/17 Che M : > > table = soup.find("td",id="dataTable tm10") > > Almos

Re: [Tutor] weather scraping with Beautiful Soup

2009-07-17 Thread Che M
OK, got the very basic case to work when using Beautiful Soup 3.0.7a and scraping the Weather Underground Lite page. That gives me the current temperature, etc. Good. But now I would like the average temperature from, say, yesterday. I am again having trouble finding elements in the soup.

Re: [Tutor] weather scraping with Beautiful Soup

2009-07-17 Thread Che M
> 2009/7/17 Michiel Overtoom : > > This is actually the first time I see that BeautifulSoup is NOT able to > > parse a webpage... > > Depends on which version is used. If 3.1 then it is much worse with > malformed html than prior releases. See [1] for more info. > > Greets > Sander > > [1] htt

Re: [Tutor] weather scraping with Beautiful Soup

2009-07-17 Thread Che M
> Date: Fri, 17 Jul 2009 20:02:22 +0200 > From: mot...@xs4all.nl > To: tutor@python.org > CC: pine...@hotmail.com > Subject: Re: [Tutor] weather scraping with Beautiful Soup > > Che M wrote: > > > "http://www.wund.com/cgi-bin/findweather/getForecast?query=Wo

Re: [Tutor] weather scraping with Beautiful Soup

2009-07-17 Thread Che M
> Date: Fri, 17 Jul 2009 08:09:10 -0400 > Subject: Re: [Tutor] weather scraping with Beautiful Soup > From: ken...@tds.net > To: pine...@hotmail.com > CC: tutor@python.org > > On Thu, Jul 16, 2009 at 11:21 PM, Che M wrote: > > Hi, > > > > I am interested

Re: [Tutor] weather scraping with Beautiful Soup

2009-07-17 Thread Che M
> Date: Fri, 17 Jul 2009 12:27:36 +0200 > From: mot...@xs4all.nl > To: tutor@python.org > CC: pine...@hotmail.com > Subject: Re: [Tutor] weather scraping with Beautiful Soup > > Che M wrote: > > > The 60.3 is the value I want to extract. > > soup.find(&

Re: [Tutor] weather scraping with Beautiful Soup

2009-07-17 Thread Che M
> The posts basocally say go and look at the HTML and find the > right tags for the data you need. This is fubndamental to any kind of web > scraping, you need to understand the HTML tree well enough to identify > where yourt data exists. > > How familiar are you with HTML and its structures? R

[Tutor] weather scraping with Beautiful Soup

2009-07-16 Thread Che M
Hi, I am interested in gathering simple weather data using Beautiful Soup, but am having trouble understanding what I'm doing. I have searched the archives and so far haven't found enough to get me moving forward. Basically I am trying to start off this example: Grabbing Weather Underground

Re: [Tutor] confused with dates and which way to start

2009-02-18 Thread Che M
> From: jfabi...@yolo.com > To: tutor@python.org > Date: Wed, 18 Feb 2009 15:55:05 -0800 > Subject: Re: [Tutor] confused with dates and which way to start > > On Wednesday 18 February 2009 03:10:41 pm johnf wrote: > > Hi, > > > > I need to develope a routine that will provide the some dates bet

Re: [Tutor] clipboard questions

2009-01-26 Thread Che M
> To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Mon, 26 Jan 2009 10:13:15 + > Subject: Re: [Tutor] clipboard questions > > > "Che M" wrote > >> I'm curious about how to interact with the

[Tutor] clipboard questions

2009-01-25 Thread Che M
I'm curious about how to interact with the contents of the clipboard effectively and have a couple of questions... 1) Is there one cross-platform way to read the clipboard, or does one have to have a different way to do it for Win, Mac, and Linux? (I have seen some ways with the win32clipboard

Re: [Tutor] referring to subfolders

2009-01-16 Thread Che M
> Date: Fri, 16 Jan 2009 21:26:52 -0800 > From: st...@alchemy.com > To: pine...@hotmail.com > CC: tutor@python.org > Subject: Re: [Tutor] referring to subfolders > > Che M wrote: >> I have been using absolute paths in my progr

[Tutor] referring to subfolders

2009-01-16 Thread Che M
I have been using absolute paths in my programs, but want to get out of the habit as I try to run them on other computers. I was surprised to find that this type of reference didn't work: path = '/subfolder/myfile.py' But instead I did it this way and it works: import os.path self.currentdir =

Re: [Tutor] running & debugging in python interactive shel

2009-01-15 Thread Che M
Date: Thu, 15 Jan 2009 12:20:45 -0600 From: sri...@gmail.com To: pine...@hotmail.com Subject: Re: [Tutor] running & debugging in python interactive shel CC: tutor@python.org On Wed, Jan 14, 2009 at 8:18 PM, Che M wrote: >> I'd like to add to this question and expand

Re: [Tutor] running & debugging in python interactive shell

2009-01-14 Thread Che M
> Date: Wed, 14 Jan 2009 16:44:11 -0800 > From: artie.z...@gmail.com > To: tutor@python.org > Subject: [Tutor] running & debugging in python interactive shell > > Greetings. > > I am attempting to search archives, however I thought it would be OK to > ask while I search... thank you to those w

Re: [Tutor] problem with building dict w/ SQlite SELECTS in loop

2008-09-16 Thread Che M
> I can't see any obvious reasons for your problems, I'm afraid, but I > do have a comment on your SQL: the sqlite module supports using ? to > indicate parameters. So you could rewrite your select statements as: > > cur.execute("select code from codes where code != '' and style = ? and > start

Re: [Tutor] problem with building dict w/ SQlite SELECTS in loop

2008-09-16 Thread Che M
> I'm quite willing to help on this, but it's just not quite > clear enough what's happening. Can I suggest that you > post a *really small, self-contained* example which demonstrates > the problem you're having. You might actually realise what's > wrong as you do that, or if not someone like me

[Tutor] problem with building dict w/ SQlite SELECTS in loop

2008-09-15 Thread Che M
(struggling to make an informative subject line) Hi, I have what is no-doubt a dumb problem, but I can't get past it... Given a list of items, I want to loop through the list, use the item in a SELECT statement to query an SQLite database, and use the returned data from a .fetchall() to add

Re: [Tutor] ways to sync databases with Python and SQLite?

2008-09-10 Thread Che M
> However if all that one does is read and does no updates or deletes then you > could just copy the database over to the 'client' user. No, both DBs are going to be writing and updating. Thanks, Chad. Che On Tue, Sep 9, 2008 at 6:56 PM, Che M <[EMAIL PROTECTED]> wrote:

Re: [Tutor] ways to sync databases with Python and SQLite?

2008-09-10 Thread Che M
> "Che M" <[EMAIL PROTECTED]> wrote in message > > > I'd like to get ideas about how I could extend the application so > > that the > > databases on each computer could be kept "synchronized" > > How do you intend to get the two

Re: [Tutor] ways to sync databases with Python and SQLite?

2008-09-10 Thread Che M
> > I'd like to get ideas about how I could extend the application so that the > > databases on each computer could be kept "synchronized" (not sure that is > > the right term here); that is, each new change on either computer would > > be updated on the other computer(s), given a bit of help fr

[Tutor] ways to sync databases with Python and SQLite?

2008-09-09 Thread Che M
Hi list, I have been trying to create a small desktop application with Python that uses a small SQLite database. Recently I've got use of a 2nd computer (for my job) and have thought now about using the app on that one as well. I'd like to get ideas about how I could extend the application s

Re: [Tutor] when is object relational mapping for Python warranted?

2008-06-18 Thread Che M
Thank you both to Tim Golden and Jeff Younker for your helpful responses last week [see archive] about ORMs in Python/SQLite. Very helpful, and I'll get around to giving it a try one of these days... Che From: [EMAIL PROTECTED] To: tutor@python.org Subject: when is object relational mapping for

Re: [Tutor] wanting to learn

2008-06-11 Thread Che M
Hi Michael, > Since my background is web, I want to learn Python and how it relates > to the web. I have been told that I need to learn and understand the > basics in "standard/general" Python before I move onto something like > "django" but really, how much Python do I need to know before

[Tutor] when is object relational mapping for Python warranted?

2008-06-10 Thread Che M
(tried to write a descriptive subject line) I'm curious whether I should consider learning either SQLObject or SQLAlchemy, and whether my needs would be worth it. I am learning to use SQlite databases for fairly simple storage and later search, and have only recently learned about object relati

Re: [Tutor] datetime syntax error for May 8th and 9th 2008??

2008-05-20 Thread Che M
ED]> wrote: > > On 17/05/2008, Che M <[EMAIL PROTECTED]> wrote: > >> >>> datetime.datetime(2008, 05, 08) > >> SyntaxError: invalid token > > > > It's simpler than that... Try this: > > > >>>> x = 08 > > File "&

Re: [Tutor] datetime syntax error for May 8th and 9th 2008??

2008-05-16 Thread Che M
From: [EMAIL PROTECTED] To: tutor@python.org Subject: datetime syntax error for May 8th and 9th 2008?? Date: Sat, 17 May 2008 00:09:03 -0400 Am I missing something? Why does May 7th and other dates work but I'm getting "invalid token" for May 8th and 9th? (I have not tested many other

[Tutor] datetime syntax error for May 8th and 9th 2008??

2008-05-16 Thread Che M
Am I missing something? Why does May 7th and other dates work but I'm getting "invalid token" for May 8th and 9th? (I have not tested many other dates of the year in this way) This is from a freshly begun IDLE session: IDLE 1.2 >>> import datetime >>> datetime.datetime(2008,05,07) dateti

Re: [Tutor] web programming tutorials?

2008-04-18 Thread Che M
Thank you, everyone, for all the responses! I will wade through them and try to get some understanding and then will no doubt come back with some questions in some days. Much appreciated. -Che _ More immediate than e-mail? Get i

[Tutor] web programming tutorials?

2008-04-17 Thread Che M
[I thought I sent a similar msg to this list 2 days ago, but now I'm not sure it went through, so sorry if I've doubled] Can someone point me to a start-from-dead-scratch tutorial about the basics of web programming? I've been learning wxPython for GUI programming, but web programming (that i

Re: [Tutor] Interactive plots...

2008-03-29 Thread Che M
> I am thinking about writing a program which will involve, among other > things, displaying a plot of a series of numbers. The idea is that > you could click on the points and move them to change the numbers. > Reverse-plotting, I suppose. It need not be complex; the numbers > will

Re: [Tutor] Py2Exe Tutorial

2007-12-24 Thread Che M
> From: [EMAIL PROTECTED]> To: tutor@python.org> Date: Sun, 23 Dec 2007 > 14:48:54 -0500> Subject: [Tutor] Py2Exe Tutorial> > > I am wondering if there > is a good tutorial on Py2Exe and its functions?> I have not been able to find > one. I have samples but that is not good> enough. It would be

Re: [Tutor] user-given variable names for objects

2007-12-13 Thread Che M
> Date: Thu, 13 Dec 2007 01:58:10 -0600 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > CC: tutor@python.org > Subject: Re: [Tutor] user-given variable names for objects > > Che M wrote: > > I'm sure this is a classic beginner's topic, and I've re

Re: [Tutor] user-given variable names for objects

2007-12-13 Thread Che M
> To: tutor@python.org > From: [EMAIL PROTECTED] > Date: Thu, 13 Dec 2007 07:53:36 + > Subject: Re: [Tutor] user-given variable names for objects > > > "Che M" <[EMAIL PROTECTED]> wrote > > > I'm sure this is a classic beginner's t

[Tutor] user-given variable names for objects

2007-12-12 Thread Che M
I'm sure this is a classic beginner's topic, and I've read a bit about it online already, but I'd like to ask about it here as well. I want to assign names to objects based on what a user inputs so that I can later keep track of them. In particular, I want to time multiple events by gett

Re: [Tutor] date matching with python and sqlite3

2007-09-01 Thread Che M
Re: date matching with python and sqlite3 I sorry, maybe I am stupid at the moment but I cannot follow your question, I'm sorry, I didn't describe that too clearly...have coffee now, let's try that again. The user will have a choicebox that has options of "today", "this week", "this mont

[Tutor] date matching with python and sqlite3

2007-08-31 Thread Che M
I'm trying to allow users to select data from an sqlite database using Python by choosing either a date or a range of dates. I'm stuck at just allowing the to select data that entered the database "today" and return values from a column called duration. I have this mess at the moment: #assume

Re: [Tutor] tagging pieces of information

2007-08-29 Thread Che M
> > Hi, I am curious about ways in Python to approach the idea of "tagging" > > pieces of information much in the way that one can tag favorite websites > > like on the site Del.icio.us. I'm not sure if tagging is the best term >for > > this (due to confusion with HTML tags), but the idea would

[Tutor] tagging pieces of information

2007-08-27 Thread Che M
Hi, I am curious about ways in Python to approach the idea of "tagging" pieces of information much in the way that one can tag favorite websites like on the site Del.icio.us. I'm not sure if tagging is the best term for this (due to confusion with HTML tags), but the idea would be a way to ass

Re: [Tutor] SQLite database creation bafflement

2007-08-20 Thread Che M
Thank you Alan and Roel for the insight, and Roel thank you for all the suggested ways to get around it. It's always nice when something goes from making no sense to making complete sense in a snap. Che _ Booking a flight? Know wh

[Tutor] SQLite database creation bafflement

2007-08-20 Thread Che M
Hi, I am trying to simply create an SQLite database with Python. I find that when I try to create a new database file, *sometimes* it lets me do it, and sometimes it doesn't, and the only thing I am changing is the name of the database. I am baffled as to why some names appear to work and som

Re: [Tutor] Tutor Digest, Vol 40, Issue 54

2007-06-23 Thread Che M
regarding making an executable file from a python file, Alan Gauld said: >Assuming you are on Windows you can use py2exe but >its non trivial to use. (Not hard, just not trivial) > >But first ask why you need to. >I've been using Python for over 10 years now and never once needed >to do this. (I d

Re: [Tutor] monitor other running applications with Py

2007-05-30 Thread Che M
gt; Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original "Che M" <[EMAIL PROTECTED]> wrote > Hi, searched a bit for this but haven't found much. > Is it possible to use Python to monitor the use of > other applicati

[Tutor] monitor other running applications with Python?

2007-05-26 Thread Che M
Hi, searched a bit for this but haven't found much. Is it possible to use Python to monitor the use of other applications? (anything...Word, Excel, browsers, etc.) At minimum, I wan't to know that the application was running, but even better would be some sense of the use or content, such as

Re: [Tutor] trouble with if

2007-05-24 Thread Che M
I'm not sure what the whole indentation thing is for. And now I'm having trouble with the if statement things. Maybe your if statement troubles have been solved by others by now, but I'll just add that "the indentation thing" is a vital feature of Python, it is the way to separate code blocks

Re: [Tutor] passing arguments via an instance of a class

2007-04-04 Thread Che M
John Fouhy said: Can you post the full error message (including stack trace and line numbers) and the code for the last function in the stack trace? (i.e. the code where the NameError occurs) It is now working (so I won't post the code/errors unless you think it is useful for people to see),

[Tutor] passing arguments via an instance of a class

2007-04-03 Thread Che M
Hi. Alan G helped me a week or two back with how to pass a list of points to a class which could use it to draw a graph.. Now I am doing it again, but with different code (based on an example of embedding a matplotlib plot in wxPython) and having trouble. That same basic issue is: I need to

Re: [Tutor] passing arguments to a make a graph

2007-03-23 Thread Che M
>Instead of using the class create an instance(aka object) > >self.plotPanel = PlotPanel(mypoints,self.notebook1) > >That creates an instance passing the mypoints list in >to youir init method along with the notebook1 that you >pass when you create an instance later (see below). This wor

Re: [Tutor] passing arguments to a make a graph

2007-03-23 Thread Che M
Thank you, Alan. I started by adding a method called addPoints() to my class as you recommend. But now I don't know how to pass a list of points to the addPoints() method. Here's the relevant code, adding in your suggestions: class PlotPanel(wx.lib.plot.PlotCanvas): def __init__(self,

[Tutor] basics of passing arguments to make a graph

2007-03-22 Thread Che M
Hi, this is some *really* beginner Python stuff, hope you folks could help me. I've been trying to make basic plots (line graphs) using the pyplot module (wx.lib.plot) in wxPython. So far, so good. To start, I can use a class like this (adapted from a demo) to draw a pre-defined graph: cla

[Tutor] basic plotting questions (pyplot vs matplotlib, etc)

2007-03-04 Thread Che M
I'd like to learn to use basic plotting in a wxPython GUI app, with plots embedded in the GUI. Some questions about this: 1) Of pyplot or matplotlib, which might you recommend? My needs are: - embedded plots in GUI (either can AFAIK) - basic point/line/pie/bar graphs, regression lines, clickabl

Re: [Tutor] storing text in databases

2007-02-22 Thread Che M
Thank you Bob and Alan. That helps alot. I will store text as files and index them somehow in the database (and yes Alan's section on SQL on his site is a great resource for this). -Che _ The average US Credit Score is 675. The cos