Re: text editor suggestion?

2006-08-18 Thread Ant
John Salerno wrote: > I'd really like to learn vim, but I spent days just trying to figure out > how to get the syntax highlighting and indentation working, where these > settings are and how to edit them, and it still doesn't work for me. It > just feels so insurmountable that I can't even start

Re: couple more questions about sqlite

2006-08-18 Thread John Salerno
Dennis Lee Bieber wrote: > SQLite, in whatever incarnation, is a "file server" database. There > is no separate database server running -- each application is linked > directly to the code that opens and processes the database file(s). > > If SQLite is supplied with the impending Pyth

Re: text editor suggestion?

2006-08-18 Thread John Salerno
Ben Finney wrote: > The two big names in text editing, Vim and Emacs, will both meet these > criteria easily. They also have the advantage that you'll find one or > the other, or both, on just about any Unix system intended for use by > a programmer. > > There is also an enormous amount of support

Re: text editor suggestion?

2006-08-18 Thread John Salerno
BartlebyScrivener wrote: > John Salerno wrote: > >> Ok, I know it's been asked a million times, but I have a more specific >> question so hopefully this won't be just the same old post. > > You got 65 answers last time :) > > http://tinyurl.com/rsfjq > > rd > Hmm, I forgot all about that. Alt

Re: Search or compai problem

2006-08-18 Thread Gabriel Genellina
At Saturday 19/8/2006 01:16, [EMAIL PROTECTED] wrote: it is really lstusers (it is an L not a # 1), Some of the output from print lstUsers has the output of None. I and trying to filter the None out of the list. I come from a perl background and this is how I do thing in perl None is a uni

Re: efficient memoize decorator?

2006-08-18 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > all of the memoize decorators at the python cookbook seem to make my > code slower. if you want good performance, use the following pattern: def col(n, count, memo={}): try: return memo[n, count] except KeyError: # ... calc

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

2006-08-18 Thread [EMAIL PROTECTED]
jojoba wrote: > Does anyone know how to find the name of a python data type. > > Conside a dictionary: > > Banana = {} > > Then, how do i ask python for a string representing the name of the > above dictionary (i.e. 'Banana')? The reason people are banging their heads is because the question doesn

Re: efficient memoize decorator?

2006-08-18 Thread Fredrik Lundh
Gabriel Genellina wrote: > This implementation uses cPickle to generate a key from the supplied > function arguments, which is very slow and defeats the purpose of > memoizing. depends on the cost of recreating an object, of course. it's a bit surprising that so many programmers seem to think

Re: sum and strings

2006-08-18 Thread Georg Brandl
Paul Rubin wrote: > Georg Brandl <[EMAIL PROTECTED]> writes: >> Why would you try to sum up strings? Besides, the ''.join idiom is quite >> common in Python. > > Just because it's common doesn't mean it's obvious. In my opinion > it's as ugly as sin, and the fact that it's an idiom shows a > shor

py2exe: cannot identify image file

2006-08-18 Thread Daniel Mark
Hello all: I have following code that works well under command line, but it doesn't work after I convert it as exe application. ### file: testPath.py import getopt, math, sys, os, Image, ImageDraw, aggdraw def processline(): try: imgDir = 'c:/' lumenImageName = '0

Re: couple more questions about sqlite

2006-08-18 Thread Robert Kern
John Machin wrote: > John Salerno wrote: >> John Machin wrote: >> >>> Your confusion is quite understandable. I started looking at sqlite >>> when the announcement that it would be included in Python 2.5 came out. >>> Puzzlement reigned. I ended up with the following up the front of my >>> experime

Re: text editor suggestion?

2006-08-18 Thread BartlebyScrivener
John Salerno wrote: > Ok, I know it's been asked a million times, but I have a more specific > question so hopefully this won't be just the same old post. You got 65 answers last time :) http://tinyurl.com/rsfjq rd -- http://mail.python.org/mailman/listinfo/python-list

Re: Search or compai problem

