[Tutor] Please unsubscribe me from thi list

2018-03-14 Thread Greg Johnson
Please unsubscribe me from thi list From: Tutor on behalf of tutor-requ...@python.org Sent: Wednesday, March 14, 2018 4:00:02 PM To: tutor@python.org Subject: Tutor Digest, Vol 169, Issue 12 Send Tutor mailing list submissions to tutor@python.org To su

[Tutor] Python 3.x and Sqlite3

2016-10-11 Thread Greg Schmit
On FreeBSD I built lang/python34 from source and when I run python 3.4 I cannot import sqlite3. I thought it was being packaged with python 3.4. Am I incorrect in this assumption? -gns ___ Tutor maillist - Tutor@python.org To unsubscribe or change su

[Tutor] Using sorted in Python 3.3.5

2015-11-19 Thread Greg Christian
I’m trying to sort a list of tuples based on the second item in the tuple. When I run this in IDLE I get the correct output; however, when running inside of a program, and calling the counter() function, sorted does not seem to work? Any ideas on why this works in IDLE and not in program would b

[Tutor] Fwd: Re: Simple guessing game - need help with the math

2014-08-13 Thread Greg Markham
he issue I'm running into with rounding. I will try that approach; thank-you. > > But my curiosity is still begging me for an answer regarding my original approach. Is there a way to manage the functionality of be round function such that it does not strip any data to the right of the decima

Re: [Tutor] Exercise to work on

2014-08-13 Thread Greg Markham
Keith, This should get you started... http://learnpythonthehardway.org/book/ http://www.codecademy.com/en/tracks/python http://docs.python-guide.org/en/latest/intro/learning/ Happy coding! --Greg On Tue, Aug 12, 2014 at 1:52 PM, keith papa wrote: > Hi, am a newbie to python an

[Tutor] Simple guessing game - need help with the math

2014-08-13 Thread Greg Markham
onse. Please try again.\n") Something about the math in the code here isn't quite right. If you were to enter "h" (for 'higher') each time, it would first guess 50, then 75, then 87, then 93, then 96, and finally would stop progressing at the number 97. I suspect it&

[Tutor] Printing multi-line variables horizontally

2014-08-08 Thread Greg Markham
| `-'""" die_2 = """ .-. |o| | | |o| `-'""" print(die_1, die_2) So, how would I get this to display horizontally? Like so... .-. .-. | | |o| | o | | | | | |o| `-'

Re: [Tutor] New to Python - print function - invalid syntax

2014-08-05 Thread Greg Markham
On Mon, Aug 4, 2014 at 7:38 PM, Steven D'Aprano wrote: > On Mon, Aug 04, 2014 at 04:44:46PM -0700, Greg Markham wrote: > > > Ok, when I try this from the Shell window, it works. When executing the > > full program from command line, it does not. Python versions from bot

Re: [Tutor] New to Python - print function - invalid syntax

2014-08-05 Thread Greg Markham
On Mon, Aug 4, 2014 at 5:13 PM, Alan Gauld wrote: > On 05/08/14 00:21, Greg Markham wrote: > > but I'm running into a syntax error >> > > As others have said you are getting the expected error when running Python > v3 code under Python v2. > > How exac

[Tutor] Fwd: New to Python - print function - invalid syntax

2014-08-04 Thread Greg Markham
On Mon, Aug 4, 2014 at 1:38 PM, Danny Yoo wrote: > > > > but I'm running into a syntax error when running one of the unmodified > > > programs. On line 14, which reads: > > > > > > print("Here", end=" ") > > > > > > I'm receiving a syntax error which points to the end parameter. > > I'd like to

Re: [Tutor] New to Python - print function - invalid syntax

2014-08-04 Thread Greg Markham
On Mon, Aug 4, 2014 at 11:52 AM, Joel Goldstick wrote: > On Mon, Aug 4, 2014 at 1:28 PM, Greg Markham > wrote: > > Hello, > > > > I'm extremely new to Python having only just started learning this week. > > I'm slowly plodding through a book, Python P

