Re: [Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Liam Clarke
Erk. MySQL 4. I imagine that has TEXT data-types also? On 3/18/06, Adam Cripps <[EMAIL PROTECTED]> wrote: > On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Adam Cripps wrote: > > > On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > > >>Why are you using a BLOB when the content is text?

[Tutor] using cmd

2006-03-17 Thread Christopher Spears
I just completed an assignment out of Learning Python in which I used the Cmd class from the cmd module to create a little shell: import cmd, os, shutil, sys class shell(cmd.Cmd): def do_EOF(self, line): sys.exit() def do_ls(self, line): if line == '': dirs = [os.

Re: [Tutor] walking down directories

2006-03-17 Thread Karl Pflästerer
On 17 Mrz 2006, [EMAIL PROTECTED] wrote: > As you see, the problem is that there is another > directory under testFiles called testDir, but the > function doesn't check the directory for files. The > function needs to find every directory (including > subdirectories within directories). Any hint

Re: [Tutor] walking down directories

2006-03-17 Thread Steve Slevinski
Recursion. if os.path.isdir(d): describeDirectory(d) Since your printing from the function itself, you may want to add a level or depth arguement with a default value of 0. def describeDirectory(directory, level=0): Then call the function recursively with describeDirectory(d,level+1) Use the

[Tutor] walking down directories

2006-03-17 Thread Christopher Spears
I am trying to write a function that takes a directory's name, finds any subdirectories, and then prints out the size of the files in all found directories. import os, os.path def describeDirectory(directory): dirList = [directory] for d in os.listdir(directory): if os.path.isdir(

Re: [Tutor] Test If File System is mounted in Linux

2006-03-17 Thread Bill Campbell
On Fri, Mar 17, 2006, Pawel Kraszewski wrote: >Dnia piątek, 17 marca 2006 18:41, Adam napisał: > >> > The more general problem is to get a list of mounted file systems. > >> How about just reading the mtab? That's usually /etc/mtab it should be >> readable as a user and it means you don't have to

Re: [Tutor] Test If File System is mounted in Linux

2006-03-17 Thread Bill Campbell
On Fri, Mar 17, 2006, Adam wrote: >On 17/03/06, Bill Campbell <[EMAIL PROTECTED]> wrote: >> On Fri, Mar 17, 2006, Michael Lange wrote: >> >On Fri, 17 Mar 2006 00:36:35 -0700 >> >fortezza-pyt <[EMAIL PROTECTED]> wrote: >> > >> >> If there a semi-standard way to test if a file system has been mounted

Re: [Tutor] Test If File System is mounted in Linux

2006-03-17 Thread Pawel Kraszewski
Dnia piątek, 17 marca 2006 18:41, Adam napisał: > > The more general problem is to get a list of mounted file systems. > How about just reading the mtab? That's usually /etc/mtab it should be > readable as a user and it means you don't have to rely on any other > programs. Or always-up-to-date &

Re: [Tutor] Test If File System is mounted in Linux

2006-03-17 Thread Adam
On 17/03/06, Bill Campbell <[EMAIL PROTECTED]> wrote: > On Fri, Mar 17, 2006, Michael Lange wrote: > >On Fri, 17 Mar 2006 00:36:35 -0700 > >fortezza-pyt <[EMAIL PROTECTED]> wrote: > > > >> If there a semi-standard way to test if a file system has been mounted > >> or not using Python? In the Linux

Re: [Tutor] Test If File System is mounted in Linux

2006-03-17 Thread Bill Campbell
On Fri, Mar 17, 2006, Michael Lange wrote: >On Fri, 17 Mar 2006 00:36:35 -0700 >fortezza-pyt <[EMAIL PROTECTED]> wrote: > >> If there a semi-standard way to test if a file system has been mounted >> or not using Python? In the Linux command line, I can type "mount" and >> see all mounted file sys

Re: [Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Adam Cripps
On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Adam Cripps wrote: > > On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > >>Why are you using a BLOB when the content is text? > > > > I'm using BLOB because I want them to be able to write content that is > > longer than 255 chars. > > I'm n

Re: [Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Brian Gustin
if the data is not binary, you can use TEXT type - accepts all readable characters and data, BLOB type is more for binary data storage, and MYSQL's Varchar type only stores up to 255 characters. (65,536 bits, or 64Kbits) If you are storing Binary data (DES-3 encrypted data, or image data, for

Re: [Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Kent Johnson
Adam Cripps wrote: > On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: >>Why are you using a BLOB when the content is text? > > I'm using BLOB because I want them to be able to write content that is > longer than 255 chars. I'm no MySQL expert but the docs say VARCHAR fields can be up to 65,535

Re: [Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Adam Cripps
On 3/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Adam Cripps wrote: > > I'm trying to build a mini-CMS for my class to manage a single > > webpage, using CGI and mysql. The children will be storing their main > > content in a BLOB within a Mysql database. > > > > When I query the content colum

Re: [Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Kent Johnson
Adam Cripps wrote: > I'm trying to build a mini-CMS for my class to manage a single > webpage, using CGI and mysql. The children will be storing their main > content in a BLOB within a Mysql database. > > When I query the content column, I get a strange return like this: > > array('c', 'This is a

[Tutor] Mysql BLOB strangeness?

2006-03-17 Thread Adam Cripps
I'm trying to build a mini-CMS for my class to manage a single webpage, using CGI and mysql. The children will be storing their main content in a BLOB within a Mysql database. When I query the content column, I get a strange return like this: array('c', 'This is a test ') - when the only text I

Re: [Tutor] Test If File System is mounted in Linux

2006-03-17 Thread Michael Lange
On Fri, 17 Mar 2006 00:36:35 -0700 fortezza-pyt <[EMAIL PROTECTED]> wrote: > If there a semi-standard way to test if a file system has been mounted > or not using Python? In the Linux command line, I can type "mount" and > see all mounted file system, and then see if the one I am looking for is

Re: [Tutor] Japanese and COM

2006-03-17 Thread Kent Johnson
Ryan Ginstrom wrote: > I'm (still) having trouble using Japanese in python. > > I want to use Japanese with the win32com module. But while I can retrieve > Japanese text from a COM server without problems, if I try to send Japanese > text to a COM server it comes out garbled. > > Here is an examp

Re: [Tutor] Python and R

2006-03-17 Thread Kent Johnson
linda.s wrote: > Is there any good tutorial about using python to call R modules? Are you using RPy? It's docs look pretty good. http://rpy.sourceforge.net/ Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Test If File System is mounted in Linux

2006-03-17 Thread Noufal Ibrahim
On Fri, March 17, 2006 1:06 pm, fortezza-pyt wrote: > If there a semi-standard way to test if a file system has been mounted > or not using Python? In the Linux command line, I can type "mount" and > see all mounted file system, and then see if the one I am looking for is > in the list. While I co

[Tutor] Test If File System is mounted in Linux

2006-03-17 Thread fortezza-pyt
If there a semi-standard way to test if a file system has been mounted or not using Python? In the Linux command line, I can type "mount" and see all mounted file system, and then see if the one I am looking for is in the list. While I could replicate this with Python, I am curious if there is a