Re: Getting column names from a cursor using ODBC module?

2008-06-22 Thread dananrg
Thanks Chris and John. Chris, this worked perfectly with the ODBC module that ships with Python Win32: column_names = [d[0] for d in cursor.description] John, I've never heard of pyodbc but I'll have to look into it. Thanks again. Dana -- http://mail.python.org/mailman/listinfo/python-list

Getting column names from a cursor using ODBC module?

2008-06-21 Thread dananrg
Is there any way to retrieve column names from a cursor using the ODBC module? Or must I, in advance, create a dictionary of column position and column names for a particular table before I can access column values by column names? I'd prefer sticking with the ODBC module for now because it comes

Standard Python 2.4 module like crypt for Windows?

2007-12-11 Thread dananrg
Is there a module available in the standard library, for Python 2.4 running on Windows, like crypt for Python 2.4 running on *nix machines? I need to store database passwords in a Python 2.4 script, but obviously don't want them in clear text. I'm looking for a reasonable level of security. What

Re: More elegant way to obtain ACLs / permissions for windows directories than using cacls dos command?

2006-11-09 Thread dananrg
There are some examples of using the security descriptor objects in \Lib\site-packages\win32\Demos\security. Also, searching the Python-win32 mailing list should turn up some more code. Thanks again Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: More elegant way to obtain ACLs / permissions for windows directories than using cacls dos command?

2006-11-08 Thread dananrg
Thanks Roger, I'll give it a shot. Is os.walk the best way (using standard library modules) to traverse directory trees in Python 2.4 and beyond? -- http://mail.python.org/mailman/listinfo/python-list

Re: More elegant way to obtain ACLs / permissions for windows directories than using cacls dos command?

2006-11-08 Thread dananrg
Could you give an example for listing security descriptors using the win32security module? I looked at the documentation but found it confusing. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

More elegant way to obtain ACLs / permissions for windows directories than using cacls dos command?

2006-11-07 Thread dananrg
Is there a standard library module in Python 2.4 (Win32) that will return directory permissions / ACLs (e.g. users, groups, and what rights they have)? Otherwise, I'm faced with sending cacls dirName commands via os.popen as below, and then parsing and comparing the text output. Basically, I'd

Re: Module for creating a screenshot of a web page given a URL?

2006-07-06 Thread dananrg
Untestetd, but I'm pretty sure something like this will do. If you need more control, and on windows, try pywinauto I do need it to run on Windows. I'll check out pywinauto. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Module for creating a screenshot of a web page given a URL?

2006-07-05 Thread dananrg
Is there a Python module that, given a URL, will grab a screenshot of the web page it goes to? I'd like to be able to feed such a module a list of URLs from a file. Thanks very much. -- http://mail.python.org/mailman/listinfo/python-list

pyGoogle - restrict by country doesn't seem to work

2006-06-29 Thread dananrg
If I want to restrict search results by country, what precisely do I need to include in searchTerm variable below? I've tried: searchTerm = 'restrict:countryUS blah blah' searchTerm = 'restrict countryUS blah blah' Neither work. What am I doing wrong? import google data =

Re: pyGoogle - restrict by country doesn't seem to work

2006-06-29 Thread dananrg
This worked for me: data = google.doGoogleSearch(searchTerm, restrict = 'countryUS') How does restrict results by country at Google.com? -- http://mail.python.org/mailman/listinfo/python-list

Best way to process table rows from an RDBMS

2006-04-07 Thread dananrg
I can handle making the connections and running queries, but what's the best way to process table rows returned in Python? What about turning a table definition into an object? Just looking for ways to be efficient, since I know I will be hitting the same external RDBMS from Python and regularly

Using PythonWin32 to copy text to Windoze Clipboard for Unix-style random .sig rotator?

2006-04-06 Thread dananrg
Can you tell I miss Unix? I want to write a Python script that, when launched, will choose a random .sig (from a list of about 30 cool ones I've devised), and store the .sig text in the Windows Clipboard, so I can then paste it into any Windows application. This way, it'll work for Outlook

Filters like old skool Jive, Fudd, Valspeak... Text transformation in Python

2006-04-05 Thread dananrg
I would like to learn how to roll my own filter ala early 90's filters like Jive, Fudd, Kraut, Moron, etc, that take text as an input, and re-writes the text adding general hilarity of various linguistic flavor (depending on the filter). I always loved running my philosophy papers, or anything

Re: Filters like old skool Jive, Fudd, Valspeak... Text transformation in Python

2006-04-05 Thread dananrg
bruno at modulix wrote: There's a Kant generator example in Dive Into Python: http://diveintopython.org/xml_processing/index.html Thanks Bruno! Perhaps I could modify it to throw in some Hume and Wittgenstein, mix it all up in a syntactic / semantic blender and REALLY confuse people. Word

Spidering Hacks for Python, not Perl

2006-03-20 Thread dananrg
O'Reilly's Spidering Hacks books terrific. One problem. All the code samples are in Perl. Nothing Pythonic. Is there a book out there for Python which covers spidering / crawling in depth? -- http://mail.python.org/mailman/listinfo/python-list

Re: ODBC module and strange date reference ...

2006-03-07 Thread dananrg
Magnus Lycka wrote: Are you using an old version of ESRI software, or are they shipping a product with an ancient version of Python? We're using the latest and greatest ArcGIS Desktop product, which is at release 9.1. Evidently they chose to use Python 2.1 to ensure a silent install when ArcGIS

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed L with number data type

2006-03-07 Thread dananrg
Thanks Andrew. I've been bugging ESRI about upgrading, and I'm sure others have too. The beta of ArcGIS Desktop 9.2 ships with Python 2.4, so I imagine the release of ArcGIS Desktop 9.2 this summer will also ship with Python 2.4. I've read threads recently on the geoprocessing / scripting

Re: PythonWin: any way to delete all objects without exiting and without doing it with del?

2006-03-03 Thread dananrg
Steven, does your technique fix my problem? Would that delete the objects I've created within a program if I suffix my code with it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-03 Thread dananrg
[EMAIL PROTECTED] wrote: dananrg Are you saying I'm getting the L as an artifact of printing? No, you're getting the L because you're printing a long integer. If you execute x = 872L y = 872 at a Python prompt, x will be a long integer and y will be an integer. Long Thanks Skip

Re: PythonWin: any way to delete all objects without exiting and without doing it with del?

2006-03-02 Thread dananrg
PythonWin is just an IDE. For what reason you have to delete all objects by yourself? Garbage collector is there for that :) I think the garbage collector is on strike. :-) Example: # 1st execution a = [1,2,3] print a [1,2.3] program ends. Then I comment out a = [1,2,3] and run the

