Re: MS SQL Server: NT Authentication. Possible?

2006-08-22 Thread Dirk Hagemann
> You have a user named "null"? > > Off-hand, it looks very much like the CGI script is still running > with the privileges of the web-server, and /that/ is set up in a locked > down account that doesn't have connection rights. I also thought this might be the reason, but when I includ

Re: Modules... paths... newbie confusion

2006-08-22 Thread MrBlueSky
Thanks for the suggestions, folks.. site-packages ~~ OK, I'm been trying to get MSSQL into c:\Python24\lib\site-packages. MSSQL comes (as a tar'd, zip'd file) with a folder hierarchy with MSSQL.py at the top level and then bin\python2.3\mssqldb.pyd. If I try and copy this folder hierarch

Re: Loading module via full path

2006-08-22 Thread Andre Poenitz
Gary Herron <[EMAIL PROTECTED]> wrote: > Andre Poenitz wrote: >> Hi all. >> >> Is there a way to load a module given a full path to the module >> without extending sys.path first? > > The standard module named "imp" can help you with this. Thank you. I got stuck on http://docs.python.org/api/impor

How can I enumerate all windows services and disable some of them?

2006-08-22 Thread could . net
I know that Module win32service has some functions on manipulating win32 services. But I still have 2 questions: 1. how to enumerate all services? 2. how to disable a certain one? Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to decode a string

2006-08-22 Thread Fredrik Lundh
Lad wrote: > for > print repr(RealName) command > I will get > > P?ibylov\xe1 Ludmila > where instead of ? should be also a character that's not very likely; repr() always includes quotes, always escapes non-ASCII characters, and optionally includes a Unicode prefix. please try this prin

Re: how do you get the name of a dictionary?

2006-08-22 Thread Duncan Booth
jojoba wrote: > However, does it not seem reasonable to ask python: > > Given a dicitionary, Banana = {} > return one or more strings, > where each string is the name(s) of the reference(s) to Banana. > > why is this not sane?!?! > what am i missing here? Some time back I posted some code which

RE: Add users to directory/folder and set permissions in Windows

2006-08-22 Thread Tim Golden
[Adam Jones] | | Gallagher, Tim (NE) wrote: | > I was wondering if there was a way to add a user in active | directory to | > a folder and set the permissions. | | It should be possible. If you can use VBScript or JScript it will be | easier to find resources for those. You will probably need, a

Re: text editor suggestion?

2006-08-22 Thread [EMAIL PROTECTED]
John Salerno wrote: > > The thing I liked about UltraEdit is that you can define your own groups > of words and put whatever words you want in there, so my file had a > group called '__builtins__' and it listed all the Python built-in > methods, and those would be highlighted. Most editors I see do

Re: What do you want in a new web framework?

2006-08-22 Thread Tim Roberts
"Paul Boddie" <[EMAIL PROTECTED]> wrote: >Marc 'BlackJack' Rintsch wrote: >> emrahayanoglu wrote: >> > >> > Now i want to listen all of you. What do you want in that web >> > framework(Easy use of Database, Easy use of XML, GUI Designer, etc...)? >> >> Don't think that yet another Python web framew

Re: Unclear on argument passing to "sendmail'

2006-08-22 Thread Tim Roberts
John Draper <[EMAIL PROTECTED]> wrote: > >In "smtplib" module, the "sendmail" method of function is to be passed a >host, but it is the Domain name >for the SMTP Server as gotten from the "dig" command? IE: dig -tMX >would give me the SMTP >server. In my code I have: > >try: >print "Sen

wxWindow GetPosition() bug???

2006-08-22 Thread mardif
Hi, I've found a strange behavior in method GetPosition() of wxWindow class ( and derived ). On windows, if you create a window object frame = wx.Frame(None, -1, "TESTING") and you set the position to: frame.SetPosition( (300, 45000) ) If you call method GetPosition, the result will be: frame.G

Re: Python and STL efficiency

2006-08-22 Thread Ray
Fredrik Lundh wrote: > Ray wrote: > > >> in the C++ example, you're creating 4 string objects. > > > > In which case, Licheng, you should try using the /GF switch. This will > > tell Microsoft C++ compiler to pool identical string literals together. > > in what way does that change the impleme