2006-08-18 Thread timgerr
John Machin wrote: > Gallagher, Tim (NE) wrote: > > I am new to python and I want to compare 2 strings, here is my code: > > [start] > > > > import active_directory > > import re > > > > lstUsers = [] > > Using "lst" or "l" as a variable name is bad news in any language; with > many fonts they are

Questions on unittest behaviour

2006-08-18 Thread Collin Winter
While working on a test suite for unittest these past few weeks, I've run across some behaviours that, while not obviously wrong, don't strike me as quite right, either. Submitted for your consideration: 1) TestCase.tearDown() is only run if TestCase.setUp() succeeded. It seems to me that tearDown

Re: efficient memoize decorator?

2006-08-18 Thread Gabriel Genellina
At Friday 18/8/2006 17:14, [EMAIL PROTECTED] wrote: sorry memoize is http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496879 This implementation uses cPickle to generate a key from the supplied function arguments, which is very slow and defeats the purpose of memoizing. In your example

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

2006-08-18 Thread Steve Holden
BartlebyScrivener wrote: > Tim Chase wrote: > >>How would you ask for the object? >> >> >>> print get_name(banana) >> >>you might as well write >> >> >>> print "banana" >> > > Or there used to be a guy in this group who said it was like asking a > cat for its name. He headbanged himself unconscio

Re: text editor suggestion?

2006-08-18 Thread OriginalBrownster
John Salerno wrote: > Ok, I know it's been asked a million times, but I have a more specific > question so hopefully this won't be just the same old post. I've tried a > few different editors, and I really like UltraEdit, but it's > Windows-only and I'm working more on Linux nowadays. > > Here are

Re: text editor suggestion?

2006-08-18 Thread Simon Forman
Paul Rubin wrote: > "Simon Forman" <[EMAIL PROTECTED]> writes: > > Have you tried IDLE? It ships with python, meets your 5 criteria(*), > > can be customized (highlighting colors and command keys and more), and > > includes a usable GUI debugger. It's got some warts, but I like it a > > lot, it's

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

2006-08-18 Thread Steve Holden
John Salerno wrote: > Fredrik Lundh wrote: > >>Andy Terrel wrote: >> >> >>>for i in dir(): >>> if eval(i) == Banana: >>> print i >> >>(sound of head hitting desk) >> >> >> > lol Right. Plus it's fun to imagine the effbot hitting itself as hard as some people would obviously have

Re: text editor suggestion?

2006-08-18 Thread David Isaac
http://www.american.edu/econ/notes/soft.htm#EDITORS has some relevant discussion and suggestions. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

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

2006-08-18 Thread BartlebyScrivener
Tim Chase wrote: > How would you ask for the object? > > >>> print get_name(banana) > > you might as well write > > >>> print "banana" > Or there used to be a guy in this group who said it was like asking a cat for its name. He headbanged himself unconscious though, or so they say. http://tinyur

Re: sum and strings: Summary

2006-08-18 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > I also found this from Guido: > http://mail.python.org/pipermail/python-dev/2003-April/034853.html > And this, in the same thread: > http://mail.python.org/pipermail/python-dev/2003-April/034854.html > > So, > The upshot is that complexity matters. The alg

Re: sum and strings: Summary

2006-08-18 Thread Paddy
Paul Rubin wrote: > "Paddy" <[EMAIL PROTECTED]> writes: > > Pythons designers seem to know and apply the advantages of having fewer > > 'themes' that can be applied with less constraints I am curious about > > such a constraint on sum. > > The opposing argument is that sum is sort of like reduce,

Re: text editor suggestion?

2006-08-18 Thread Paul Rubin
"Simon Forman" <[EMAIL PROTECTED]> writes: > Have you tried IDLE? It ships with python, meets your 5 criteria(*), > can be customized (highlighting colors and command keys and more), and > includes a usable GUI debugger. It's got some warts, but I like it a > lot, it's pretty much all I use for m

Re: text editor suggestion?

2006-08-18 Thread Simon Forman
John Salerno wrote: > Ok, I know it's been asked a million times, but I have a more specific > question so hopefully this won't be just the same old post. I've tried a > few different editors, and I really like UltraEdit, but it's > Windows-only and I'm working more on Linux nowadays. > > Here are

