On [EMAIL PROTECTED] wrote:
> Daniel Bickett <[EMAIL PROTECTED]> writes:
> > I've been trying to convince my host to install python/mod_python on
> > his server for a while now, however there are a number of reasons he
> > is reluctant to do so, which I will outli
Dennis Lee Bieber wrote:
On Tue, 25 Jan 2005 20:43:54 +, Daniel Bowett
<[EMAIL PROTECTED]> declaimed the following in
comp.lang.python:
As a test I have written a script that executes 3000 insert statements
on a table. The table contains 10 fields with a mix of text and numbers
-
Daniel Bowett wrote:
I have just started playing around with MySQLdb for a project I am
planning.
As a test I have written a script that executes 3000 insert statements
on a table. The table contains 10 fields with a mix of text and numbers
- its a product table for a website eg UPC
t__ if they are
really needed by D as well.
In OO speak: D is not really a subclass of B. Refactor the common code
into a new class A.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
I seem to have found a bug/limitation of executemany in MySQLdb.
I am inserting 3100 records into a database. It works fine and adds them
in about 1 second.
I went back to the program today and realised i'd missed a field so
added it to the insert statement. This seems to break it if I try to ad
Daniel Bowett wrote:
I seem to have found a bug/limitation of executemany in MySQLdb.
I am inserting 3100 records into a database. It works fine and adds them
in about 1 second.
I went back to the program today and realised i'd missed a field so
added it to the insert statement. This see
cy and use gmail-specific libraries, really.
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
Outgoing server: smtp.gmail.com
Be sure to include @gmail.com for your username.
For the incoming server (the topic at hand, if I'm not mistaken,) It
instructs you to use an SSL connection and port 995, so that is sure
to change some things.
I believe that's all.
--
Daniel Bickett
quot; or "license" for more information.
>>> string = """ " ' " ' " ' " ' \""" """
>>> string
' " \' " \' " \' " \' """ '
n order to avoid
having to spend the time to find the inaccuracies in each one individually.
Considering the response so far, a list of frequent posters and
not-so-frequent posters who will vouch for the accuracy of the disclaimer
might even be added.
Daniel Fackrell
--
http://mail.python.o
ntain a statement
like
> > the one Daniel mentions. Obviously the program would be written in
python.
> > ;-)
>
> I'm not really sure that such a disclaimer is explicitly necessary.
> Anyone looking at Xah Lee's posts will also see the threads they
> generate, which
then I'll get amused by what he is
doing with perl-python, and how he intentionally makes those mistakes,
but then when we have a real conversation it just makes me angry.
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
pass
>>> objA = A()
>>> objB = B()
>>> type( objA )
>>> type( objB )
>>> type( objB ) == B
True
I believe that achieves what you were aiming for.
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
t;> import re
>>> data = file( "important.dat" , "r" )
>>> line = data.readline()
>>> while line:
for x in re.finditer( "\w+" , line):
print x.group()
line = data.readline()
this
is
important
data
>>>
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
Cappy2112 wrote:
> > dictionaries can NOT contain dictionaries.
>
> Who told you this?
> In my python, they can.
> [snip]
You took his reply out of context. Fuzzyman asked him if *his*
dictionaries were to contain dictionaries, and the reply was no, they
will not.
--
Daniel B
Erick wrote:
> True, but it doesn't work with multiline regular expressions :(
If your intent is for the expression to traverse multiple lines (and
possibly match *across* multiple lines,) then, as far as I know, you
have no choice but to load the whole file into memory.
--
Daniel
interpreter load my code and be ready
for testing.
That said, that is my only reason for my ever using IDLE. Without it I
would probably forget that IDLE exists, were it not for the obnoxious
context menu entry. ;)
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http
crazy-compilers.com/decompyle/
Other than that link, which I stumbled upon at some point (at
python-eggs), I'm decidedly uninformed on this subject.
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
; or "license" for more information.
>>> help(list)
Help on class list in module __builtin__:
[big snip]
It goes into good detail about all of the methods, etcetera.
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
ults/Yh6x0598.html
newstring methods: http://rafb.net/paste/results/O51kja41.html
NOTES:
[1] http://tinyurl.com/4dkgw
[2] I'm currently unaware if _winreg is a c extension module or pure
python, but I'm assuming it's C, so I don't know how possible it is to
add pure python to it...
[3] I made a few quick edits after I pasted it in, so please bring to
my attention any errors or inconsistencies you see
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
e
> someone wrote that "winreg" module... (hint).
I wasn't aware that was even on our plate ;) Is the intent for it just
to have wrappers around the _winreg functions, or were there things
planned for it?
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
if falseExists:
return False
>>> l1 = [ True , None , None , False ]
>>> l2 = [ None , False , False , None ]
>>> l3 = [ False , True , True , True ]
>>> boolhunt( l1 )
True
>>> boolhunt( l2 )
False
>>> boolhunt( l3 )
Tru
Jeremy Bowers wrote:
> The defense rests, your honor. :-)
I stand corrected :-) My apologies.
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
p , step = 1 ):
while start < stop:
yield start
start += step
>>> for x in range( 5 ):
print "%s " % str( x ),
0 1 2 3 4
>>> for x in genrange( 0 , 5 ):
print "%s " % str( x ),
Paul Rubin wrote:
> use xrange instead of range.
Woops ;) I wasn't aware such a function existed.
apologies-for-reinventing-the-wheel-ly y'rs,
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
I know of two:
Boa Constructor: http://boa-constructor.sourceforge.net/
wxGlade: http://wxglade.sourceforge.net/
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
the
features of the newstyle classes, and explains what they all do? If
so, can anyone provide me with such a link?
Thanks :-)
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Well, the fact is that __[get|set]state__() have nothing to do with new
> style classes, but with the Pickle protocol:
> http://www.python.org/doc/2.3.4/lib/pickle-inst.html
Thank you for pointing that out, but all the same ;)
--
Daniel Bickett
dbickett at
implement the functionality of various Unix utilities in Python.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hello Python list
If a Python program has an import statement like:
import FFT
how do I determine the path to the imported file?
Thanks,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
use os.path.join to create a
valid path that can be used as the argument to other module os
functions. Whether the results are absolute or relative should depend on
the initial argument to os.listdir.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
reas
>
>
> how does it help in using list comprehension, as the ones in the first
> post?
You can nest list comprehension
[ e
for e in (os.path.join(d, x) for x in os.listdir(d))
if os.path.isdir (e)]
You might also want to look at module itertools, which has better
s
Python für Kids"
<http://www.amazon.de/exec/obidos/ASIN/3826609514/qid%3D1119950457/302-9800191-4449651>
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ou can insert print
statements everywhere
- list comprehensions don't allow you to break complex expressions into
several simpler ones by using local variables, everything has to happen
in one expression
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
e python code on a page like this:
see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
css only won't help you as someone has to insert the span tags so that
the style sheet has something to match.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
incidence and I
wouldn't rely on it for future versions.
Summary: If you are able to compile all your needed extensions yourself,
then new Python versions aren't really a problem.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ce to make an anemy for life, no matter which you pick.
And module authors might not be interested as they'd be then bound by
the Python release cycle.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Full Acknowledge
--
http://mail.python.org/mailman/listinfo/python-list
how do I delete a global if not with "del"?
globals ().__delitem__ (varname)
except that the method would probably be called delete.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
I think in some contextes map is more readable than [f() for i in S]
because it's more verbatim
Removing lamdba would be reduce readability of Python, I think here
for examble of code like
class App:
def drawLines(self, event):
from random import r
> Am I just weird?
I feel the same way about where to use lambda's and where *not*
I come from C and C++ background and defining a function at the top
level (no nested functions) would always require good reasons
function name has to be remembered, to put it in other words it has to
be added in
ject must be explicitely referenced:
self.outer.increase (20)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
I'm quite sure
that None == None always returned boolean true.
In a SQL database, NULL = NULL will always return NULL, which is prety
much the same as FALSE. Except for NOT, AS NOT NULL is NULL.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
the best/most carefree way
of interfacing with MySQL databases.
Thanks for your time,
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
I neglected to mention an important fact, and that is the fact that I
am limited to Apache, which elminates several suggestions (that are
appreciated none-the-less).
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
he files. This
script has an option -d that allows to set the directory name
compiled into the .pyo files.
From the help: "-d destdir: purported directory name for error messages"
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> I would like to know how I could automatically fill a
> (search) form on a web page and download the resulting
> html page.
http://wwwsearch.sourceforge.net/ClientForm/
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
.com/Utilities/Handle.html).
Either way, the information you'll get is restricted by your permissions.
Either information will get stale really fast, so it's not suitable if
your task is something like 'can I backup this directory or is someone
writing to a file?'
Daniel
is means that
for element in pathobject:
has no intuitive meaning for me, so it shouldn't be allowed.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
an use this code from actual C programs without
> problems. The ni488.h file in in the right place to be used for C
> compilation.
I guess ibdev is *declared* in ni488.h and you'll have to add the lib
where it is *defined*. You'll probably have to add a
libraries = ['gpi
pathobj.stepdown ('/usr/local/bin'):
if p.join (searchedFile):
whatever
I'm not saying that there isn't any use for having a list of path
elements. But it isn't that common, so it should get an methodname to
make it more explicit.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
also work with paths as sequences (stacks, in particular).
I'd say it works with stacks of pathes, not with stacks of path elements.
I'm not saying that there isn't any use for having a list of path
elements. But it isn't that common, so it should get an methodname to
make it more e
ives/2005/02/06/using-pth-files-for-python-development/
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
--
http://mail.python.org/mailman/listinfo/python-list
> been extremely complicated and limiting. Are there any other options I
> haven't considered?
>
> Sincerely,
> Chris
maybe PyGame: http://www.pygame.org/, although it might be lacking in
the standard widget department.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Phillip J. Eby from dirtsimple.org
> Python as a community is plagued by massive amounts of
> wheel-reinvention. The infamous web framework proliferation problem is
> just the most egregious example.
In stark contrast to Java, where everybody uses standard components like
JSP, Struts, Tapestry, JSF,
ing where they have to install it on other peoples
machines. So it isn't just getting it to work one one own's machine.
Using a specifc Python library with external dependencies means also
installing and *supporting* it on a possible large set of configurations.
Daniel
--
http://mai
Jorge Godoy wrote:
> Daniel Dittmar wrote:
>
>
>>To be fair to those slothes: some of them want to write software for a
>>commercial setting where they have to install it on other peoples
>>machines. So it isn't just getting it to work one one own's machine.
ogramming is half brains and half
> tenacity.
I'd add a bit of gambling, because often, you don't have enough
information. Telling what works from your experience adds useful
information so that the brain can decide where to invest the tenacity.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
isks of the unknown. Of course
what is unknown can be influenced somewhat by getting information.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
h source code is easier to understand so that I don't have to rely
on external help
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
string", NULL, PYTHON_API_VERSION);
if (module == NULL) {
return;
}
dict = PyModule_GetDict (module);
PyDict_SetItemString (dict, "MyClass"),
(PyObject*) &MyClassType));
}
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Eric schrieb:
> I am reading a book on Python and ran across and exercise that I just
> can't seem to figure out. Its pretty simple, but I just can't get
> past a certain point.
>
> The task is to create a program that flips a coin 100 times and keeps
> track of the total of heads and tails which
angle_mode = cmath.GRAD)
-> ((3,0), (3,120), (3,240))
what do you think about it?
maybe there exists some proposals aiming this goal?
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
> I would also like to see some more functions to make
> calculations with complex number more convenient
> e.g.
> c = 27
c = 27+0j
--
http://mail.python.org/mailman/listinfo/python-list
or
> similar packages? It is possible that a cmath2 module, written in
Python,
> could be useful.
I hope so
I will google for cmath2, I never heard about it
I am new to Numeric and numarray, I was playing with them and
ufunc-tionsand matplotlab, as for SciPy I couldnt find
any binary for 2.4 Python unfortunately :-/
Regards
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
most likely stands for Degree, I cannot tell for sure
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
sin/cos in the code
but imagine how ugly it would be ..
I would like see Python as a competitor to Matlab etc
Regards
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
[...]
> I am aware of the usage of argument to mean the angle in polar
> representation, but I don't like it. The word argument already has two
> other meanings, one in common English, the other in math/CS. The latter
> meaning is the inputs to a function, and that is how the word is used in
[...]
> Okay. Write a patch. Personally, I would prefer that it be a
> function in cmath rather than a method because then it could be made to
> work on integers and regular floats, too.
Ok, but what semantic should angle/arg have, say for 3 respectively
for 3.0?
the same as for arg(3+0j)?
--
o threads.
Especially if you're testing on a single CPU machine.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
t;
>>> del d
~derived
>>>
>>>
base2.__init__ is called in the same way
sound.Output.__init__ is called
both get multiple arguments
one more curiosity, why doesn't del d, call destructors
of base classes?
Thanks for you answears
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
avePlayer into it and after
import wavePlayer
p = wavePlayer.wavePlayer()
I got this error
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
.py vhd.vhd vhd.h -o
1
usage: vhd2h.py vhdlFile hFile [-o]
Someone got an idea what may be wrong?
--
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Schüle wrote:
> if __name__ == "__main__":
> if len(sys.argv) not in (3,4):
> print "usage: prog arg1 argv2 [-x]"
> # etc ...
>
> while develeoping I had my interpeter running and reloaded module
> now since I am ready, I wanted
I just tried the same code at home and it worked fine
it has to do with windows .. some settings or whatever
(python 2.4.1 installed on both)
maybe someone have experienced the same problem
and had more luck in solving the puzzle
--
http://mail.python.org/mailman/listinfo/python-list
ited methods.
Others will probably chime in with arguments whether such micro
benchmarks are a useful indication of the speed a complete program at all.
> Is there any proposal to make python faster in future versions ?
Yes in the general case, probably no in this specific case.
Assuming your module is called _cmd:
- add a function init_cmd_d to the extension module (init_cmd_d simply
calls init_cmd)
- import cmd_d in your Python script
I must admit I haven't tried this, it is based on my understanding of
how Python loads extension modules.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
prior to global declaration
g_del_opt_list =[[],[],[],[],[],[],[]]
#g_opt_list = []
It seems that your variable names got mixed up.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Does anyone have an idea where the problem might be? BLOCK_LEN is specified in
bytes
and num_type is Int32.
Thanks,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hello All,
I am new to Python so if there is an obvious
answer to my question please forgive me. Lets say I have the following
code in mod1.py
class test:
def func1(self):
print 'hello'
Now lets say I have another file called main.py:
import mod1
inst = mod1.tes
d[a-z][a-z0-9]*)')
I get AttributeError for both regex.pattern and regex.compile
('abc').pattern.
re compiled regular expression have a pattern attribute, this was named
givenpat and realpat in the regex module.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
copy everything to a clean machine.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
nd you'll need to keep a reference to it as well.
And it would be called after all the others, which matches your
description, but not your code.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
If you write
java -Dwhatever=x -jar x.jar
then -Dwhatever=x is interpreted by java and put into the system properties.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
raw_input ('enter a path: ')
enter a path: c:\config
'c:\\config'
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
the email addresses of the recipients via the address
list. Use a neutral To-address (best: the mailing list address) and add
the recipients via bcc: headers.
You might also want to look at mailman
http://www.gnu.org/software/mailman/, which is a complete mailing list
solution written in Python.
Marian Aldenhövel wrote:
> Maybe some way to remote control another player would be in order. Leave it
> to software that is specialized and all. But I would want something that runs
> on Windows and Linux which narrows down my options.
Perhaps Zinf?
http://www.zinf.org/
--
Danie
ower in expression, with respect to semantics (i.e.
> > algorithms), showcases Perl's poverty in specification.
>
> Clarify :-D.
Clarification:
He (XL) is a troll and admits it. If only he would include that information
up-front in his (IMO worthless) [perl-python] post
re to look.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
. Why don't you set the default for the
directory option to the current directory? Most Makefiles won't work
anyway if they are called from a different directory.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
administrata wrote:
> print \trock
Your problem lies in this line. The escape sequence \t is not a
variable, so to speak. It is just that, an escape sequence, so it must
be located inside of a string:
print "\t" + rock
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.
Hi everyone,
I was curious to know: does the functionality of webbrowser._iscommand()
live anywhere else in the Standard Library?
webbrowser._iscommand() is a helper function that searches through
PATH, and seems useful enough that I was surprised that it didn't live
in a more public place like
: if you're talking about the "tutor at python.org" mailing list, it's a
mailing list
: that you send mail to and get mails from, as explained on the tutor mailing
: list page:
:http://mail.python.org/mailman/listinfo/tutor
Hello,
Also, from the odd spelling of the subject line, I suspect
[EMAIL PROTECTED] wrote:
: Hello all,
: I am trying to convert some C code into python. Since i am new to
: python, i would like to know how to deal with multidimensional arrays?
Here you go:
http://python.org/doc/faq/programming.html#how-do-i-create-a-multidimensional-list
Also, if your tab
Download MySQL for windows at:
http://www.mysql.com
Then:
http://www.google.co.uk/search?hl=en&q=python+mysql&btnG=Google+Search&meta=
Lad wrote:
I use XP windows and Python 2.3. How can I install MYSQL on my
computer? I could not find any installer for MYSQL and Python 2.3
Thanks for help
Lad.
--
john san wrote:
How to install python under DOS and is there any Wxpython-like can be
installed under dos?
Thanks.
Are you actually still running a pure DOS machine? Or are you running
the dos prompt through Windows?
--
http://mail.python.org/mailman/listinfo/python-list
Lad wrote:
I am sorry it was my fault I did not say that clearly.
I do not have a problem to install MySQL server but I do not know how
to install MySQLdb module on my windowsXP so that I can work with
MySQL server via Python 2.3.
Thanks for help
Lad
Try this installer, if you want a newer versi
[EMAIL PROTECTED] wrote:
Daniel Bowett wrote:
Lad wrote:
I am sorry it was my fault I did not say that clearly.
I do not have a problem to install MySQL server but I do not know
how
to install MySQLdb module on my windowsXP so that I can work with
MySQL server via Python 2.3.
Thanks for help
Lad
I'm new to the PIL module but think it would be useful for dealing with
all the product images for the sites I work on. I can see how to do most
things I need apart from expanding the canvas.
By that I mean if I have an image which is 200 pixels high and 180
pixels wide - I will want to pad it
o supply an empty key you would write
script.py?key1=&key2=foo
Then cgi.FieldStorage also includes key1.
bye,
Daniel
--
For mail replies please use my address from
http://perplex.schmumpf.de/
http://www.gametective.de/
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 1788 matches
Mail list logo