Problem with dbi, odbc module and Oracle 9.2 - suffixed L with number data type

2006-03-02 Thread dananrg
I was messing around with the native ODBC module (I am using Python in a Win32 environment), e.g: import dbi, odbc ...and it seems to meet my needs. I'd rather use a module that comes natively with Python if it works (don't care about performance in this particular use case; just that it works).

ODBC module and strange date reference ...

2006-03-02 Thread dananrg
Been using the ODBC module for Python 2.1 (Win32) and had another question. When I return data from date columns, it's in a strange object form, e.g. something or other (don't have the output in front of me. What's an easy way to convert date objects into a human-readable string? I'm using this

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed L with number data type

2006-03-02 Thread dananrg
Great, thanks Diez! Should I just use str(n) to convert it to a format I can write out to a flat file? I'm also struggling with the strange date object format that the ODBC module returns when I fetch rows. I need to convert that to a text string in a format that a mainframe flatfile database

Re: ODBC module and strange date reference ...

2006-03-02 Thread dananrg
Thanks Frank. Much appreciated. I will give it a go. -- http://mail.python.org/mailman/listinfo/python-list

Re: ODBC module and strange date reference ...

2006-03-02 Thread dananrg
Thanks Frank. Much appreciated. I will give it a go. -- http://mail.python.org/mailman/listinfo/python-list

Re: ODBC module and strange date reference ...

2006-03-02 Thread dananrg
Sorry for the double-thanks Frank. I'm using Python 2.1 for Win32 and import datetime fails. Does the datetime module come standard with later releases of Python? If so, which release? If not, will datetime with with Python 2.1, if it will, where can I get it? I'm still such a newbie with Python

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-02 Thread dananrg
If you actually get a suffixed L in the resulting text file, you are using a strange way to convert your data to text. You aren't simply printing lists or tuples are you? Then other types, such as datetime objects will also look bizarre. (Not that the ancient odbc would support that...) You

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-01 Thread dananrg
Thanks Gerhard and Magnus. Magnus, thanks for the references. I will follow up on those. I was messing around with the native ODBC module you mentioned (I am using Python in a Win32 environment), e.g: import dbi, odbc ...and it seems to meet my needs. The only issue I've had so far is

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-01 Thread dananrg
The other thing I didn't do a good job of explaining is that I want to have a layer of abstraction between the underlying RDBMS and the business logic. It's the business logic I want to use Python for, so that would stay roughly the same between RDBMS changes, if we ever have an RDBMS change. I

PythonWin: any way to delete all objects without exiting and without doing it with del?

2006-03-01 Thread dananrg
In PythonWin, is there any way to bulk-delete all objects without using del object for each, and without having to exit out of PythonWin? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-28 Thread dananrg
What would be the next best Oracle database module for Python next to cx_oracle? I'd like to compare two and choose one, just for the sake of seeing how two modules doing the same thing operate. Also, does installing cx_oracle create registry entries or require admin privs on a Windows XP

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-28 Thread dananrg
Also, what's the difference between something like cx_oracle and an ODBC module? If I were to use an ODBC module (not trying to torture myself here, I promise, but I just want to see what alternatives exist and how they work). -- http://mail.python.org/mailman/listinfo/python-list

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-27 Thread dananrg
How about DBdesigner4 or Dia as free ER diagrammers? [EMAIL PROTECTED] wrote: Thanks Olivier and Jonathan. Do either of you, or anyone else, know of a good open source data modeling / ER-diagram / CASE tools? I'd like to be able to build relatively simple schemas in one open source tool

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-25 Thread dananrg
Thanks Olivier and Jonathan. Do either of you, or anyone else, know of a good open source data modeling / ER-diagram / CASE tools? I'd like to be able to build relatively simple schemas in one open source tool and be able to create a database on different platforms as needed (e.g. MySQL,

A bit off topic, but good web hosting for PostgreSQL/Python?

2006-02-25 Thread dananrg
Seems like most web hosting providers support MySQL, but not PostgreSQL. I need a web hosting account that supports PostgreSQL for a particular personal project I'm working on (as well as Python, natch), since PostGIS runs only on PostgreSQL. PostGIS is a nice open source spatial database

Multiple versions of Python / PythonWin on the same machine?

2006-02-24 Thread dananrg
I have Python 2.1 / PythonWin 2.1 installed on my machine because I need it for use with ESRI's ArcGIS Desktop software, but I want to play with a more recent version of Python. Is it safe to install more than one version of Python / PythonWin on the same machine? I don't want the latest release