Re: Python and STL efficiency

2006-08-22 Thread Ray
Tim N. van der Leeuw wrote: > > In which case, Licheng, you should try using the /GF switch. This will > > tell Microsoft C++ compiler to pool identical string literals together. > > > > > > :) > > The code still creates a new string - instance each time it tries to > append a const char* to the v

Re: Problem of function calls from map()

2006-08-22 Thread Peter Otten
Dasn wrote: > # size of 'dict.txt' is about 3.6M, 154563 lines > f = open('dict.txt', 'r') > lines = f.readlines() > def sp0(lines): > """> sp0() -- Normal 'for' loop""" > l = [] > for line in lines: > l.append(line.split('\t')) > return l Wh

Re: Python and STL efficiency

2006-08-22 Thread Tim N. van der Leeuw
Ray wrote: > Tim N. van der Leeuw wrote: > > > In which case, Licheng, you should try using the /GF switch. This will > > > tell Microsoft C++ compiler to pool identical string literals together. > > > > > > > > > :) > > > > The code still creates a new string - instance each time it tries to > >

RE: How can I enumerate all windows services and disable some of them?

2006-08-22 Thread Tim Golden
[EMAIL PROTECTED] | I know that Module win32service has some functions on manipulating | win32 services. | But I still have 2 questions: | 1. how to enumerate all services? | 2. how to disable a certain one? You can use WMI to do this if you want. Have a look at this example: http://tgolden.sc.

RE: How can I enumerate all windows services and disable some of them?

2006-08-22 Thread Tim Golden
[Tim Golden] | [EMAIL PROTECTED] | | | I know that Module win32service has some functions on manipulating | | win32 services. | | But I still have 2 questions: | | 1. how to enumerate all services? | | 2. how to disable a certain one? | | You can use WMI to do this if you want. ... or I could a

Re: Regular Expression question

2006-08-22 Thread Anthra Norell
Steve, I thought Fredrik Lundh's proposal was perfect. Are you now saying it doesn't solve your problem because your description of the problem was incomplete? If so, could you post a worst case piece of htm, one that contains all possible complications, or a collection of different cases all

Re: idutils and Python

2006-08-22 Thread Ramon Diaz-Uriarte
On 21 Aug 2006 22:56:13 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What exactly are you trying to accomplish? If you want to index > function/class names, variables, etc then you should take a look at > "exuberant ctags" http://ctags.sourceforge.net53 --although it started > off as a C

Re: convert a long string in binary

2006-08-22 Thread Maric Michaud
Le dimanche 20 août 2006 13:55, [EMAIL PROTECTED] a écrit : > bussiere maillist: > > i've got a very long string > > and i wanted to convert it in binary > > Not much tested: > > _nibbles = {"0":"", "1":"0001", "2":"0010", "3":"0011", > "4":"0100", "5":"0101", "6":"0110", "7":"0111"

Re: What do you want in a new web framework?

2006-08-22 Thread Paul Boddie
Tim Roberts wrote: > > Consider Ruby. If someone asks, "I'd like to do a web site with Ruby, what > should I use?", the answer comes back loud, clear, and unanimous: Ruby on > Rails. I actually believe that people in most buzzword shortlist situations see Rails as being the name in the list of ca

Re: Problem of function calls from map()

2006-08-22 Thread Georg Brandl
Paul McGuire wrote: > "Dasn" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> Hi, there. >> >> 'lines' is a large list of strings each of which is seperated by '\t' >> >>> lines = ['bla\tbla\tblah', 'bh\tb\tb', ... ] >> >> I wanna split each string into a list. For speed, using m

Re: How can I enumerate all windows services and disable some of them?

2006-08-22 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I know that Module win32service has some functions on manipulating > win32 services. > But I still have 2 questions: > 1. how to enumerate all services? > 2. how to disable a certain one? > > Thanks in advance! > win32service.EnumServic

Re: Python and STL efficiency

2006-08-22 Thread Mc Osten
Jeremy Sanders <[EMAIL PROTECTED]> wrote: > It must be the debugging, the compiler or a poor STL implementation. With > gcc 4 it runs instantly on my computer (using -O2), even with 10x the > number of values. $ gcc --version i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 53

