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
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
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
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
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
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
"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
"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
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
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
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
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
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
Have you tried Notepad++? It's a neat text-editor.
--
http://mail.python.org/mailman/listinfo/python-list
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
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.
>
>
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
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,
"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
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
"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
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,
"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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
[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
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
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
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
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
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
101 - 144 of 144 matches
Mail list logo