Re: sum and strings

2006-08-18 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > Pythons designers seem to know and apply the advantages of having fewer > 'themes' that can be applied with less constraints I am curious about > such a constraint on sum. The opposing argument is that sum is sort of like reduce, i.e. sum((a,b,c,d)) could conc

Re: text editor suggestion?

2006-08-18 Thread Ben Finney
John Salerno <[EMAIL PROTECTED]> writes: > Here are my criteria: > > 1. syntax highlighting (highly customizable) > 2. auto/smart indenting > 3. ability to run script > 4. light-weight text editor, not an IDE > 5. cross-platform (not really necessary, but nice) The two big names in text editing,

Re: sum and strings

2006-08-18 Thread Paul Rubin
Sybren Stuvel <[EMAIL PROTECTED]> writes: > > Those are obvious??? > Yup. Just read the string documentation and you're off. Huh? Just because some obscure weirdness like this is in the manual, doesn't make it obvious or natural. -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-18 Thread Paddy
Georg Brandl wrote: > Paddy wrote: <> > > I get where you are coming from, but in this case we have a function, > > sum, that is not as geeral as it could be. sum is already here, and > > works for some types but not for strings which seems an arbitrary > > limitation that impede duck typing. > >

Re: sum and strings

2006-08-18 Thread Paul Rubin
Georg Brandl <[EMAIL PROTECTED]> writes: > Why would you try to sum up strings? Besides, the ''.join idiom is quite > common in Python. Just because it's common doesn't mean it's obvious. In my opinion it's as ugly as sin, and the fact that it's an idiom shows a shortcoming in Python. The obviou

Re: text editor suggestion?