Re: Python and STL efficiency

2006-08-22 Thread Mc Osten
Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: > I'm curious though, if on the OP's machine the slowed-down Python > version is still faster than the C++ version. I tested both on my machine (my other post in the thread) -- blog: http://www.akropolix.net/rik0/blogs | Uccidete i filosofi, site

Re: How to decode a string

2006-08-22 Thread Lad
Fredrik Lundh wrote: > Lad wrote: > > > for > > print repr(RealName) command > > I will get > > > > P?ibylov\xe1 Ludmila > > where instead of ? should be also a character > > that's not very likely; repr() always includes quotes, always escapes > non-ASCII characters, and optionally includes a Un

Configure python2.5 on Gentoo

2006-08-22 Thread Norman Khine
Hello, I have a strange result on a Gentoo machine in that, after I run ./configure and then type make, the make goes in circles. checking for c++... c++ configure: WARNING: By default, distutils will build C++ extension modules with "c++". If this is not intended, then set CXX on the config

Re: Python and STL efficiency

2006-08-22 Thread Fredrik Lundh
"Mc Osten" wrote: > In fact Python here is faster. Suppose it has a really optimized set > class... Python's memory allocator is also quite fast, compared to most generic allocators... -- http://mail.python.org/mailman/listinfo/python-list

How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Chris Brat
Hi, Is it possible to retrieve details about the database, specifically a list of the tables in the database; and then to retrieve the columns and their types for the tables? Is this dependant on the database? Thanks Chris -- http://mail.python.org/mailman/listinfo/python-list

RE: How to get database metadata information (i.e. existing tables andcolumns in tables)

