[Tutor] Data Directory under site-packages

2010-11-10 Thread Greg Lindstrom
Hello, I'm writing my first module that I intend to put under our company's "site-packages" directory for everyone to use in their programs. The problem I'm having is that I want to place files in a data directory under the module directory (under site-packages) and I don't know how to set the

[Tutor] PyCon 2010 - Call for Tutorials

2009-09-05 Thread Greg Lindstrom
More information, including a sample proposal and blank template, are at http://us.pycon.org/2010/tutorials/proposals/. Questions? Email us at pycon-tutori...@python.org. Greg Lindstrom ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

[Tutor] PyCon 2010 (Atlanta) Call For Tutorials

2009-09-17 Thread Greg Lindstrom
Source project. Any topic relating to Python is eligible. Tutorial teachers are paid $1,000.00 per class for their efforts. Interested (we hope so!)? More information is available at http://us.pycon.org/2010/tutorials/proposals/ or write us at pycon-tutori...@python.org. We look forward to hea

[Tutor] Python Resources

2005-05-13 Thread Greg Lindstrom
Hello- I have been asked to write an article for the IEEE "IT Pro" magazine dealing with using Python in the medical field. The editors asked for about half the article dealing with using Python and the other half giving a short tutorial. They also asked for three "sidebars"; I'm going with

Re: [Tutor] For Loop Exercises