2006-08-18 Thread nemesian
Have you tried Notepad++? It's a neat text-editor. -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-18 Thread Paddy
Fredrik Lundh wrote: > Paddy wrote: > > > Here is where I see the break in the 'flow': > > > 1+2+3 > > 6 > sum([1,2,3], 0) > > 6 > [1] + [2] +[3] > > [1, 2, 3] > sum([[1],[2],[3]], []) > > [1, 2, 3] > '1' + '2' + '3' > > '123' > sum(['1','2','3'], '') > > Traceback (m

Re: Http client to POST using multipart/form-data

2006-08-18 Thread Gabriel Genellina
At Friday 18/8/2006 03:06, Bruno Dilly wrote: I'm implementing a http client to POST using multipart/form-data. It uses urllib2 module, and files are uploaded correctly. But I need to know how much has been uploaded at a given moment, to inform the user the proportion of the file already upload

Re: couple more questions about sqlite

2006-08-18 Thread John Machin
John Salerno wrote: > John Machin wrote: > > > Your confusion is quite understandable. I started looking at sqlite > > when the announcement that it would be included in Python 2.5 came out. > > Puzzlement reigned. I ended up with the following up the front of my > > experimental module: > > So do

text editor suggestion?

2006-08-18 Thread John Salerno
Ok, I know it's been asked a million times, but I have a more specific question so hopefully this won't be just the same old post. I've tried a few different editors, and I really like UltraEdit, but it's Windows-only and I'm working more on Linux nowadays. Here are my criteria: 1. syntax high

Re: couple more questions about sqlite

2006-08-18 Thread John Salerno
John Machin wrote: > Your confusion is quite understandable. I started looking at sqlite > when the announcement that it would be included in Python 2.5 came out. > Puzzlement reigned. I ended up with the following up the front of my > experimental module: So does this mean that when 2.5 is relea

Re: Using Beautiful Soup

2006-08-18 Thread Jorge Godoy
"Tempo" <[EMAIL PROTECTED]> writes: > Heya. I have never used a module/script before, and the first problem I > have run into is that I do not know how to install a module/script. I > have downloaded Beautiful Soup, but how do I use it in one of my own > programs? I know that I use an "include" st

Re: couple more questions about sqlite

2006-08-18 Thread Paul McGuire
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I would strongly recommend for a learner of SQL and the Python DBAPI: > (1) start with sqlite; it's great, and there's minimal admin involved > (2) download the command-line utility from the sqlite website -- you'll > need

Re: Py2Exe and sys.argv : The Lost Arguments

2006-08-18 Thread Gabriel Genellina
At Thursday 17/8/2006 16:42, Thomas W wrote: Is it impossible to compile a script using py2exe and pass selected items in Explorer to my script? It works fine when called on the command line so it might be something related to Explorer but I'm completly lost. Yes, it is related to Explorer -so

Using Beautiful Soup

2006-08-18 Thread Tempo
Heya. I have never used a module/script before, and the first problem I have run into is that I do not know how to install a module/script. I have downloaded Beautiful Soup, but how do I use it in one of my own programs? I know that I use an "include" statement, but do I first need to make a copy o

Re: Python for arcgis

2006-08-18 Thread Gabriel Genellina
At Thursday 17/8/2006 00:25, subramanian2003 wrote: From where can I get the python tutorial for arcgis customisation?. Tried google? Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo

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

2006-08-18 Thread Matimus
You could do something like this: >>> class MyDict(dict): ... pass >>> bananna = MyDict({"foo":"bar"}) #dict constructor still works >>> bananna.name = "bananna" >>> bananna.name 'bananna' >>> bananna {'foo': 'bar'} Or, you could also just do this: >>> bananna = {"name":"bananna"} Depending

Re: couple more questions about sqlite

2006-08-18 Thread John Machin
John Salerno wrote: > [EMAIL PROTECTED] wrote: > >> 2. What's the difference between sqlite and pysqlite? Do you need both, > >> just one, or is one an older version of the same thing? > > > > To access your database from python you need both (or some alternative > > to pysqlite) > > I can understa

Re: Search or compai problem

2006-08-18 Thread John Machin
Gallagher, Tim (NE) wrote: > I am new to python and I want to compare 2 strings, here is my code: > [start] > > import active_directory > import re > > lstUsers = [] Using "lst" or "l" as a variable name is bad news in any language; with many fonts they are too easily misread as "1st" or "1" respe

Re: plpython and pickle

2006-08-18 Thread Lee Harr
On 2006-08-17, Gerardo Herzig <[EMAIL PROTECTED]> wrote: > Hi all, sory if this is kind of [OT], but cannot find the answer for > this behaviour > Might try on a postgres mailing list. I'd say it is more on topic there... > You are now connected to database "sessions". > sessions=# s

Re: It is __del__ calling twice for some instances?

2006-08-18 Thread Max Yuzhakov
Duncan Booth wrote: DB> BTW, the behaviour is completely different if you use a new style class, DB> but still somewhat bizarre: for new style classes only the first 25 objects DB> get freed when you clear a, the remainder are only released by the garbage DB> collector. If to add the

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

2006-08-18 Thread Andy Terrel
Georg Brandl wrote: > Andy Terrel wrote: > > Why bang your head? > > Because there's no chance that the original request is sane. > > If you want your objects to know their name, give them a name as an attribute. > This is true but sometimes it is just fun to hack around. -- http://mail.python

Re: It is __del__ calling twice for some instances?

2006-08-18 Thread Max Yuzhakov
Duncan Booth wrote: DB> I figured out what is going on in the code to deallocate an old-style class DB> instance: DB> DB> The reference count is temporarily incremented. DB> DB> If the class has a __del__ method then a descriptor is created for the DB> method and called. When the

urllib2, proxies and https

2006-08-18 Thread Astan Chee
Hi again, According to https://demo.launchpad.net/products/python/+bug/56872 or more specifically, the example of its working code: http://librarian.demo.launchpad.net/3507227/urllib2_proxy_auth.py I can use urllib2 via proxy to access a https site(specifically hooking it up to libgmail). The prob

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

2006-08-18 Thread Georg Brandl
Andy Terrel wrote: > Why bang your head? Because there's no chance that the original request is sane. If you want your objects to know their name, give them a name as an attribute. > It was a stupid hack that has lots of problems, > but done in a way that is readable. Sure I could do something

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

2006-08-18 Thread Andy Terrel
Why bang your head? It was a stupid hack that has lots of problems, but done in a way that is readable. Sure I could do something more functional or one lined like: Banana={} names = filter(lambda x:id(eval(x))==id(Banana),dir()) but I am guessing that it is harder to read by many. Anywho I ca

PyThreadState_Swap(NULL)

2006-08-18 Thread Bryan
hi, i've written a program that uses python c api code that lives in a shared library that is loaded by a custom apache module (mod_xxx). this python c api code all works correctly under our test server and under apache but only if mod_python isn't loaded. when apache loads mod_python as sho

Python for EXIF-info-additions ?

2006-08-18 Thread Bror Johansson
Is there somewhere some Python-module that can be used for adding EXIF-info to JPEG files? (Modules for extraction of EXIF-data are easily found, but lacks - as I see it - capacity to add new tags.) /BJ -- http://mail.python.org/mailman/listinfo/python-list

Re: It is __del__ calling twice for some instances?

2006-08-18 Thread Patrick Maupin
Duncan Booth wrote: > Duncan Booth wrote: > > > As to why it happens, there is a mechanism in Python to stop unlimited > > stack being used when objects are freed: when the stack gets too deep > > then instead of being released, the Py_DECREF call puts the object > > into a trashcan list and the o

Search or compai problem

2006-08-18 Thread Gallagher, Tim (NE)
I am new to python and I want to compare 2 strings, here is my code: [start] import active_directory import re lstUsers = [] users = active_directory.root() for user in users.search ("sn='gallagher'"): lstUsers.append(user.samAccountName) print "--

Re: The Semicolon Wars as a software industry and human condition

2006-08-18 Thread Michele Dondi
On 17 Aug 2006 06:42:55 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: >Of interest: > >• The Semicolon Wars, by Brian Hayes. 2006. > http://www.americanscientist.org/template/AssetDetail/assetid/51982 [snip] >• What Languages to Hate, Xah Lee, 2002 >http://xahlee.org/UnixResource_dir/writ/language_t

Re: sqlite3 or mysqldb?

2006-08-18 Thread Ravi Teja
> To learn SQL SQLite should be enough - it has all the basics, just as > MySQL, while it doesn't require any server/client configuration > (encoding configuration in MySQL is real PITA). But if you want any > "serious SQL", go with any freely available *real SQL server*, like > Firebird or Postgre

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

2006-08-18 Thread Tim Chase
>>> for i in dir(): >>> if eval(i) == Banana: >>> print i >> (sound of head hitting desk) >> >> >> > lol As freakish as the solution was, it's not too far off from something that actually works (mostly, kinda sorta): >>> banana = {} >>> spatula = banana >>> propane = {} >>

Safearray question

2006-08-18 Thread bumperdoc
Hi I'm using win32com.client to dispatch a COM serverone of the interface methods has the below parameter: ..., [in, out] SAFEARRAY(BYTE) *Buffer, ... This method goes and queries something and puts it in this buffer...how can I use this method in Python? What type of variable needs to be pa

Re: couple more questions about sqlite

2006-08-18 Thread John Salerno
[EMAIL PROTECTED] wrote: >> 2. What's the difference between sqlite and pysqlite? Do you need both, >> just one, or is one an older version of the same thing? > > To access your database from python you need both (or some alternative > to pysqlite) I can understand this in terms of MySQL being on

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

2006-08-18 Thread John Salerno
Fredrik Lundh wrote: > Andy Terrel wrote: > >> for i in dir(): >> if eval(i) == Banana: >> print i > > (sound of head hitting desk) > > > lol -- http://mail.python.org/mailman/listinfo/python-list

Re: The decentralized nature of the Python community is driving me crazy

2006-08-18 Thread infidel
> And then you have discussion and yet again, there is no perlmonks.org > for Python. We have this, IRC, and what else? There's also http://planet.python.org, which is an aggregator of python blogs that I check many times a day for new posts. -- http://mail.python.org/mailman/listinfo/python-lis

Re: amd64

2006-08-18 Thread [EMAIL PROTECTED]
if the install is 64 bit, you will hit trouble i used the guide here http://www.debian-administration.org/articles/356 on my 64 bit debian system to get 32bit apps available if they have a particular distro install, usually the package management tools for it can add most python modules you will ne

Re: efficient memoize decorator?

2006-08-18 Thread [EMAIL PROTECTED]
sorry memoize is http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496879 memoize2 is http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466320 > im plugging away at the problems at > http://www.mathschallenge.net/index.php?section=project > im trying to use them as a motivator to get i

timezones and time_t

2006-08-18 Thread MrBlueSky
Hi, I've got a Python application that (as well as lots of other stuff!) has to translate time_t values into strings in the TZ of the users choice. Looking at the Python Library Reference, I can see no platform independent way of setting the TZ that time.localtime() returns - tzset() is marked as

efficient memoize decorator?

2006-08-18 Thread [EMAIL PROTECTED]
im plugging away at the problems at http://www.mathschallenge.net/index.php?section=project im trying to use them as a motivator to get into advanced topics in python. one thing that Structure And Interpretation Of Computer Programs teaches is that memoisation is good. all of the memoize decorators

Re: couple more questions about sqlite

2006-08-18 Thread andychambers2002
> 2. What's the difference between sqlite and pysqlite? Do you need both, > just one, or is one an older version of the same thing? To access your database from python you need both (or some alternative to pysqlite) > 3. What's the difference between the command line program called sqlite3 > and

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

2006-08-18 Thread Fredrik Lundh
Andy Terrel wrote: > for i in dir(): > if eval(i) == Banana: > print i (sound of head hitting desk) -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-18 Thread Fredrik Lundh
Paddy wrote: > Here is where I see the break in the 'flow': > 1+2+3 > 6 sum([1,2,3], 0) > 6 [1] + [2] +[3] > [1, 2, 3] sum([[1],[2],[3]], []) > [1, 2, 3] '1' + '2' + '3' > '123' sum(['1','2','3'], '') > Traceback (most recent call last): > File "", line 1, in ? > T

Re: MS SQL Server: NT Authentication. Possible?

2006-08-18 Thread Jarek Zgoda
Tim Golden napisał(a): > import adodbapi > > db = adodbapi.connect ("Provider=sqloledb;Data Source=VODEV1;Initial > Catalog=EVOBACK;Integrated Security=SSPI;") This kind of connection doesn't work for me. I think it's some misconfiguration on AD side, but I still get "not associated with trusted

Re: MS SQL Server: NT Authentication. Possible?

2006-08-18 Thread Jarek Zgoda
Dirk Hagemann napisał(a): > 'Exception occurred.', (0, 'Microsoft OLE DB Provider for ODBC > Drivers', "[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed > for user '(null)'. Reason: Not associated with a trusted SQL Server > connection.", None, 0, -2147217843), None) This indicates, th

