Re: hard disk activity

2006-02-13 Thread CatDude
> So I'm wondering if you know off-hand which windows port does this
> checksum validation you outlined.

http://www.gaztronics.net/rsync.php is one source. Just do a Google search
for "windows rsync".
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Concantenation and string slicing

2006-02-23 Thread CatDude
On Thu, 23 Feb 2006 14:55:16 -0800, DannyB wrote:

> I've written a program that takes a phrase and spits it back out
> backwards.  My problem is it throws each character on a new line.  I'd
> like the phrase to be on the same line.  Is this possible?

First suggestion: Put a comma at the end of the "print" line:

> print newMessage,


-- 
http://mail.python.org/mailman/listinfo/python-list


Progress bar in web-based ftp?

2006-05-09 Thread CatDude
I've got an application that prompts the user to select a file from his
local computer, checks the user's selection, then sends the file via 


In the python code that receives the files I've got a section that does
the following:

if not os.path.isfile(filePath):
file(filePath, 'wb').write(str(form[name].value))
else:
print "File already exists - deleting"
os.unlink(filePath)
file(filePath, 'wb').write(str(form[name].value))

after error checking, etc.

My question is whether anyone has ideas as to how I could implement a
progress bar. When I send a large file this way it can take a long time,
and I'd like to be able to reassure the user that something really is
happening.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: where do you run database scripts/where are DBs 'located'?

2006-05-12 Thread CatDude
On Fri, 12 May 2006 14:01:51 +, John Salerno wrote:

> Ok, I've been browsing through the MySQLdb docs, and I *think* I know 
> the kind of code I need to write (connect, cursor, manipulate data, 
> commmit, etc. -- although I probably need to get more familiar with 
> actual SQL commands too), but here's my problem: I don't know where 
> these scripts are supposed to be executed, or how they are supposed to 
> 'find' the database.

I'm kind of a noob myself, but I'll see if I can't offer some useful info
anyhow.

When you issue your MySQLdb.connect, that determines where the database
actions occur. If you specify "host='localhost'", then you are trying to
connect to your local machine. If you specify "host='db.smurgle.net'",
you're trying to connect to my home db server. You can specify the
hostname in any format that your local machine understands; for example,
if you are on a Linux box, and your /etc/hosts file contains a line like:
10.0.0.10  myDBserver
then you can use "host='myDBserver'".

This isn't so much a web programming issue as it is using MySQL's network
interface. MySQL by default uses port 3306 (I think) to handle database
connections over the network.

> But my question is, can these DB scripts be executed anywhere, and they
> will find the DB based on the connect() parameters? Or do I need to do
> something special with them? It seems like a similar problem to when you
> don't have your PYTHONPATH variable set up properly. I've tried some DB
> stuff, but it doesn't seem to work.

Your scripts that make connections can be executed from anywhere that:
1) knows how to communicate with the specified database server, and
2) has some sort of MySQL client available.

> So without actually giving you some code and tracebacks, is there any
> general advice about how to set up these scripts? Also, is there any
> better documentation than this:
> http://sourceforge.net/docman/display_doc.php?docid=32071&group_id=22307

If you are having problems, by all means post some code.

> It doesn't seem too thorough, and it also doesn't cover actual SQL
> queries that you'd have to pass to the query method. Maybe I will just
> have to find that information in a MySQL tutorial.

A couple of good MySQL tutorials would most likely be a big help. The
standard docs (the ones you pointed out) are not of a great deal of help
if you're totally new to SQL. You might want to do a Google search. This
will lead you to pages like:
http://www.kitebird.com/articles/pydbapi.html
http://www.devshed.com/c/a/Python/MySQL-Connectivity-With-Python/
and the like.

Dan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py web-app-frameworks without a rdbms...

2006-03-21 Thread CatDude
> If you don't want to use RDBMS, I think Karrigell is better. Many
> features of Django and TurboGears relate to database.

I've just begun looking at it, but I've also been impressed with Myghty.

-- 
http://mail.python.org/mailman/listinfo/python-list