Re: [Tutor] New to Python - print function - invalid syntax

2014-08-04 Thread Greg Markham
On Mon, Aug 4, 2014 at 12:37 PM, Alex Kleider wrote: > On 2014-08-04 10:28, Greg Markham wrote: > >> Hello, >> >> I'm extremely new to Python having only just started learning this week. >> I'm slowly plodding through a book, Python Programming for t

[Tutor] New to Python - print function - invalid syntax

2014-08-04 Thread Greg Markham
guess is that there's a minor difference between the version of Python I'm using (3.4.1) and that which was in use at the time the book was written (3.1.x) that is responsible for this error. Thanks and my apologies for the "greenness" of this question. Sincerely, Greg ___

Re: [Tutor] How do I create a "loop until" looping structure?

2014-05-21 Thread Greg Schroeder
https://wiki.python.org/moin/WhileLoop Greg On Wed, 2014-05-21 at 18:32 +0800, 1 2 wrote: > Hi there, > As shown in the codes below, I want to end the loop until the s is > no greater than -5 but I found there is no "do... loop until..." like > C so what should I do?

Re: [Tutor] Pygame and TkInter

2012-09-10 Thread Greg Nielsen
onsidering this post closed. Thank you all for your help. Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pygame and TkInter

2012-09-10 Thread Greg Nielsen
ponents to add to my game. I could write them myself, but if someone else already did the work, why bother. Have any other recomendations or related info on Blender? Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] Pygame and TkInter

2012-09-09 Thread Greg Nielsen
ssist! Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Pygame and TkInter

2012-09-09 Thread Greg Nielsen
buttons and stuff, everything else I can do in Pygame. Any thoughts? Thanks for the assist. Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Math Function and Python

2012-07-01 Thread Greg Nielsen
e most silly way imaginable. Thanks for reading. Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] TypeError: 'int' object is not callable