Re: a bug in list.remove?

2006-08-18 Thread Astan Chee
Tim Chase wrote: >> I have 2 lists. What Im doing is check the first list and remove all >> occurances of the elements in the second list from the first list, >> like so: >> >>> ps = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] >> >>> qs = [6,7,8,9,10,11,12,1,2] >> >>> for p in ps: >> if p in

Re: sum and strings

2006-08-18 Thread Georg Brandl
Paddy wrote: > Sybren Stuvel wrote: >> Paddy enlightened us with: >> > Well, after all the above, there is a question: >> > >> > Why not make sum work for strings too? >> >> Because of "there should only be one way to do it, and that way should >> be obvious". There are already the str.join and u

Re: Text to MP3 using pyTTS - Non-programmer question

2006-08-18 Thread seyeRMReyes
Thanks for the script. Are there any online python intrepreters? I'd like to play around with the script. I don't have access to my home PC. -- http://mail.python.org/mailman/listinfo/python-list

Re: Type conversion?

2006-08-18 Thread Paul McGuire
"KraftDiner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > In C++ you can cast one class type to another if you override the > operator= > Then you can convert one class type to another... > In Python it would appear that the left hand side of the assignment > operator > is not us

Re: The decentralized nature of the Python community is driving me crazy

2006-08-18 Thread Mike Orr
[EMAIL PROTECTED] wrote: > hi everyone, > > I am the first of what may be hundreds of refugees from the Perl > community. Not only is Python a more productive language, with many > more nice apps, but the people are friendly as well... waaay more > friendly than the Perl crowd. > > But I must say t

