Re: [Tutor] datetime.date objects from SQL query?

2005-09-02 Thread Jan Eden
Hi Liam, Liam Clarke-Hutchinson wrote on 02.09.2005: >Hi Jan, > >Are you using pysqlite? If so, then let me quote from the pysqlite >docs - > >"pysqlite has default adapters for the date and datetime types in >the datetime module. They will be sent as ISO dates/ISO timestamps >to SQLite." > > >Pe

Re: [Tutor] TEST to see if this gets out

2005-09-02 Thread Danny Yoo
On Fri, 2 Sep 2005, Jack Anema wrote: > TEST Hi Jack, We're here. Do you have a question about learning Python? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python2.3.4, PySqlite2 and Solaris

2005-09-02 Thread Luis N
On 9/1/05, Luis N <[EMAIL PROTECTED]> wrote: > Hi, > > After fighting with installing pysqlite2 Apologizes, I started over. It went much better the second time. bash-2.05$ test-pysqlite ..

Re: [Tutor] Python2.3.4, PySqlite2 and Solaris

2005-09-02 Thread Danny Yoo
> Python 2.3.4 (#1, Aug 23 2004, 13:59:34) > [GCC 3.2.3] on sunos5 > Type "help", "copyright", "credits" or "license" for more information. > >>> from pysqlite2 import dbapi2 as sqlite > Traceback (most recent call last): > File "", line 1, in ? > File "/home/rbnewby/lib/python/pysqlite2/dbap

[Tutor] Batch file to detect if Python is installed

2005-09-02 Thread Tom Playford
Dear Omniscient List, Does anyone know of a cunning method to detect whether Python is installed using a batch file? I'd like a batch file to execute an .exe if Python IS NOT installed, and execute a .py if Python IS installed. This is my first foray into the disturbing world of windows batch fi

[Tutor] FIREWALLS

2005-09-02 Thread Goofball223
I used python several months ago to write a simple program now i went back to use it to rewrite the same program and when I try to run it it says that my firewalls may be to secure. everytime the program runs in python it restarts and just has empty lines. how do I change my firewalls to be able

[Tutor] (no subject)

2005-09-02 Thread Suranga Sarukkali
What does [sic] mean? I see it all the time. June Bakersfield, California Dear June: Us too. We always wondered why these three little letters appear next to misspellings and other mistakes. As with many grammatical issues, we learned that Latin is to blame. "Sic" is Latin for "thus." Yeah, that

[Tutor] Directory permission and ACLs

2005-09-02 Thread Pat Martin
I am new to python and wanted to write a program that looks at directory permissions and ext3 ACLs and also change them if needed. What modules would I be looking at for those functions? Thank you. Pat ___ Tutor maillist - Tutor@python.org http://mai

[Tutor] convert binary to ascii

2005-09-02 Thread Servando Garcia
Hello List it has been a long time. Here is my question : sam in binary is 01110011 0111 01101101. if given 01110011 0111 01101101 how would I go back to ascii. I guess am asking is there a module that will do this conversion for me. I have looked at binascii but have been up ab

[Tutor] Problem building Python on HP-UX

2005-09-02 Thread Smith, Jeff
I'm trying to build Python 2.4.1 on HP-UX 11.00 with full tcl/tk IDLE support. So far, I haven't had any luck. I always wind up getting errors of the form: ld: DP relative code in file /ptg/devtools/hppa1.1/pre/lib/libtk8.4.a(tkWindow.o) - shared library must be position independent. Use +z or

Re: [Tutor] Directory permission and ACLs

2005-09-02 Thread Travis Spencer
On 9/2/05, Pat Martin <[EMAIL PROTECTED]> wrote: > I am new to python and wanted to write a program that looks at directory > permissions and ext3 ACLs and also change them if needed. What modules > would I be looking at for those functions? os and os.path: * http://docs.python.org/lib/module-os.

[Tutor] FIREWALLS

2005-09-02 Thread Goofball223
I used python several months ago to write a simple program now i went back to use it to rewrite the same program and when I try to run it it says that my firewalls may be to secure. everytime the program runs in python it restarts and just has empty lines. how do I change my firewalls to be able to

Re: [Tutor] convert binary to ascii

2005-09-02 Thread Danny Yoo
On Fri, 2 Sep 2005, Servando Garcia wrote: > Here is my question : sam in binary is 01110011 0111 01101101. >if given 01110011 0111 01101101 how would I go back to ascii. Hi Servando: If we have strings of ones and zeros, we can turn those into numbers by using the int() fun

Re: [Tutor] convert binary to ascii

2005-09-02 Thread Travis Spencer
On 9/2/05, Servando Garcia <[EMAIL PROTECTED]> wrote: > Hello Hey Servando, > Here is my question : sam in binary is 01110011 0111 01101101. >if given 01110011 0111 01101101 how would I go back to ascii. > I guess am asking is there a module that will do this conversion for >

Re: [Tutor] Batch file to detect if Python is installed

2005-09-02 Thread Alan G
> Does anyone know of a cunning method to detect whether Python is > installed using a batch file? Search the registry using the reg command: -- DOS session - C:\WINDOWS>reg query "hkcu\software\Pytho" Error: The system was unable to find the specified registry key

Re: [Tutor] convert binary to ascii

2005-09-02 Thread Travis Spencer
On 9/2/05, Danny Yoo <[EMAIL PROTECTED]> wrote: Hey Danny, > If we have strings of ones and zeros, we can turn those into numbers by > using the int() function. For example: > > ## > >>> int("101", 2) > 5 > >>> int("110", 2) > 6 > >>> int("111", 2) > 7 Oh, that's nice. I guess my solution

[Tutor] mod_python.publisher

2005-09-02 Thread Scott Oertel
I'm having an issue with mod_python.publisher, supposedly i should be able to just place this code def index():    return "This is only a test." into test.py and when placed into my browser it should run the index function by default, but instead i get a 404 error. i'm running Apache/1.3.3

Re: [Tutor] FIREWALLS

2005-09-02 Thread Alan G
>I used python several months ago to write a simple program now i went >back to > use it to rewrite the same program and when I try to run it it says > that my > firewalls may be too secure. Are you using IDLE? THe latest versions of IDLE issue a warning of this type. What happens if you just

Re: [Tutor] Invoking bash from within a python program

2005-09-02 Thread Jay Loden
Watch yourself on this one, slocate can often return some unexpected results for file searches, and the last thing you want to do is delete something important while trying to remove the latest game you installed. Also, if you're installing from source you can often run "make uninstall" to rem

Re: [Tutor] mod_python.publisher

2005-09-02 Thread Scott Oertel
Scott Oertel wrote: I'm having an issue with mod_python.publisher, supposedly i should be able to just place this code def index():    return "This is only a test." into test.py and when placed into my browser it should run the index function by default, but instead i get a

Re: [Tutor] mod_python.publisher

2005-09-02 Thread Danny Yoo
On Fri, 2 Sep 2005, Scott Oertel wrote: > Scott Oertel wrote: > > > I'm having an issue with mod_python.publisher, > > > > supposedly i should be able to just place this code > > > > def index(): > >return "This is only a test." > > > > into test.py and when placed into my browser it should

Re: [Tutor] Sort a Set

2005-09-02 Thread Jacob S.
How about this? Not only does it count each element, but you can also get a sorted set without using set! a = [24,24,24,16,16,15,15] b = {} for i in a: try: b[i] += 1 except KeyError: b[i] = 1 print b li = b.keys() print li li.sort() print li li.reverse() print li has output {24: 3, 16

Re: [Tutor] Counting help

2005-09-02 Thread Jacob S.
I'll do this again, just because I like sending email. Very similar to Alan G.'s -- but with the do first, ask forgiveness later a = ["Joe Smith", "Joe Smith", "Jack Smith", "Sam Love", "Joe Smith"] b = {} for x in a: try: b[x] += 1 except KeyError: b[x] = 1 Access count like this, of co

[Tutor] re.findall(), but with overlaps?

2005-09-02 Thread Terry Carroll
A friend of mine got bitten by an expectations bug. he was using re.findall to look for all occurances of strings matching a pattern, and a substring he *knew* was in there did not pop out. the bug was that it overlapped another matching substring, and findall only returns non-overlapping str

Re: [Tutor] Generate 8 digit random number

2005-09-02 Thread Jacob S.
> Hey Tutors > > I saw a lot of responses...After analyze them I have resumed two > approaches > > 1.- Generate a random number from 0 to and fill this number with > zeros (Almost everyone's approach) > 2.- Generate 8 random numbers and join them (Pietro and someone else) > > Which one of

[Tutor] Print Output Location in Windows XP

2005-09-02 Thread Tom Strickland
Up until now I have been running my Python programs in Linux. I just wrote one in Windows XP and I can't find the print output. The Python program has a print statement, and when I run the program a black window opens and I can see printing going on. However, when it's finished printing, the ou

Re: [Tutor] Print Output Location in Windows XP

2005-09-02 Thread Daniel Watkins
On Sat, 2005-09-03 at 03:30 +0100, Tom Strickland wrote: > > How do I get the output window to stay open, or where is the output > stored? You can open up a command prompt before running the program, which will allow you to see the output as the program runs. You get to this by 'Start > Run..' or

Re: [Tutor] Print Output Location in Windows XP

2005-09-02 Thread geon
Tom Strickland napsal(a): >Up until now I have been running my Python programs in Linux. I just >wrote one in Windows XP and I can't find the print output. The Python >program has a print statement, and when I run the program a black window >opens and I can see printing going on. However, when

Re: [Tutor] Print Output Location in Windows XP

2005-09-02 Thread Will Harris
Something I do is like raw_input("\n\nPress enter to exit.") at the end, this works if all you want to do is see the text on the screen. Tom Strickland wrote: >Up until now I have been running my Python programs in Linux. I just >wrote one in Windows XP and I can't find the print output. The P

Re: [Tutor] re.findall(), but with overlaps?

2005-09-02 Thread Kent Johnson
Terry Carroll wrote: > But he asked me, is there a standard method to get even overlapped > strings? > > After looking through the docs, I couldn't find a way to do this in > standard methods, so I gave him a quick RYO solution: > > def myfindall(regex, seq): > > ...resultlist=[] > ...