2012-05-16 Thread Greg Christian
Can anyone tell me what I am doing wrong here. When trying to call the factors function from main with x = factors(Tn), getting the error message: “TypeError: 'int' object is not callable”? Any help would be appreciated. Thanks. def factors(n): L = [] for i in range(1, int(n ** 0.5) + 1

[Tutor] How is the return statement working in this function?

2012-04-05 Thread Greg Christian
I am just wondering if anyone can explain how the return statement in this function is working (the code is from activestate.com)? Where does x come from – it is not initialized anywhere else and then just appears in the return statement. Any help would be appreciated. def primes(n): """Pr

[Tutor] Position issue with Pygame

2012-03-13 Thread Greg Nielsen
0)" reguardless of what I assign as the position. Please put me out of my misery and point out what little thing I coded wrong. Thank you all for the help. Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Class Nesting

2012-02-06 Thread Greg Nielsen
Hello List, My name is Greg, and while working on a project I've come across a rather interesting problem. I'm trying to create a rough model of a star cluster and all of the stars and planets contained within. Kind of a cool project; hopefully it should work a little like this.

Re: [Tutor] Sandbox Game

2012-02-06 Thread Greg Nielsen
hapter 7 perfectly. So check out pygame's website and check out that book from your library. I promise it will help you get started. Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Splitting a Tuple in Python 2.7

2011-12-05 Thread Greg Nielsen
the Tuple into a seperate variable or 2) edit just one part of the Tuple without knowing or affecting the other number. Thanks for the help! Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

[Tutor] Reading elements in a file

2011-05-04 Thread Greg Christian
Python version = 2.7.1 Platform = win32 I am kind of stuck on what is probably a simple thing: If we have a file of words like this: “first”,”word”,”in”,”that”,”another”,”part”,”of”,”this” f = open('words.txt', "r") words = f.read() will read the whole file, is there a way to read just the

[Tutor] Reading elements in a file

2011-05-04 Thread Greg Christian
I am kind of stuck on what is probably a simple thing: If we have a file of words like this: “first”,”word”,”in”,”that”,”another”,”part”,”of”,”this” f = open('words.txt', "r") words = f.read() will read the whole file, is there a way to read just the words: first word in that another part

[Tutor] Compound if statement question.

2011-05-01 Thread Greg Christian
Is there a way to write an if statement that will pick up duplicates (two ‘1’s): L = ['1', '4', '1'] if (L[0]) != (L[1]) != (L[2]): print "THEY ARE NOT EQUAL" else: print "THEY ARE EQUAL" When I run this code, it prints “THEY ARE NOT EQUAL” when it should print the else “THEY ARE EQUAL”.

Re: [Tutor] Unbound Method Error

2011-04-25 Thread Greg Nielsen
And it works! Thank you once again to both Steven and Ramit for your peerless insight into the workings of Python and for taking time out of you day to help me work my code back to Python 2. I have learned much by talking with both of you over the last day or so. Greg

Re: [Tutor] Unbound Method Error

2011-04-25 Thread Greg Nielsen
, playerCar) However, worded as it the follow error and call back happens: Traceback (most recent call last): File "C:\Users\Greg\Documents\NetBeansProjects\Red Racer 26\src\redracer26.py", line 19, in main() File "C:\Users\Greg\Documents\NetBeansProjects\Red Racer 26\src\redra

Re: [Tutor] Unbound Method Error

2011-04-25 Thread Greg Nielsen
recent call last): File "C:\Users\Greg\Documents\NetBeansProjects\Red Racer 26\src\redracer26.py", line 19, in main() File "C:\Users\Greg\Documents\NetBeansProjects\Red Racer 26\src\redracer26.py", line 16, in main redracerstates26.game(startLives) File &quo

[Tutor] Unbound Method Error

2011-04-25 Thread Greg Nielsen
class and use that rather than my collide method, or perhaps a class that could act as a middle man between bits of code that I know work, but I know that there has to be a better way to fix this. Thank you to any and all who take the time to read this message, and especially to those who respond w

Re: [Tutor] learnpython.org - Free Interactive Python Tutorial

2011-04-21 Thread Greg Werner
Hi Ron may you share the link? I have been using another fun one: www.pyschools.com, although I would love to have another option. Greg On 20/04/2011, at 20:20, tee chwee liong wrote: > hi Ron, > > this is great for beginners like me. Could you pls provide the link. tq > >

[Tutor] Distutils Font Error

2011-04-18 Thread Greg Nielsen
some advice. The error is as followes. C:\Users\Greg\Documents\NetBeansProjects\Racing1\src\build\exe.win32-3.1>racing1 .exe C:\Users\Greg\Documents\NetBeansProjects\Racing1\src\build\exe.win32-3.1\library .zip\RacingLibrary.py:335: RuntimeWarning: use font: DLL load failed: %1 is not a valid Wi

[Tutor] (no subject)

2011-04-04 Thread Greg Richards
http%3A%2F%2Fminilien%2Ecom%2F%3FZuctsogCRp ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] (no subject)

2011-03-31 Thread Greg Richards
http%3A%2F%2Fwww%2Eeasy%2Dsofa%2Epl%2F%2Fimages%2Ffriends%2Ehtml ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Data Directory under site-packages

2010-11-10 Thread Greg Lindstrom
oblem. Is there a way I can use files in the subdirectory (I really do not want dozens more files in the main directory)? Thanks for your help, --greg CONFIDENTIALITY NOTICE: This communication contains information intended for the use of the individuals to whom it is addressed and may contain

Re: [Tutor] Using contents of a document to change file names

2010-10-02 Thread Greg
I'd build a string using the information you want, then add ".txt" or whatever to the end of it, then use the os module to change the filenames. -- Greg Bair gregb...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Plotting a Linear Equation

2010-09-24 Thread Greg
d tested, you can only plot with a series of points. I could make two > points out of those manually, but I was wondering if anyone knew of an > easier way. Thanks. > You could just have your program compute the x- and y- intercepts, then plug them into matplotlib. Am I correct in t

Re: [Tutor] sort problem

2010-09-08 Thread Greg
le into one string named str. > > So it returns a string. > > Str is here seq and the iterable is the list made by list.sort so seq2 > > So I don't see the error in that line. > > > Roelof > > The error is that you misunderstand the usage of str.join.

Re: [Tutor] Creating custom GUI elements

2010-09-04 Thread Greg
xPython, PyGTK, PyQT, etc. No need to reinvent the wheel. -- Greg Bair gregb...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Adding to a CSV file?

2010-08-29 Thread Greg Bair
andard library - csv. It's really easy to use. http://docs.python.org/library/csv.html Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] question about import statement

2010-08-26 Thread Greg Bair
mes starting with an underscore > are not imported. Alternatively, if you have a variable named __all__ > in your module, and it's a list of names, only those names in the list > actually get imported when you do a "from x import *" > > Hugo Why would

Re: [Tutor] why does this fail

2010-08-25 Thread Greg Bair
On 08/25/2010 06:00 AM, Roelof Wobben wrote: > > Hello, > > > > I have this programm : > > > > def remove_letter(letter, strng): > """ > >>> remove_letter('a', 'apple') > 'pple' > >>> remove_letter('a', 'banana') > 'bnn' > >>> remove_letter('z', 'banana')

Re: [Tutor] continuous running of a method

2010-08-24 Thread Greg Bair
looking for (can't change that). I suppose what I could do to not randomize every time is to iterate through the list and create a new list that only contains dicts that have that key, then get a random one from that. I suppose that would be more efficient. Any thoughts? Greg --nitin

Re: [Tutor] continuous running of a method

2010-08-22 Thread Greg Bair
On 08/23/2010 01:10 AM, James Mills wrote: On Mon, Aug 23, 2010 at 3:00 PM, Greg Bair wrote: I have a method (I'll call it foo) that will either return None or an object depending on a random value generated. What I want to happen is that if I call foo(), i.e, f = foo() and it re

[Tutor] continuous running of a method

2010-08-22 Thread Greg Bair
while loop, but can't seem to get the details right. Any help would be greatly appreciated. Greg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Process list elements as consecutive pairs

2010-03-05 Thread greg whittier
On Fri, Mar 5, 2010 at 12:56 PM, Rüdiger Wolf < rudiger.w...@throughputfocus.com> wrote: > I am trying to Process list elements as consecutive pairs into > consecutive pairs. > Any pythonic suggestions? > > listin = [1,2,3,4,5,6,7,8,9,10] > I want to process as consecutive pairs > 1,2 > 3,4 > 5,6

Re: [Tutor] Help or Advice on MySQL, Python and test data storage

2009-10-14 Thread greg whittier
On Thu, Oct 8, 2009 at 4:29 AM, David Jamieson wrote: > Hi All, > looking for some advice on using Python with MySQL for test data > storage. > While not a relational database, you might also look at http://www.pytables.org. It provides a python interface for writing to and reading from hdf5 fil

Re: [Tutor] Unknown reason for error.

2009-09-24 Thread greg whittier
On Thu, Sep 24, 2009 at 2:15 PM, Corey Richardson wrote: > Hello, python tutors, its Corey. > Anyway, I'm getting a syntax error for an unknown reason. Here is my > code... > name = raw_input("What is your name?") > print "Hello, ", name > wellness = raw_input("How are you?") > if wellness !=

[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] 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

Re: [Tutor] Adding key, value to Dictionary

2009-03-27 Thread greg whittier
On Fri, Mar 27, 2009 at 1:31 PM, David wrote: > But I can not get this to update after the first time it is ran. > > def get_todo(): >    todo = {} This set todo to an empty dictionary each time you execute get_todo. >    key = raw_input('Enter Todo Title: ') >    todo[key] = key >    print '\n'

Re: [Tutor] plotting with python

2009-03-27 Thread greg whittier
matplotlib and pylab are two APIs to the same library. Using matplotlib is a more object-oriented, pythonic API. pylab is modeled after the Matlab plotting functions to make it easier for those coming from that environment. There's a matplotlib mailing list and you can often figure out what you

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread greg whittier
On Fri, Mar 20, 2009 at 1:41 PM, Wayne Watson wrote: > Yes, I'm sure I'll need help. I just posted a message minutes before yours > mentioning I'm willing to try Cygwin. The C program, wolf, is the public > domain If trying to compile the program under Win is what you had in mind, > then I can s

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread greg whittier
be we can help you with that. - Greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] adding dictionary values

2009-03-20 Thread greg whittier
2009/3/20 Emad Nawfal (عماد نوفل) > Hi Tutors, > I have two pickled dictionaries containing word counts from two different > corpora. I need to add the values, so that a word count is the sum of both. > If the word "man" has a count of 2 in corpus A and a count of 3 in corpus B, > then I need a n

Re: [Tutor] statistics with python

2009-03-20 Thread greg whittier
On Fri, Mar 20, 2009 at 6:45 AM, Bala subramanian wrote: > Dear python friends, > > someone kindly suggest me packages, modules and documentation resources > (especially) to > > i) plot graphs using python. > matplotlib is excellent and probably the most popular > > ii) statistical analysis

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-18 Thread greg whittier
On Wed, Mar 18, 2009 at 4:06 PM, Wayne Watson wrote: > Thanks to both above posts before this reply. > I'll forgo the VM route. It would really complicate things for the users of > the application having to deal with VM. Most are near neophytes. > Nevertheless, it looks like there may be some hope