Re: a bug in list.remove?

2006-08-18 Thread Tim Chase
> I have 2 lists. What Im doing is check the first list and remove all > occurances of the elements in the second list from the first list, like so: > >>> ps = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] > >>> qs = [6,7,8,9,10,11,12,1,2] > >>> for p in ps: > if p in qs: > ps.remove(p) >

Re: a bug in list.remove?

2006-08-18 Thread bearophileHUGS
Astan Chee: (This is a small trap of Python, that it shares with some other languages, and it shows that it may exist a language with a higher level than Python.) Generally in Python you can't modify a sequence that you are iterating on. There are some ways to avoid the problem. You can create a d

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

2006-08-18 Thread Andy Terrel
jojoba wrote: > Hello! > > Does anyone know how to find the name of a python data type. > > Conside a dictionary: > > Banana = {} > > Then, how do i ask python for a string representing the name of the > above dictionary (i.e. 'Banana')? > > thanks to anyone who has time to answer this nube questi

Re: amd64

2006-08-18 Thread [EMAIL PROTECTED]
Robin Becker wrote: > Does anyone know if it's possible to run python as a 32 bit app on AMD64's? > One > of our host providers AMD Athlon 64 3000+ and we are currently using a celeron > which is real slow. The problem is that this machine would be a backup for > another which is 32 pentium 4. >

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

