manstey wrote:
> Thanks very much. Your def comma_separated_utf8(items): approach raises
> an exception in codecs.py, so I tried = u", ".join(word_info + parse +
> gloss), which works perfectly. So I want to understand exactly why this
> works. word_info and parse and gloss are all tuples. does st
Gary Herron wrote:
> Andrew Robert wrote:
>
>
> The windows CreateProcess call has many of the same semantics as the
> Unix fork, i.e., a new process is created sharing all the resources of
> the original process. The "subprocess" modules uses CreateProcess, but
> if that does not give you suf
"glomde" <[EMAIL PROTECTED]> writes:
> With element tree package.
>
> # build a tree structure
> root = ET.Element("html")
> head = ET.SubElement(root, "head")
> title = ET.SubElement(head, "title")
> title.text = "Page Title"
> body = ET.SubElement(root, "body")
> body.set("bgcolor
Oliver Bandel wrote:
> [EMAIL PROTECTED] opalinski from opalpaweb wrote:
...
> Yes, as I started programming I also preferred tabs.
> And with growing experience on how to handle this in true life
> (different editors/systems/languages...) I saw, that
> converting the "so fine tabs" was annoying.
"rh0dium" <[EMAIL PROTECTED]> writes:
> I want this function to be smart enough to tell if it's a list and
> do the funky concatonation otherwise don't.
Bad code smell. Don't try to be too clever with the data types passed
to you; instead, operate on them as though the caller has passed the
right
Hey all,
Having problems centering a column
Can someone explain how to center a column using python?
import win32com.client
import re
import codecs
import win32com.client.dynamic
import time
import datetime
from win32com.client.dynamic import Dispatch
from win32com.client import constants
t2
"The plural of anecdote is not data."
It's a pithy quote, but it isn't QOTW in my book, simply because it
isn't true in general. Talk to some paleoclimatologists.
There is no way to get uniform measures of ancient climate. What should
we do then? Should we ignore the information we have? Are the
Ben Finney <[EMAIL PROTECTED]> wrote:
> Currently there's no good duck-typing way to differentiate
> strings from other sequences.
I suppose you could do something like:
try:
foo.isalpha
except AttributeError:
print "foo is not a string"
but other than proving that you don't *have* to use
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On May 17, 2006, at 8:46 PM, Edward Elliott wrote:
> Dave Hansen wrote:
>
>> On Wed, 17 May 2006 17:28:26 GMT in comp.lang.python, Edward Elliott
>>> Just for the sake of completeness:
>>>
>>> cat file |sed 's/\t//g'
>>
>> That doesn't always work
Carl J. Van Arsdall wrote:
> The converse can also be said, "it's difficult to make sure everyone
> uses spaces and not tabs".
>
> I think we've just about beat this discussion to death... nice work
> everyone!
Yeah - we've got to the repeating ourselves stage.
But that's the problem with this i
Cameron Laird wrote:
> Gulp. OK, you've got me curious: how many people habitually frame
> their unit tests with resource constraints? I think I take testing
> seriously, and certainly also am involved with resource limits often,
> but I confess I've never aimed to write all my tests in terms o
"Khoa Nguyen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I run into another issue with my grammar:
My input record contains a common part and an extended part. Based on
the value of the common part, the extended part will be different. So,
I am thinking of parsing the common part
>>> import types
>>> type("") is types.ListType
False
>>> type("") is types.StringType
True
>>> type([]) is types.StringType
False
>>> type([]) is types.ListType
True
--
http://mail.python.org/mailman/listinfo/python-list
"Khoa Nguyen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I run into another issue with my grammar:
My input record contains a common part and an extended part. Based on
the value of the common part, the extended part will be different. So,
I am thinking of parsing the common part
Roy Smith <[EMAIL PROTECTED]> writes:
> Ben Finney <[EMAIL PROTECTED]> wrote:
> > Currently there's no good duck-typing way to differentiate strings
> > from other sequences.
>
> I suppose you could do something like:
>
> try:
>foo.isalpha
> except AttributeError:
>print "foo is not a st
> from win32com.client import constants
> sh2.Columns(lastcol).HorizontalAlignment = constant.xlCenter
> NameError: name 'constant' is not defined
1. So why not try reading the error message and fixing the problem
instead of thrashing about madly?
2. You have run makepy on your Excel library, hav
Edward Elliott wrote:
>Dave Hansen wrote:
>
>
>I fail to see why less 'will work' but cat 'doesn't always work'.
>
The distinction is not in the choice of program, but in the
way it is being used...
>The net
>effect of both is the same. Unless you're in some weird place that pipes
>aren't al
"Michael Tobis" <[EMAIL PROTECTED]> writes:
> "The plural of anecdote is not data."
>
> It's a pithy quote, but it isn't QOTW in my book, simply because it
> isn't true in general. Talk to some paleoclimatologists.
>
> There is no way to get uniform measures of ancient climate. What
> should we
brian d foy wrote:
> You have to note that rewriting a program, even in the same language,
> tends to make it shorter, too. These things are measures of programmer
> skill, not the usefulness or merit of a particular language.
I completely agree. But you have to start somewhere.
> Shorter doe
[EMAIL PROTECTED] writes:
> >>> import types
> >>> type("") is types.ListType
> False
> >>> type("") is types.StringType
> True
> >>> type([]) is types.StringType
> False
> >>> type([]) is types.ListType
> True
This is even worse than an 'isinstance' check; it refuses even
subclasses of the types
achates wrote:
> It probably says something about your coding style, particularly in
> perl. I've found (anecdotally of course) that while perl is potentially
> the more economical language, writing *legible* perl takes a lot more
> space.
I'm sure it does. My perl (from 5 years ago) may be cons
Edward Elliott <[EMAIL PROTECTED]> wrote:
> But again, the interesting thing to me isn't what could one do, it's
> what are people actually doing in the real world?
In that case: there is probably more Perl out there that makes us cry
compared to Python :-D.
--
John Bokma Freelance so
Adam Jones wrote:
> Without any more information I would say the biggest contributor to
> this dissimilarity is your experience. Having spent an additional five
> years writing code you probably are better now at programming than you
> were then. I am fairly confident that if you were to take anot
William Studenmund wrote:
> The problem is that tabs take you to the next tab stop, they don't
> expand to a fixed number of spaces.
Got it. You're talking about using tabs other than for initial line
indentation on a source file. Yes, then tab expansion is not perfect.
--
Edward Elliott
UC B
Terry Hancock wrote:
> Now, of course, the data I provide is nasty, mean, poorly-formatted
> data, abhorable by space-zealots and tab-libertines alike (;-)), but the
> point is, unless you have set up your editor to syntax color spaces
> and tabs differently, you won't see the difference in the or
Edmond Dantes wrote:
>The real issue is, of course, that ASCII is showing its age and we should
>probably supplant it with something better. But I know that will never fly,
>given the torrents of code, configuration files, and everything else in
>ASCII. Even Unicode couldn't put a dent in it, desp
On 17 May 2006 16:13:54 -0700 in comp.lang.python, "achates"
<[EMAIL PROTECTED]> wrote:
>Carl J. Van Arsdall wrote:
>
>> The converse can also be said, "it's difficult to make sure everyone
>> uses spaces and not tabs".
>>
>> I think we've just about beat this discussion to death... nice work
>> e
glomde wrote:
> i I would like to extend python so that you could create hiercical
> tree structures (XML, HTML etc) easier ...
> With syntactical sugar:
>
> # build a tree structure
> root = ET.Element("html")
> *!*root:
> *!*head("head"):
> *!*title("title):
> *
Paul McNett wrote:
> Are you sure the python that the web server runs has the cryptogen
> module available?
Yes, this module and the cryptogen module (and the quotes.txt file) are
all in the same directory on the server.
> Have you set the execute bit on your script?
Yes, I have them both s
NumPy 0.9.8 has been released. It can be downloaded from
http://numeric.scipy.org
The release notes are attached.
Best regards,
-Travis Oliphant
NumPy 0.9.8 is a bug-fix and optimization release with a
few new features. The C-API was changed so that extensions compiled
against
We've finally hit the meta-discussion point. Instead of talking about tabs
and spaces, we're talking about talking about tabs and spaces. Which
frankly is a much more interesting conversation anyway.
achates wrote:
> Does it matter? Perhaps not if we can use tools which enable us to
> bridge th
Michael Tobis wrote:
> Edward also asked if others had similar experiences. If others did, the
> assemblage of their opinions would in fact consttitute data. I have no
> idea why people are giving him such grief over this request.
Thank you, Michael. It was starting to feel like I'd asked about
Ben Finney wrote:
> Those samples can be independently verified by any skilled observer at
> another time. This is what distinguishes them from anecdotes, and
> breaks your analogy.
Anyone who has my source files can run the same tests. The measures are
repeatable and reliable, even if at the mo
Edward Elliott <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
>
> > Those samples can be independently verified by any skilled
> > observer at another time. This is what distinguishes them from
> > anecdotes, and breaks your analogy.
>
> Anyone who has my source files can run the same tests.
W
John Salerno wrote:
> Since the connect method of mysqldb requires a database name, it seems
> like you can't use it without having a database already created. So is
> there a way to connect to your mysql server (without a specified
> database) in order to create a new database (i.e., the CREATE DA
I did read the error message. I did not understand why 'constant' was
not defined. In perl I did not have to run anything like 'makepy' to
get constants to work. And no, I don't want to go back to perl. Python
appears to integrate with packages more readily than perl does.
I was unaware of 'ma
Hi - I've got SQL that looks like this ...
cursor =
self.MySQLDb_conn.cursor(cursorclass=MySQLdb.cursors.DictCursor)
sqlQuery = "SELECT * FROM T1 WHERE C1 = %s and C2 = %s"
sql = cursor.execute(sqlQuery,(strURLAlias,strSessionID))
rows = cursor.fetchall()
cursor.close
... i would be interested in
You have to enable the correct web extensions.
Whatever you do, do not ever enable all as that is a huge security risk.
I'll be adding a "how-to" for enabling it for IIS 5.1 which runs on windows
xp.
I put together a tutorial here: http://python.markrowsoft.com/iiswse.asp
<[EMAIL PROTECTED]>
Lance Hoffmeyer <[EMAIL PROTECTED]> writes:
> import win32com.client
> import re
> import codecs
> import win32com.client.dynamic
> import time
> import datetime
> from win32com.client.dynamic import Dispatch
> from win32com.client import constants
These statements create code objects (some of th
"Travis E. Oliphant" <[EMAIL PROTECTED]> writes:
> NumPy 0.9.8 has been released. It can be downloaded from
>
> http://numeric.scipy.org
>
> The release notes are attached.
>
> Best regards,
>
> -Travis Oliphant
> NumPy 0.9.8 is a bug-fix and optimization release with a
> few new features. T
Ben Finney wrote:
> I responded to a post that seemed to claim that anecdotes about events
> can be treated as data about events. They can't; that's what I'm
> arguing.
And conveniently ignoring the key part of my post. Here it is again for
those who missed it:
"Before the days of cheap video,
On 17 May 2006 18:41:55 -0700,
[EMAIL PROTECTED] wrote:
> Hi - I've got SQL that looks like this ...
> cursor =
> self.MySQLDb_conn.cursor(cursorclass=MySQLdb.cursors.DictCursor)
> sqlQuery = "SELECT * FROM T1 WHERE C1 = %s and C2 = %s"
> sql = cursor.execute(sqlQuery,(strURLAlias,strSessionID))
>
Edward Elliott <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
>
> > I responded to a post that seemed to claim that anecdotes about events
> > can be treated as data about events. They can't; that's what I'm
> > arguing.
>
> And conveniently ignoring the key part of my post. Here it is again f
[EMAIL PROTECTED] writes:
> ... i would be interested in seeing what the actual SQL used by the
> .execute looks like after the replacements have been done. Is there a
> way of doing this ?
I also think this would be a very useful feature for enabling logging,
debugging, and other introspection.
John Salerno wrote:
> Paul McNett wrote:
>
>> Are you sure the python that the web server runs has the cryptogen
>> module available?
>
> Yes, this module and the cryptogen module (and the quotes.txt file) are
> all in the same directory on the server.
>
>> Have you set the execute bit on you
Jesse Hager wrote:
> In every MySQL library I have ever seen, the database parameter is
> optional. You may either omit it or pass an empty string. It is just a
> shortcut so the application does not need to send a "USE" command to
> select the active database.
I tried it without the db paramet
achates wrote:
> Jorge Godoy wrote
>
>>Emacs guess what's used in the file and allows me to use tabs all the
>>time, doing the correct thing...
>
> That sounds like useful behaviour.
>
> Maybe this is an area where modern editors might be able to save us
> from ourselves. I'll admit I'm suspici
John Salerno wrote:
> Ok, I've tinkered with this thing for a while, and I keep fixing little
> problems, but I always get a 500 Internal Server error when I go to this
> site:
Ok, in case anyone is curious, I figure out my problems. Let me first
give you a hint: my web server is running Python
Hi
how can I "using pdb" get a value of an attribute?, read the docs and
played around with pdb 'p' for no avail.
thanks
class main:
def __init__(self, master):
self.master = master
self.master.title('parent')
self.master.geometry('200x150+300+225')
...
root = Tk()
***
Hi everyone, I'm writing a program that can retrieve some specified
info from a web page, such as python topics I interested on a bbs.
Now I had written the python script (run in the background), but I
don't know how to make the program notify me explicitly, so I can be
easily informed. I don't kn
John Salerno <[EMAIL PROTECTED]> writes:
> So the bottom line is I'm kind of screwed until I can get 1and1 to
> update their Python! :) But at least I figured out some stuff.
You should also look around for other hosting options. A web hosting
provider that doesn't give access to server logs isn
"hankssong" <[EMAIL PROTECTED]> writes:
> Now I had written the python script (run in the background), but I
> don't know how to make the program notify me explicitly, so I can be
> easily informed.
What methods are available?
Designing your daemon involves figuring out how it will communicate
w
> ... i would be interested in seeing what the actual SQL used by the
> .execute looks like after the replacements have been done. Is there a
> way of doing this ?
On my development machine I'm using the "--log" argument to MySQL so that it
logs all queries and connections. I wouldn't recommend th
Once I imported the EXCEL 10.0 library using
'makepy utility' everything worked fine.
And, yes, my typing mistake. Should have been
'constants' and not 'constant'
Lance
--
http://mail.python.org/mailman/listinfo/python-list
I was hoping you'd find this earlier when I suggested that you type:
creating a new database with MySQL
into google.
It's the number one hit:
http://coronet.iicm.edu/mysql/create.html
If you send the commands listed there via the commandline or through
MySQLdb you should be in business.
--
h
Piet van Oostrum wrote:
>>Edward Elliott <[EMAIL PROTECTED]> (EE) wrote:
>
>
>>EE> Piet van Oostrum wrote:
>>
>[EMAIL PROTECTED] (T) wrote:
>>T> As you can see, the "constant" A can be modified this easily. But if
>>T> there were an intuitive mechanism to declare a symbol to be i
NoNickName wrote:
> Gerard Flanagan wrote:
>
>
>>Interactive SQL tutorial: http://www.sqlcourse.com/ ;
>>http://sqlcourse2.com/
>>
>>Indirectly helpful maybe:
>>http://initd.org/tracker/pysqlite/wiki/basicintro
>>
>>HTH
>>
>>Gerard
>
>
> There's also the TechBookReport SQL tutorial - which is
Richie Hindle wrote:
> [Chris]
>> Has anyone written a fast hash module which is more optimal for
>> large datasets ?
>
> PyJudy might be what you're looking for, though I've never used it:
>
> http://www.dalkescientific.com/Python/PyJudy.html
>
> "Judy's key benefits are scalability, high per
If I work on your project, I follow the coding and style standards you
specify.
Likewise if you work on my project you follow the established
standards.
Fortunately for you, I am fairly liberal on such matters.
I like to see 4 spaces for indentation. If you use tabs, that's what I
will see
Claudio Grondi wrote:
> Chris Foote wrote:
>> Klaas wrote:
>>
22.2s 20m25s[3]
>>>
>>> 20m to insert 1m keys? You are doing something wrong.
>>
>> I've put together some simplified test code, but the bsddb
>> module gives 11m for 1M keys:
>>
> I have run your code for the bsddb on my P4 2.8 G
Hi All,
I am a new user of Python and am having a bit of problem understanding
the Reference counting and memory leakage issues.
Requesting help from experienced users
I wrote the following simple program.
#!/usr/bin/python
import sys
global a
print "Total Reference count at the start ="
Am Donnerstag 18 Mai 2006 08:28 schrieb raghu:
> #!/usr/bin/python
>
> import sys
> global a
>
> print "Total Reference count at the start =",sys.gettotalrefcount()
> a=1
> print "a ref count =",sys.getrefcount(a)
> b=a
> print "a ref count =",sys.getrefcount(a)
>
> del a
> del b
>
> print "Total R
There are some difference which are quite essential.
First of all I dont se how you set attributes with that and
then I dont see how you can mix python code with the creation.
So how do you do this:
root = ET.Element("html")
*!*root:
*!*head("head"):
*!*title("title):
fo
I am trying to figure out why so little web development in Python uses
Flash as a display technology. It seems most Python applications
choose HTML/CSS/JS as the display technology, yet Flash is a far more
powerful and elegant display technology. On the other hand, HTML/JS
seems clunky and antiqu
201 - 264 of 264 matches
Mail list logo