2005-05-31 Thread Greg Lindstrom
>I finished the chapter which includes for loop, tuples, indexing and >slicing. Can anyone suggest me 3 exercises to remind of the chapter? A great place to find all sorts of programs to write -- from very easy to complex -- is the programming contest archive on the useless python page (www.usele

[Tutor] Building an SQL query

2005-06-02 Thread Greg Lindstrom
Hello- I am building a query to hit a Postgres (8.0.1) database from Python (4.2.1) on Linux.  Here's how I've been doing it for the past year or so: data = ""> data['start_date'] = '2005-6-2' data['last_name'] = 'Johnson' query = '''    SELECT * FROM my_table     WHERE date >= '%(start_da

Re: [Tutor] Building an SQL query

2005-06-02 Thread Greg Lindstrom
On 6/2/05, Alan G <[EMAIL PROTECTED]> wrote: Its a really bad idea to use SELECT * FROM in production code.There are two main reasons:1) If the database structure changes your code is likely to break since SELECT * does not normally guarantee anything about the order of fields returned, so if the t

Re: [Tutor] Building an SQL query

2005-06-02 Thread Greg Lindstrom
Hmm, I dunno ADOpy but assume it somehow miraculously turns your dataset into a dictionary of some sort? How it guesses which order the SELECT will return the fields is a mystery to me, but maybe it hasknowledge of the Postgres hashing function or somesuch.   Yeah.  I used to do it by hand by look

Re: [Tutor] Tutor Digest, Vol 16, Issue 7

2005-06-02 Thread Greg Lindstrom
>data = "">>data['start_date'] = '2005-6-2'>data['last_name'] = 'Johnson'>>query = ''' >SELECT *>  FROM my_table> WHERE date >= '%(start_date)s'>   AND last_name = '%(last_name)s'>''' % data>results = my_database.Execute(query)First up. This is a "bad idea". It may be ok now, as lo

[Tutor] Deleting an entry from a dictionary

2005-08-02 Thread Greg Lindstrom
Hello- This must be simple, but for the life of me I can't figure out how to delete an entry from a dictionary. For example, meals = {} meals['breakfast'] = 'slimfast' meals['lunch'] = 'slimfast' meals['dinner'] = 'something sensible' How do I eliminate 'lunch' from the dictionary so that I onl

[Tutor] Properties

2007-06-07 Thread Greg Lindstrom
Hello, and I apologize in advance for the question. I have decided to publish a class I use to handle data segments to Google Code for the world to see (I plan to make millions off training classes, books and lectures :-). I need to make it a bit more 'generic' than the class I have been using,

[Tutor] Creating Packages

2007-07-18 Thread Greg Lindstrom
Hello- I have written a class to help folks like me manipulate data segments (the kind one deals with when reading/writing data files). The classes and tests are written -- at least enough to get things going -- what I need help with is creating a package out of this and then creating routines t

Re: [Tutor] Running Python on Gentoo

2007-07-26 Thread Greg Lindstrom
Eric Brunson wrote: > > What does the command "which python" say? [EMAIL PROTECTED] ~ $ which python /usr/bin/python HTH, --greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Running Python on Gentoo

2007-07-26 Thread Greg Lindstrom
Hello, I am running python 2.4.2 on Gentoo Unix and am having problems running programs. I have a script, hello.py as such: #! /usr/bin/python print 'hello, world' that I save and add executable permission. Then at the prompt I type in.. $ ./hello.py -bash: ./hello.py: /usr/bin/python: bad in

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
>Can anybody help me in how to connect Python to oracle and then to execute >an already existing PL/SQL Procedure through Python. What platform are you running? Windows? Linux? Mac? I've used Oracle and plSql for years and will be happy to help out once I know what you need. --greg __

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
My Oracle connection is set up using the adodb module ( http://adodb.sourceforge.net/). I don't remember why we set it up that way...we haven't touched this part of our code for almost 2 years!. from cx_Oracle import makedsn import adodb db = adodb.NewADOConnection('oci8') connection_string = ma

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
On 7/30/07, Amit Saxena <[EMAIL PROTECTED]> wrote: > > > I m still not able to run a Procedure > > from cx_Oracle import makedsn > import adodb > > db = adodb.NewADOConnection('oci8') > connection_string = makedsn("10.200.91.27 ", 1521, "scorpio") #<== your > values here, of course > db.Connect(c

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
I've never tried anything like that before; others may be of more help at this point. What I would try is reading the contents of the file into a local variable. my_data = file('metadata.sql').readlines() # read the file into a list query = ''.join(my_data) # append th

[Tutor] PyCon 2008 - Call for Tutorial Ideas

2007-08-16 Thread Greg Lindstrom
e time to start gathering ideas. What tutorials would YOU like to see offered? Please response to: [EMAIL PROTECTED] Thanks, Greg Lindstrom Tutorial Coordinator, PyCon 2008 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] PyCon 2008 - Call for Tutorial Topics

2007-09-01 Thread Greg Lindstrom
e to present a class). Let me know what class would entice you to attend the tutorials. Greg Lindstrom Tutorial Coordinator, PyCon 2008 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Fwd: [pycon-tutorials] Request: Python Instruction Needed for GIS Symposium

2007-10-30 Thread Greg Lindstrom
We received this on the PyCon tutorial list. Anyone interested?? Thanks, --greg -- Forwarded message -- From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Oct 30, 2007 11:18 AM Subject: [pycon-tutorials] Request: Python Instruction Needed for GIS Symposium To: [EMAIL PROTECTED]

[Tutor] Tutorials at PyCon 2008 (US)

2008-01-07 Thread Greg Lindstrom
Hello Everyone- I'd like to announce the tutorials sessions for PyCon 2008 (US). As you may know, this year PyCon is being held in Chicago, Illinois March 14-16 with the Thursday before (the 13th) being "Tutorial Thursday". We are expecting nearly 600 Python enthusiasts to meet up for the confer

[Tutor] PyCon 2008 Tutorial Sessions

2008-02-03 Thread Greg Lindstrom
Registration for PyCon 2008 is now open. Held in Chicago March 14-16 with "Tutorial Thursday" on March 13 and sprints afterwards, it is expected that nearly 800 Python enthusiasts will attend at least part of the conference. It is totally run by volunteers and is affordable for just about anyone.

[Tutor] cx_Oracle help

2008-02-05 Thread Greg Lindstrom
Hello, I'm trying to help out a friend and am stumped. Can you help me out? Thanks, --greg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I will briefly explain the problem I am facing. I am using Oracle 9.2, Python 2.5 and I installed cx_Oracle- 4.3.1-win32-9i-py25

[Tutor] Shut up and deal!

2005-08-08 Thread Greg Lindstrom
I found the conversation of dealing cards interesting, so I took a few minutes (about 20 while I waited for a production run to finish) and came up with the following Dealer class.  I come with a long history of coding in C/C++ and have been told my code looks like it (notice, in particular the nes

Re: [Tutor] Tutor Digest, Vol 18, Issue 78

2005-08-19 Thread Greg Lindstrom
I want to unsubscribe from your python mailing list and anything relatedthat keeps sending un imagned amount of emails that anrt spam but a bit of shit. pls Unsubscribe me. If you're still subscribed, you may want to switch over to the digest mode and only get a few emails a day.  This is an active

[Tutor] Dynamic Function Assignment

2005-10-20 Thread Greg Lindstrom
Hello- Suppose I have three objects... a = MyObject(id=1) b = MyObject(id=2) c = MyObject(id=3) As I read in segments from my file, I need to choose one of the above based on the segment, something like this; segment = 'A Segment to Process' for id, S in (('A',a), ('B',b), ('C',c)):   if segme

[Tutor] Re; Geometry

2005-11-07 Thread Greg Lindstrom
If there's not code for geometry, let's write some!!  What, precisely, are you looking for?  Or, better yet, do you have the resources to have you students write the code after teaching them "just enough" python?  I did that with a physics class a few years ago and the students loved it! --greg __

[Tutor] Pretty XML

2005-11-23 Thread Greg Lindstrom
Hello- I am in the process of creating an XML document from information stored in our database.  One of my colleagues will use the record to format our information (health care claims) into all sorts of forms, reports, etc.  He is partial to PHP5 but I like Python and would like to know if there is

Re: [Tutor] Is this a good idea to improve my currency program?

2005-12-14 Thread Greg Lindstrom
>I was thinking of using a dictionary to hold the currency exchange rates, >and saving it to a file, and loading it every time the program opens. It >still would not be GUI, but it would be a step towards a better program, I >believe. Is this a good idea, or is there stronger ways of doing it? Is

[Tutor] Decorators

2006-04-10 Thread Greg Lindstrom
Hello-For some reason I have decided to learn about decorators; I heard them talked up at  Pycon the past two years and want to know what all the fuss is about.  I might even use them in my code :-)My problem, and this is after reading PEP 318 and other items found when I "Googled" for decorators,

Re: [Tutor] failing to learn python

2006-04-10 Thread Greg Lindstrom
Paypal- I do a lot of system admin type work with Python.  If you'd like, drop me a line and let me know what you're interested in learning...perhaps I could help you work through a project or two. Greg Lindstrom [EMAIL PROTECTED] ___ Tuto

[Tutor] Two Questions...(i) Checking for None (ii) Making

2006-11-05 Thread Greg Lindstrom
Date: Sat, 4 Nov 2006 10:36:58 +From: "Asrarahmed Kadri" < [EMAIL PROTECTED]>Hi Folks,I am trying to build a program which takes the following command-line arguments:   *-s -D -n -t   time>*the first argument which is -s (for source) can be replaced by -d (fordestination) or -o (for observer

[Tutor] Pinging a service

2008-06-12 Thread Greg Lindstrom
Hello, I would like to write a routine to monitor services running on a remote box. My initial thought is to "ping" the remote box to monitor latency and then execute a query on the remote machine to monitor the database. What I would like is to gather data points and graph the delay to see if the

[Tutor] pyArkansas on October 4th

2008-09-03 Thread Greg Lindstrom
d swag. Due to limitations of physical space we must close registration at 100 participants (in honor of my first OS, SunOS, we may go to 110). Check out our wiki at http://pycamp.python.org/Arkansas/HomePage. There's no registration fee, so if you're in the area stop on by...we are looking forw

[Tutor] PyCon 2009 (US) - Call for Tutorials

2008-09-18 Thread Greg Lindstrom
ed in early December to give you time to prepare your class. PyCon will compensate instructors US$1,500 per tutorial. If you have any questions, please contact [EMAIL PROTECTED] Greg Lindstrom Tutorial Coordinator, PyCon 2009 ___ Tutor maillist - T

[Tutor] PyCon 2009 (US) - Call for Tutorials

2008-10-01 Thread Greg Lindstrom
epare your class and PyCon will compensate instructors US$1,500 per tutorial. If you have any questions, please contact [EMAIL PROTECTED] Greg Lindstrom Tutorial Coordinator, PyCon 2009 (US) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] PyCon 2009 (US) - Call for Tutorials

2008-10-18 Thread Greg Lindstrom
epare your class and PyCon will compensate instructors US$1,500 per tutorial. If you have any questions, please contact [EMAIL PROTECTED] Greg Lindstrom Tutorial Coordinator, PyCon 2009 (US) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] PyCon 2009 - Call for tutorials nearing the end

2008-10-29 Thread Greg Lindstrom
l selections will be announced in early December to give you time to prepare your class and PyCon will compensate instructors US$1,500 per tutorial. If you have any questions, please contact [EMAIL PROTECTED] Greg Lindstrom Tutorial Coordinator, PyCon 2009 (US)