2006-08-18 Thread Tim Chase
> Does anyone know how to find the name of a python data type. > > Conside a dictionary: > > Banana = {} > > Then, how do i ask python for a string representing the name of the > above dictionary (i.e. 'Banana')? AFAIK, there's no easy/good way of doing this because that name is just a handle

Re: amd64

2006-08-18 Thread Paul McGuire
"Robin Becker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does anyone know if it's possible to run python as a 32 bit app on AMD64's? One > of our host providers AMD Athlon 64 3000+ and we are currently using a celeron > which is real slow. The problem is that this machine would

Disable close button in management window.(KDE- pyQT)

2006-08-18 Thread Gabriel - BR
Hi,,, Is possible disable the close button in KDE management window? Using python+qt? thanks -- http://mail.python.org/mailman/listinfo/python-list

how do you get the name of a dictionary?

2006-08-18 Thread jojoba
Hello! Does anyone know how to find the name of a python data type. Conside a dictionary: Banana = {} Then, how do i ask python for a string representing the name of the above dictionary (i.e. 'Banana')? thanks to anyone who has time to answer this nube question! jojoba -- http://mail.python

a bug in list.remove?

2006-08-18 Thread Astan Chee
Hi all, I have 2 lists. What Im doing is check the first list and remove all occurances of the elements in the second list from the first list, like so: >>> ps = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] >>> qs = [6,7,8,9,10,11,12,1,2] >>> for p in ps: if p in qs: ps.remove(p) The prob

couple more questions about sqlite

2006-08-18 Thread John Salerno
I've been looking around and reading, and I have a few more questions about SQLite in particular, as it relates to Python. 1. What is the current module to use for sqlite? sqlite3? or is that not out until Python 2.5? 2. What's the difference between sqlite and pysqlite? Do you need both, just

soap comlex data to plain xml

2006-08-18 Thread Ig B
Hi all,would anyone give me a hint how to get SOAP data as plain XML and not as complex datathis is sample code:  myProxy = SOAPpy.SOAPProxy(MY_SERVICE_PATH, header = my_headers)  query = SOAPpy.structType ()  result = myProxy.callMyProcedure(query)  result returned as complex data, but i need pla

Re: Simple Python App Server