Re: [Tutor] update list of dictionaries based on key

2009-03-13 Thread greg whittier
On Fri, Mar 13, 2009 at 11:09 AM, ski wrote: > Hello, > Here is what I have so far: > mylist = [{'index': 0, 'title': 'Association of British Travel Agents', 'selected': False, 'edit_row': '?edit_affiliation=0', 'affiliation': 'ABTA', 'affiliation_no': u'G3903'}, {'index': 1,

Re: [Tutor] merging dictionary values based on key

2009-03-12 Thread greg whittier
On Thu, Mar 12, 2009 at 4:24 PM, ski wrote: > Hello, > I have this issue, which I am unsure on how to solve. > mylist1 = {'a': 'x123', 'b':'12'} mylist2 = {'a': 'x234', 'c': 'a23'} for k in mylist2: > ...     if k in mylist1: > ...             mylist1[k] = [mylist1[k], mylist2[k]] >

[Tutor] __builtins__

2009-02-09 Thread greg whittier
e practical answer is to clean up the namespace in sparkplot.py (get rid of the from pylab import *) as I was planning to do anyway, but I'm wondering what's behind this __builtins__ behavior. Thanks, Greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Translating FORTRAN (77?) to Python?

2009-01-16 Thread greg whittier
There's an absolutely incredible project call f2py http://cens.ioc.ee/projects/f2py2e/ that I've used before. It doesn't translate the code, but wraps it (which is actually better) and lets you import your library as a module. It even generates docstrings so you can see how to call the functions.

Re: [Tutor] "Pointer" to a function? Storing a function as an object property? Passing arguments by value/by reference?

2009-01-16 Thread greg whittier
On Fri, Jan 16, 2009 at 7:51 AM, Vicent wrote: > > That "problem" has to contain, somehow, a property or element called > "function" which, in fact, I would like it to be a function, or a "pointer" > to a function. In python, the name of a function is just a pointer to it. Try this >>> def fo

Re: [Tutor] experience/opinions with deploying python GUI app to Linux, Win32, and Mac OS X

2008-11-13 Thread greg whittier
robably the easiest, but > also probably the hardest to use. Does "probably the easiest" mean "probably the easiest to develop?" Thanks again, Greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] experience/opinions with deploying python GUI app to Linux, Win32, and Mac OS X

2008-11-12 Thread greg whittier
asy to deploy - jython/SWT -- I have no experience with this, but everybody has a JVM, so deploying should be easy - web app running locally -- no experience with this, but everybody has a web browser and there are frameworks like django I could use - curses -- probably not as pretty as mac/windows

Re: [Tutor] Running a script from another folder

2008-11-12 Thread greg whittier
> it looks like you're on linux - so at the beginning of your script put > #!/usr/bin/env python (I believe) and then chmod +x myscript.py > > then you can call it from the command line. > You'll also need to make sure ~myID/bin is in your PATH. ___ Tuto

[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)

[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

Re: [Tutor] school physics/math courses

2008-10-16 Thread greg whittier
On Thu, Oct 16, 2008 at 7:15 AM, roberto <[EMAIL PROTECTED]> wrote: > hello > (i am rather new in python ...) > > i am about to start a course of physics and math for students aged > 14-17 (high school) > and i am deeply interested in the possibilty of teaching fundamental > concepts of these subj

[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

Re: [Tutor] deltatime difficulty

2008-09-18 Thread greg whittier
80120_20.xx.dat', 33) > File > "C:/Sandia_Meteors/Improved_Sentinel/Sentinel_Playground/Utility_Dev/junk.py", > line 9, in adjust_ftime > diff = datetime.timedelta(seconds = sec) > AttributeError: type object 'datetime.datetime' has no attribute > 'timedelta' > Hope this helps, Greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[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

Re: [Tutor] Sort Output

2008-09-17 Thread greg whittier
On Wed, Sep 17, 2008 at 3:30 PM, Wayne Watson <[EMAIL PROTECTED]>wrote: > I'm using Python 2.4 in Win XP. I was surprised to find the result below. > > >>> a =[4,2,5,8] > >>> b = a > >>> a.sort() > >>> a > [2, 4, 5, 8] > >>> b > [2, 4, 5, 8] > > b no longer has the same value as it began. Apparen

Re: [Tutor] Formating from hhmms to hh:mm:ss

2008-09-07 Thread greg whittier
On Sun, Sep 7, 2008 at 1:36 PM, Wayne Watson <[EMAIL PROTECTED]>wrote: > Yes, cut and paste directly from the code. Positively a import as seen. > Here's the full set of code: > > # The effect of adding seconds to date-time to see if day gets changed > import datetime > dt1 = datetime.datetime(20

Re: [Tutor] Formating from hhmms to hh:mm:ss

2008-09-07 Thread greg whittier
Is this an actual cut and paste of your code? The problem seems to be that you're getting a time.struct_time object instead of a datetime object. See below On Sun, Sep 7, 2008 at 12:52 PM, Wayne Watson <[EMAIL PROTECTED]>wrote: > Yes, that's correct., but that reference isn't doing it for me p

Re: [Tutor] Formating from hhmms to hh:mm:ss

2008-09-07 Thread greg whittier
I'm not clear on exactly what you're looking to do, but I think you want the strftime and strptime methods. See http://docs.python.org/lib/datetime-datetime.html On Sun, Sep 7, 2008 at 11:24 AM, Wayne Watson <[EMAIL PROTECTED]>wrote: > I've been writing various functions with datetime to change

Re: [Tutor] Message 'list' object has no attribute 'strptime ?

2008-09-04 Thread greg whittier
On Thu, Sep 4, 2008 at 4:05 PM, Wayne Watson <[EMAIL PROTECTED]>wrote: > Further info. If I put > y = time.strptime("11 01 05", "%H %M %S") > both in the function and in the main body. Only the line above in the > function produces an error message. > > Here's a simple program that creates th

Re: [Tutor] Message 'list' object has no attribute 'strptime ?

2008-09-04 Thread greg whittier
On Thu, Sep 4, 2008 at 2:00 PM, Wayne Watson <[EMAIL PROTECTED]>wrote: > The line > x = time.strptime(fmt_time, "%H %M %S") > with fmt_time = "11 12 40" > in function produces the msg: > Traceback (most recent call last): > File > "C:\Sandia_Meteors\Improved_Sentinel\Sentinel_Playground\Uti

[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

Re: [Tutor] How Compute # of Days between Two Dates?

2008-09-01 Thread greg whittier
On Mon, Sep 1, 2008 at 10:17 AM, Wayne Watson <[EMAIL PROTECTED]> wrote: > That's the question in Subject. For example, the difference between > 08/29/2008 and 09/03/2008 is +5. The difference between 02/28/2008 and > 03/03/2008 is 4, leap year--extra day in Feb. I'm really only interested in > yea

Re: [Tutor] Problems with Gauge Bar.

2008-08-10 Thread greg whittier
lines[i] = r.sub("xxx.xxx.xxx.xxx",lines[i]) # using sub is a little more compact Check out the python regular expression howto - http://www.amk.ca/python/howto/regex/ Greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problems with Gauge Bar.

2008-08-10 Thread greg whittier
30\.\d+\.\d+" > private19 = r"172\.31\.\d+\.\d+" > How about r = re.compile(r"(\d+)\.(\d+)\.\d+\.\d+") m = re.search(line[i]) if m: n1, n2 = map(int,m.groups()) # n1, n2 now have the first two numbers of the IP address Once you have n1, n2, you can check what range the ip is in and act accordingly. Greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Pinging a service

2008-06-12 Thread Greg Lindstrom
to see if there are any patterns; A) Is this a sound strategy? B) Are there libraries for the "ping"ing aspect? If not, I can execute the ping using "command"...how can I capture the screen output to get the times? Thanks, --greg __

Re: [Tutor] Searching through large number of string items

2008-04-10 Thread Greg Graham
ution written in Python, or a general purpose in-memory database written in C. I would start with which ever direction you are most comfortable, and if you can't get satisfactory performance, try the other route. Greg From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dinesh

Re: [Tutor] struct.calcsize curiosity...

2008-03-25 Thread Greg Graham
'qh' structs, I would expect there to still be 2 bytes of padding between each array member. On my machine, it seems to align on 8 byte boundaries, so in the 'hq' case, I'm wasting 6 bytes for padding between the h and the q. Greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Working with Python Objects

2008-03-14 Thread Greg Graham
n instance of B and assign it to variable v2. At [20], I call the one_of_b method on my new object, passing in the A object assigned to v1. It prints out 30, which is 10 times the value in the "a" field of v1. The class, variable, and method names are pretty abstract and similar, so I ho

Re: [Tutor] Hello

2008-03-13 Thread Greg Graham
kes sense. Maybe you should use two of the points for the outline of the face, one point for each eye, and two for the mouth, which amounts to 6 points total. Greg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Marlett Sent: Thursday, Marc

Re: [Tutor] passing arguments to functions - problem with argument order

2008-03-10 Thread Greg Graham
t;, "kto", "bankname", "status", >>> "spielbeginn", "letzte_aenderung", "importdatum", "briefdatum", >>> "buchungsdatum", "stornodatum", output_csv_filename=None) Column Definitions:kund

[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

[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] 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] 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 PRO

[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] 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

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

2007-07-30 Thread Greg Lindstrom
allows you to set "debug" to 1 and it will echo your queries back to you as you execute them. --greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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

2007-07-30 Thread Greg Lindstrom
is a PL/SQL query, then you should "SELECT metadata()". If is a file containing sql (is the pl/sql you wish to execute in this file?) then I'm not sure how to proceed. Is the PL/SQL you wish to run saved in Oracle? Can you show us what's in the metadata.sql file? --greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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

2007-07-30 Thread Greg Lindstrom
t me know if yo have other questions. HTH, --greg ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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 ne

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

  1   2   >