2006-08-22 Thread Tim Golden
[Chris Brat] | Is it possible to retrieve details about the database, specifically a | list of the tables in the database; and then to retrieve the columns | and their types for the tables? | | Is this dependant on the database? In effect it's dependent on the database. We're assuming you're ta

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Mathias Waack
Chris Brat wrote: > Is it possible to retrieve details about the database, specifically a > list of the tables in the database; and then to retrieve the columns > and their types for the tables? Yes. > Is this dependant on the database? Yes. Real databases usually store meta-data (list of ta

Re: wxWindow GetPosition() bug???

2006-08-22 Thread Andre Poenitz
mardif <[EMAIL PROTECTED]> wrote: > Hi, > I've found a strange behavior in method GetPosition() of wxWindow class > > ( and derived ). > On windows, if you create a window object > > frame = wx.Frame(None, -1, "TESTING") > > and you set the position to: > frame.SetPosition( (300, 45000) ) > > I

Re: Python and STL efficiency

2006-08-22 Thread Mc Osten
Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Python's memory allocator is also quite fast, compared to most generic > allocators... In fact also in the two "slow" versions Python outperforms C++. I didn't notice it in the first place. -- blog: http://www.akropolix.net/rik0/blogs | Uccidete i fil

Re: Python and STL efficiency

2006-08-22 Thread Tim N. van der Leeuw
Mc Osten wrote: > Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > Python's memory allocator is also quite fast, compared to most generic > > allocators... > > In fact also in the two "slow" versions Python outperforms C++. > I didn't notice it in the first place. > But your C++ program outputs tim

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Miki
Hello Chris, > Is it possible to retrieve details about the database, specifically a > list of the tables in the database; and then to retrieve the columns > and their types for the tables? > > Is this dependant on the database? Yes and Yes. However some toolkits like SQLObject (http://www.sqlobje

Re: Python and STL efficiency

2006-08-22 Thread Tim N. van der Leeuw
Mc Osten wrote: > Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > Python's memory allocator is also quite fast, compared to most generic > > allocators... > > In fact also in the two "slow" versions Python outperforms C++. > I didn't notice it in the first place. > > -- > blog: http://www.akropoli

unicode "table of character" implementation in python

2006-08-22 Thread Nicolas Pontoizeau
Hi, I am handling a mixed languages text file encoded in UTF-8. Theres is mainly French, English and Asian languages. I need to detect every asian characters in order to enclose it by a special tag for latex. Does anybody know if there is a unicode "table of character" implementation in python? I

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Chris Brat
Thanks for the great feedback. Chris. Chris Brat wrote: > Hi, > > Is it possible to retrieve details about the database, specifically a > list of the tables in the database; and then to retrieve the columns > and their types for the tables? > > Is this dependant on the database? > > Thanks >

CONSTRUCT - Module Attributes and Execution Environment

2006-08-22 Thread lazaridis_com
I would like to change the construct: if __name__ == '__main__': to something like: if exec.isMain(): My (OO thought) is to place a class in an separate code module and to instantiate an singleton instance which would keep th something like this: class ExecutionEnv: def isMain(self)

Re: Modules... paths... newbie confusion

2006-08-22 Thread Steve Holden
MrBlueSky wrote: > Thanks for the suggestions, folks.. > > site-packages > ~~ > OK, I'm been trying to get MSSQL into c:\Python24\lib\site-packages. > MSSQL comes (as a tar'd, zip'd file) with a folder hierarchy with > MSSQL.py at the top level and then bin\python2.3\mssqldb.pyd. If I >

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-22 Thread Fuzzyman
lazaridis_com wrote: > I would like to change the construct: > > if __name__ == '__main__': > > to something like: > > if exec.isMain(): > > My (OO thought) is to place a class in an separate code module and to > instantiate an singleton instance which would keep th something like > this: > > clas

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Steve Holden
Chris Brat wrote: > Hi, > > Is it possible to retrieve details about the database, specifically a > list of the tables in the database; and then to retrieve the columns > and their types for the tables? > > Is this dependant on the database? > As far as locating the field names goes, this shoul

Re: Problem installing Python 2.4.3 on FreeBSD 5.3-RELEASE-p31

2006-08-22 Thread [EMAIL PROTECTED]
jamesuh wrote: > Martin v. Löwis wrote: > > [EMAIL PROTECTED] schrieb: > > > I assume this is related to the configure warning... ? Same error with > > > just a standard "./configure" and "make". > > > > > > Any help would be great :) > > > > If you don't need the curses module, go on with the in

Re: How to decode a string

2006-08-22 Thread Fredrik Lundh
"Lad" wrote: > The result of print "*", repr(RealName), type(RealName), "*" is > > * 'Fritschov\xe1 Laura' * looks like the MySQL interface is returning 8-bit strings using ISO-8859-1 encoding (or some variation of that; \xE1 is "LATIN SMALL LETTER A WITH ACUTE" in 8859-1). have you tried passi

Re: Python and STL efficiency

2006-08-22 Thread Jeremy Sanders
Mc Osten wrote: > Here some results (I know that the fpoint optimizations are useless... > it's is my "prebuilt" full optimization macro :) ): Interesting. The opimisation makes no difference to the speed of the C++ one for me. I just get xpc17:~> g++4 -O2 test2.cpp xpc17:~> ./a.out What do you

Re: Problem of function calls from map()

2006-08-22 Thread Sion Arrowsmith
Dasn <[EMAIL PROTECTED]> wrote: ># size of 'dict.txt' is about 3.6M, 154563 lines >f = open('dict.txt', 'r') >print "Reading lines..." >lines = f.readlines() >print "Done." [ ... ] >def sp1(lines): > """> sp1() -- List-comprehension""" > return [s.split('\t') for s in lines] [ ..

Re: IDLE with python 2.5

2006-08-22 Thread Miki
Hello Emmanuel, > I've just read in Python 2.5 description that IDLE 'executes code in a > separate process', using a TCP connection on port 127.0.0.1 to > communicate. This is older than 2.5 (for sure it's in 2.4, can't remember if it was in 2.3) > Does it mean that we can now debug embedded pyth

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-22 Thread Duncan Booth
lazaridis_com wrote: > Are ther alternative constructs/mechanism available, which could be > used to add this functionality possiby directly to a code-module? How about something along these lines: -- auto.py - import sys, atexit def main_body(f): if f.func_globals['

Re: Modules... paths... newbie confusion

2006-08-22 Thread Sibylle Koczian
Steve Holden schrieb: > You won;t get MySQLdb to run without running the setup.py since IIRC > there's a compile step for a C library (and it's that compile step that > needs to be able to find the MySQL client libraries). > But MySQLdb comes with a windows installer. No need to tweak anything. So

Re: Problem of function calls from map()

2006-08-22 Thread Paul McGuire
"Georg Brandl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul McGuire wrote: > > "Dasn" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> > >> Hi, there. > >> > >> 'lines' is a large list of strings each of which is seperated by '\t' > >> >>> lines = ['bla\tbl

a question to run a Python program using PMW

2006-08-22 Thread Agathe Sørflaten
Title: Message Hi   I found your questio regarding "I am new to Python and I am trying to run an old program. I do notknow what version this old program was running back in 2001 ( I knowit was run successfully). I got the source codes from the office and Idownloaded Python 2.3 and Pmw 1.2. w

Re: What do you want in a new web framework?

2006-08-22 Thread Alex Martelli
Tim Roberts <[EMAIL PROTECTED]> wrote: ... > themselves. However, in the case of web frameworks, I believe Marc is > fundamentally correct: the web framework proliferation in Python is > actually doing the language a huge disservice. Indeed, it has been truthfully observed that Python's the on

bit-torrent client code open source in Python written

2006-08-22 Thread thomasasta
Hey there is a new python written open source bit-torrent client out. Don´t mit it up with brams c++ bittorrent, in python it is bit-torrent.sf.net Don´t forget the minus - http://bit-torrent.sourceforge.net/ It´s out till 10 days and the code is open source, so you can add it to any other app

Re: How to decode a string

2006-08-22 Thread Lad
Fredrik Lundh wrote: > "Lad" wrote: > > > The result of print "*", repr(RealName), type(RealName), "*" is > > > > * 'Fritschov\xe1 Laura' * > > looks like the MySQL interface is returning 8-bit strings using ISO-8859-1 > encoding (or some variation of that; \xE1 is "LATIN SMALL LETTER A > WITH AC

Re: What do you want in a new web framework?

2006-08-22 Thread Fredrik Lundh
Alex Martelli wrote: > Indeed, it has been truthfully observed that Python's the only language > with more web frameworks than keywords. recent research indicates that it has more web frameworks than comments in the source code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem of function calls from map()

2006-08-22 Thread Fredrik Lundh
Sion Arrowsmith wrote: > I think there's something weird going on -- sp4 should be making > 154563 calls to str.split. So no wonder it goes faster -- it's not doing > any work. of course it does: >>> lines = ["line\tone", "line\ttwo"] >>> [s.split("\t") for s in lines] [['line', 'one'], ['line',

Re: Python and STL efficiency

2006-08-22 Thread Mc Osten
Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: > But your C++ program outputs times in seconds, right? So all > compilations except for the first two give results in less than a > second, right? (meaning the optimizations of your standard-compilation > give worst results than -O3?) Yes. It's in

Re: Python and STL efficiency

2006-08-22 Thread Mc Osten
Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: > Oh boy; yes indeed the slow python is faster than the fast C++ > version... Must be something really awful happening in the STL > implementation that comes with GCC 3.4! And the Python version does the very same number of iterations than the C++ o

Re: text editor suggestion?

2006-08-22 Thread John Salerno
Ravi Teja wrote: > Stick to SciTE. It takes almost no learning effort and meets everyone > of those requirements. As far as customerization goes, SciTE can be > customerized quite well. In fact, it can even be scripted with Lua. You > seem to be using the single file executable which does not come

Re: unicode "table of character" implementation in python

2006-08-22 Thread Brian Beck
Nicolas Pontoizeau wrote: > I am handling a mixed languages text file encoded in UTF-8. Theres is > mainly French, English and Asian languages. I need to detect every > asian characters in order to enclose it by a special tag for latex. > Does anybody know if there is a unicode "table of character"

Re: unicode "table of character" implementation in python

2006-08-22 Thread Nicolas Pontoizeau
2006/8/22, Brian Beck <[EMAIL PROTECTED]>: > Nicolas, check out the unicodedata module: > http://docs.python.org/lib/module-unicodedata.html > > Find "import unicodedata" on this page for how to use it: > http://www.amk.ca/python/howto/unicode > > I'm not sure if it has built-in support for finding

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-22 Thread Larry Bates
lazaridis_com wrote: > I would like to change the construct: > > if __name__ == '__main__': > > to something like: > > if exec.isMain(): > > My (OO thought) is to place a class in an separate code module and to > instantiate an singleton instance which would keep th something like > this: > >

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-22 Thread Georg Brandl
Larry Bates wrote: > lazaridis_com wrote: >> I would like to change the construct: >> >> if __name__ == '__main__': >> >> to something like: >> >> if exec.isMain(): >> >> My (OO thought) is to place a class in an separate code module and to >> instantiate an singleton instance which would keep

Re: Problem of function calls from map()

2006-08-22 Thread Sion Arrowsmith
Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Sion Arrowsmith wrote: >> I think there's something weird going on -- sp4 should be making >> 154563 calls to str.split. So no wonder it goes faster -- it's not doing >> any work. >the problem is that he's using a Python-level profiler to benchmark things

Translating Javascript programs to python.

2006-08-22 Thread Vyz
Hi, I have a script with hundreds of lines of javascript spread accross 7 files. Is there any tool out there to automatically or semi-automatically translate the code into python. Thanks Vyz -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you get the name of a dictionary?

2006-08-22 Thread jojoba
Hello again, Fredrick said: > Python's object model. an object has a value, a type, and an identity, > but no name. I say: Thank you Fredrick for the reply! However, although python's object model does not currently support what i am asking for, how difficult would it be to assign a string nam

Re: Translating Javascript programs to python.

2006-08-22 Thread Diez B. Roggisch
Vyz schrieb: > Hi, > I have a script with hundreds of lines of javascript spread accross 7 > files. Is there any tool out there to automatically or > semi-automatically translate the code into python. Nope. Besides: in which environment does that script run - a browser? Then it would be difficul

Re: Python and STL efficiency

2006-08-22 Thread Tim N. van der Leeuw
Mc Osten wrote: > Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: > > > Oh boy; yes indeed the slow python is faster than the fast C++ > > version... Must be something really awful happening in the STL > > implementation that comes with GCC 3.4! > > And the Python version does the very same number

Re: idutils and Python

2006-08-22 Thread [EMAIL PROTECTED]
Ramon Diaz-Uriarte wrote: > On 21 Aug 2006 22:56:13 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > What exactly are you trying to accomplish? If you want to index > > function/class names, variables, etc then you should take a look at > > "exuberant ctags" http://ctags.sourceforge.net53

Re: how do you get the name of a dictionary?

2006-08-22 Thread Georg Brandl
jojoba wrote: > Hello again, > > Fredrick said: > >> Python's object model. an object has a value, a type, and an identity, >> but no name. > > I say: > > Thank you Fredrick for the reply! > However, although python's object model does not currently support what > i am asking for, how difficul

Re: Need advice on how to improve this function

2006-08-22 Thread Gabriel Genellina
At Monday 21/8/2006 12:03, Larry Bates wrote: > I wrote a function that converts a tuple of tuples into html. For > example: > I'd like to know ways to make it better (more efficient, able to deal > with enormous-size arguments, etc). How would I write this as a > generator? Before you put too

Re: how do you get the name of a dictionary?

2006-08-22 Thread BartlebyScrivener
>> how difficult would it be to assign a string name(s) >> to an object upon creation (and upon referencing)? Exactly the point that's being made. It's so easy just do it yourself: banana={"name":"banana"} Hey what is the name of my dictionary? banana["name"] But why build it into Python and f

Re: Unclear on argument passing to "sendmail'

2006-08-22 Thread John Draper
Tim Williams wrote: > On 21/08/06, John Draper <[EMAIL PROTECTED]> wrote: > >> In "smtplib" module, the "sendmail" method of function is to be passed > > > host, but it is the Domain name > >> for the SMTP Server as gotten from the "dig" command? IE: dig -tMX >> would give me the SMTP >> serv

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Luis M. González
If you want to know the names of the fields on a recordset, you can use cursor.description. For example, lets say you have a connection to a MySQL database: con = MySQLdb.connect('localhost','root','','mydb') cur = con.cursor() cur.execute('select * from customers') result = cur.fetchall() fields

Re: Create a Multilanguage PDF in Python

2006-08-22 Thread Perseo
Thanks I will try it. Diez B. Roggisch wrote: > Perseo wrote: > > > I can't upload in the PYTHONPATH but in a normal folder of our site. > > Exist another way to do it? > > PYTHONPATH is an environment variable. You can set it to arbitrary paths, > and python will look for module there, too. Or yo

Re: Input from the same file as the script

2006-08-22 Thread Dieter Maurer
Georg Brandl <[EMAIL PROTECTED]> writes on Sun, 20 Aug 2006 20:08:38 +0200: > [EMAIL PROTECTED] wrote: > > Can the input to the python script be given from the same file as the > > script itself. e.g., when we execute a python script with the command > > 'python > When I ran the below the python i

Unicode Error

2006-08-22 Thread Gallagher, Tim (NE)
Hey all I am learning Python and having a fun time doing so.  I have a question for y'all, it has to do with active directory.   I want to get the last login for a computer from Active Directory.  I am using the active_directory module and here is my code.   [START

Re: how do you get the name of a dictionary?

2006-08-22 Thread jojoba
> Exactly the point that's being made. It's so easy just do it yourself: > banana={"name":"banana"} > Hey what is the name of my dictionary? > banana["name"] > But why build it into Python and force everyone else to do it, when > most of the time nobody cares what the name is, or they already know?

Re: how do you get the name of a dictionary?

2006-08-22 Thread Carsten Haese
On Tue, 2006-08-22 at 12:34, jojoba wrote: > Hello again, > > Fredrick said: > > > Python's object model. an object has a value, a type, and an identity, > > but no name. > > I say: > > Thank you Fredrick for the reply! > However, although python's object model does not currently support what

Re: text editor suggestion?

2006-08-22 Thread Ravi Teja
John Salerno wrote: > Ravi Teja wrote: > > > Stick to SciTE. It takes almost no learning effort and meets everyone > > of those requirements. As far as customerization goes, SciTE can be > > customerized quite well. In fact, it can even be scripted with Lua. You > > seem to be using the single fil

Re: how do you get the name of a dictionary?

2006-08-22 Thread Gabriel Genellina
At Tuesday 22/8/2006 13:34, jojoba wrote: i don't want to do anything sophisticated with this, i am really only looking for a TITLE for my dictionary when i throw it in a tree editor that i have built. And i do realize that its not possible now. I am just pressing a point here. Sorry to ruffle

Re: Problem of function calls from map()

2006-08-22 Thread Fredrik Lundh
Sion Arrowsmith wrote: >> (you cannot really use "profile" to *benchmark* things written in Python >> either; the >> profiler tells you where a given program spends the time, not how fast it is >> in com- >> parision with other programs) > > Hmm. Playing around with timeit suggests that althoug

Job Jar

2006-08-22 Thread D
Hello, I apologize in advance for the vague description, but as of now I only have an idea of what I'd like to do, and need some guidance as to if it is feasible, and where to begin. Basically, I'd like to create a web-based "job jar", that users in my office can access in order to view, and "take

Re: how do you get the name of a dictionary?

2006-08-22 Thread jojoba
> At the risk of stating the obvious, why don't you simply add a parameter > for the title in the invocation of the tree editor? I.e. instead of > invoke_tree_editor(somedict) > do > invoke_tree_editor(somedict, "somedict") > HTH, > Carsten. Thanks Carsten. This would indeed allow me to assign

Re: how do you get the name of a dictionary?

2006-08-22 Thread Fredrik Lundh
jojoba wrote: > However, although python's object model does not currently support what > i am asking for, how difficult would it be to assign a string name(s) > to an object upon creation (and upon referencing)? if you want to add additional behaviour to an object, wrap it in custom class, or u

Re: https on ActiveState Python 2.4?

2006-08-22 Thread Jack
Thanks for the reply. I found some openSSL patches for earlier versions of ActiveState Python. It involves .pyd files and they look for earlier versions of Python DLLs and don't run on ActiveState Python 2.4. I suspect the regular Python solution would have the same problem or even more problems

Re: Job Jar

2006-08-22 Thread Fredrik Lundh
D wrote: > Hello, I apologize in advance for the vague description, but as of now > I only have an idea of what I'd like to do, and need some guidance as > to if it is feasible, and where to begin. Basically, I'd like to > create a web-based "job jar", that users in my office can access in > orde

Re: https on ActiveState Python 2.4?

2006-08-22 Thread Fredrik Lundh
Jack wrote: > Thanks for the reply. > > I found some openSSL patches for earlier versions of ActiveState Python. > It involves .pyd files and they look for earlier versions of Python DLLs and > don't run on ActiveState Python 2.4. I suspect the regular Python solution > would > have the same pro

Re: Job Jar

2006-08-22 Thread D
Thanks, Fredrik - but could I adapt them so that, instead of using them for bug tracking (don't need version control, etc.), they're just used for keeping track of simple tasks? Fredrik Lundh wrote: > D wrote: > > > Hello, I apologize in advance for the vague description, but as of now > > I only

Re: Create a Multilanguage PDF in Python

2006-08-22 Thread Perseo
Nothing to do! I enable test2.py and the folder with 777 permission and I write at the top of the file the PYTHONPATH "#!/usr/bin/python" as you told me but it doesn't works as well. this is my organization: www.domain.com/python/reportlab/ [all files] www.domain.com/python/test2.py #!/usr/bin/p

key not found in dictionary

2006-08-22 Thread KraftDiner
I have a dictionary and sometime the lookup fails... it seems to raise an exception when this happens. What should I do to fix/catch this problem? desc = self.numericDict[k][2] KeyError: 589824 < This is the error that is being produced, because there is no key 589824. -- http://mail.p

Re: key not found in dictionary

2006-08-22 Thread hiaips
KraftDiner wrote: > I have a dictionary and sometime the lookup fails... > it seems to raise an exception when this happens. > What should I do to fix/catch this problem? > > desc = self.numericDict[k][2] > KeyError: 589824 < This is the error that is being produced, > because there is n

Re: text editor suggestion?

2006-08-22 Thread John Salerno
Ravi Teja wrote: > ??? > > In the same file, near the top. > > keywordclass.python=and assert break class continue def del elif \ > else except exec finally for from global if import in is lambda None \ > not or pass print raise return try while yield > > I could add my own keywords to it. >

Re: key not found in dictionary

2006-08-22 Thread [EMAIL PROTECTED]
KraftDiner wrote: > I have a dictionary and sometime the lookup fails... > it seems to raise an exception when this happens. > What should I do to fix/catch this problem? > > desc = self.numericDict[k][2] > KeyError: 589824 < This is the error that is being produced, > because there is no

Re: key not found in dictionary

2006-08-22 Thread Chaz Ginger
KraftDiner wrote: > I have a dictionary and sometime the lookup fails... > it seems to raise an exception when this happens. > What should I do to fix/catch this problem? > > desc = self.numericDict[k][2] > KeyError: 589824 < This is the error that is being produced, > because there is n

Re: Job Jar

2006-08-22 Thread Gabriel Genellina
At Tuesday 22/8/2006 15:47, D wrote: Thanks, Fredrik - but could I adapt them so that, instead of using them for bug tracking (don't need version control, etc.), they're just used for keeping track of simple tasks? Roundup is generic enough to be used for alm

Re: key not found in dictionary

2006-08-22 Thread Philippe Martin
KraftDiner wrote: > I have a dictionary and sometime the lookup fails... > it seems to raise an exception when this happens. > What should I do to fix/catch this problem? > > desc = self.numericDict[k][2] > KeyError: 589824 < This is the error that is being produced, > because there is

Re: key not found in dictionary

2006-08-22 Thread Pierre Quentel
Depending on what you want to do if the key doesn't exist, you might want to use the dictionary method get() : value = some_dict.get(key,default) sets value to some_dict[key] if the key exists, and to default otherwise Regards, Pierre -- http://mail.python.org/mailman/listinfo/python-list

Re: radio buttons in curses

2006-08-22 Thread Fabian Braennstroem
Sorry, me again... Does nobody have an idea or is it to stupid? * Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > Hi, > > I want to add some radio and check buttons to my curses > script. As I understand it, there are no buttons in the > 'basic' curses module. Now, I found the curses-extra module

Re: how do you get the name of a dictionary?

2006-08-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jojoba wrote: > Aha. > my problem, (which as i said before, is not really an important > problem) is to take any dictionary and load it into a tree viewer AND > get the name(s) of that dictionary (if they exist, and if not, so be > it). How do you take "any" dictionary

  1   2   >