2006-08-18 Thread Diez B. Roggisch
tom.purl schrieb: > I use the pyGTD script to manage my todo lists and such. From Vim, I > shell out a call to the gtd.py script, which updates my todo.txt file > after update one of the related pyGTD files. Since I make a lot of > updates to the related pyGTD files, I execute the gtd.py script d

Re: Simple Python App Server

2006-08-18 Thread Neil Cerutti
On 2006-08-18, tom.purl <[EMAIL PROTECTED]> wrote: > I use the pyGTD script to manage my todo lists and such. From > Vim, I shell out a call to the gtd.py script, which updates my > todo.txt file after update one of the related pyGTD files. > Since I make a lot of updates to the related pyGTD file

Re: Type conversion?

2006-08-18 Thread Duncan Booth
KraftDiner wrote: > In C++ you can cast one class type to another if you override the > operator= > Then you can convert one class type to another... > In Python it would appear that the left hand side of the assignment > operator > is not used to determine if a cast is necessary. > So how would I

Re: sum and strings

2006-08-18 Thread Paddy
Sybren Stuvel wrote: > Paddy enlightened us with: > > Well, after all the above, there is a question: > > > > Why not make sum work for strings too? > > Because of "there should only be one way to do it, and that way should > be obvious". There are already the str.join and unicode.join methods,

Re: Type conversion?

2006-08-18 Thread KraftDiner
Rob Cowie wrote: > KraftDiner wrote: > > I have the following code... > > > > import array > > len32 = array.array('L') > > len16 = array.array('H') > > > > len32.append(0) > > len16.append(0) > > > > y = len32[0] > > print y.__class__ > > > > z = len16[0] > > print z.__class__ > > > > > > how c

Re: sum and strings

2006-08-18 Thread Paddy
Sybren Stuvel wrote: > Paddy enlightened us with: > > Well, after all the above, there is a question: > > > > Why not make sum work for strings too? > > Because of "there should only be one way to do it, and that way should > be obvious". There are already the str.join and unicode.join methods, >

Re: How to draw line on Image?

2006-08-18 Thread Claudio Grondi
Paul McGuire wrote: > "David Isaac" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>"Daniel Mark" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >>>I want to draw some shapes, such as lines, circles on an image. >> >> >>http://www.pythonware.com/library/pil/hand

Re: Subprocess confusion: how file-like must stdin be?

2006-08-18 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >> Your interactive session does indeed exhibit the behavior that >> puzzles me. My expectation was that StringIO and the std* >> parameters to Popen() were made for each other; certainly there >> ar

amd64

2006-08-18 Thread Robin Becker
Does anyone know if it's possible to run python as a 32 bit app on AMD64's? One of our host providers AMD Athlon 64 3000+ and we are currently using a celeron which is real slow. The problem is that this machine would be a backup for another which is 32 pentium 4. If I have to recompile/debug a

Re: Need a compelling argument to use Django instead of Rails

2006-08-18 Thread aaronwmail-usenet
Damjan wrote:> > Starting a new Apache process with python included (trough mod_python) is > even worse than CGI. Yes, but I think only for the first interaction after being dormant for a period. In fact I've noticed that hitting http://www.xfeedme.com the first time is usually slow. But once th

Re: How to draw line on Image?

2006-08-18 Thread Paul McGuire
"David Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Daniel Mark" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I want to draw some shapes, such as lines, circles on an image. > > > http://www.pythonware.com/library/pil/handbook/psdraw.htm > > hth, > Alan

Re: sum and strings

2006-08-18 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Paul Rubin: > >>Sybren Stuvel: >> >>>Because of "there should only be one way to do it, and that way should >>>be obvious". There are already the str.join and unicode.join methods, >> >>Those are obvious??? > > > They aren't fully obvious (because they are methods of t

Re: sum and strings

2006-08-18 Thread bearophileHUGS
Paul Rubin: > Sybren Stuvel: > > Because of "there should only be one way to do it, and that way should > > be obvious". There are already the str.join and unicode.join methods, > > Those are obvious??? They aren't fully obvious (because they are methods of the separator string), but after reading

  1   2   >