I have found many posts that deal with writing a dictionary to MySQL in
a blob field - which I can't imagine why anybody would want to do it.
I want to write each element of a dictionary onto a db table. The keys
would match the fieldnames. Is there something that would make this job
easier? i.e.
On Thu, 26 Jan 2006 17:47:51 +0100, Claudio Grondi <[EMAIL PROTECTED]> wrote:
>Rocco Moretti wrote:
>> Terry Hancock wrote:
>>
>>> One thing that I also think would be good is to open up the
>>> operator set for Python. Right now you can overload the
>>> existing operators, but you can't easily d
>> when I replace it end up with nothing: i.e., just a "" character in my
>> file.
how are you viewing the contents of your file?
are you printing it out to stdout?
are you opening your file in a non-unicode aware editor?
try print repr(data) after re.sub so that you see what you actually
have in
Hi
Just want to check which xml parser you guys have found to be the
quickest. I have xml documents with 250 000 records or more and the
processing of these documents are taking way to long. The validation is
the main problem. Any module names, non validating would be find to,
would help a lo
Bengt Richter wrote:
> On Thu, 26 Jan 2006 17:47:51 +0100, Claudio Grondi <[EMAIL PROTECTED]> wrote:
>
>
>>Rocco Moretti wrote:
>>
>>>Terry Hancock wrote:
>>>
>>>
One thing that I also think would be good is to open up the
operator set for Python. Right now you can overload the
existi
Albert Leibbrandt wrote:
> Just want to check which xml parser you guys have found to be the
> quickest. I have xml documents with 250 000 records or more and the
> processing of these documents are taking way to long. The validation is
> the main problem. Any module names, non validating would be
On Thu, 26 Jan 2006 17:32:32 +, Steve Holden <[EMAIL PROTECTED]>
wrote:
> gregarican wrote:
>> I have a Python UDP listener socket that waits for incoming data. The
>> socket runs as an endless loop. I would like to pop the incoming data
>> into an existing Tkinter app that I have created. W
After reading all your comments and thinking a little to my specific
case, I think it is definetively better to go with the "isinstance()"
implementation. My objects represent mathematical function defined over
a numerical grid, and I hardly think of an unrelated class objects that
could be compare
Dave Benjamin wrote:
(snip)
> You *could* have "b.__eq__" just call "a.__eq__",
Which could lead to strange results (well, actually a good ole infinite
recursion) if b.__eq__ happens to call b.__eq__ too !-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split(
Mr.Rech wrote:
> All in all it seems that the implementation that uses isinstance() is
> better in this case...
You could also use something like Zope's Interfaces... But I'm not sure
it's worth the extra complexity.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.
Daniel Nogradi wrote:
> Is it possible to have method names of a class generated somehow dynamically?
>>> class Dummy(object):
... pass
...
>>> def mymethod(self, *args, **kw):
... pass
...
>>> setattr(Dummy, 'a_dynamically_generated_method_name', mymethod)
>>>
>>> Dummy.a_dynamically_generate
Lonnie Princehouse wrote:
>>(objects are not allowed to lie about who they are, or what they are).
>
>
> Dangit! I need to find a less honest programming language. Anyone
> have a Perl cookbook handy? ...
>
+1 QOTW (approved by a fellow Perl programmer FWIW !-)
--
bruno desthuilliers
python
On Fri, 27 Jan 2006 00:03:30 -0800, Derick van Niekerk wrote:
> I have found many posts that deal with writing a dictionary to MySQL in
> a blob field - which I can't imagine why anybody would want to do it.
>
> I want to write each element of a dictionary onto a db table. The keys
> would match
Lonnie Princehouse enlightened us with:
> There doesn't seem to be any way to customize the behavior of "is" as
> can be done for other operators... why not?
Pure logic: A == A or A != A. An object is another object or not.
Why would you want to change that?
Sybren
--
The problem with the world
bruno at modulix wrote:
> Mr.Rech wrote:
> > All in all it seems that the implementation that uses isinstance() is
> > better in this case...
>
> You could also use something like Zope's Interfaces... But I'm not sure
> it's worth the extra complexity.
Thanks for your suggestion, but it's not wort
On Thu, 26 Jan 2006 17:57:05 +
Steve Holden <[EMAIL PROTECTED]> wrote:
> How does
>http://beta.python.org/about/beginners/
> look?
Better than it did. ;-)
No, it looks great. I think you're hitting approximately the
right tone here. That first paragraph may be a bit too curt
about "new to
Steven D'Aprano:
>Rene Pijlman:
>> Mr.Rech:
>>> def __eq__(self, other):
>>> try:
>>> return self.an_attribute == other.an_attribute
>>> except AttributeError:
>>> return False
>>
>> This may give unexpected results when you compare a foo with an instance
>> of a comple
On Fri, 27 Jan 2006 00:03:30 -0800, Derick van Niekerk wrote:
> I have found many posts that deal with writing a dictionary to MySQL in
> a blob field - which I can't imagine why anybody would want to do it.
>
> I want to write each element of a dictionary onto a db table. The keys
> would match
Derick van Niekerk wrote:
> I have found many posts that deal with writing a dictionary to MySQL in
> a blob field - which I can't imagine why anybody would want to do it.
it might be useful if you have a bunch of unknown properties (e.g. configuration
parameters for some external parameters), an
bruno at modulix wrote:
> Dave Benjamin wrote:
> (snip)
>
>
>>You *could* have "b.__eq__" just call "a.__eq__",
>
>
> Which could lead to strange results (well, actually a good ole infinite
> recursion) if b.__eq__ happens to call b.__eq__ too !-)
I meant:
'if a.__eq__ happens to call b.__eq
Hello Pythonistas
I'm new to Python, I hope you understand my question.
I would like to pass a parameter "gap" to a function. gap should be
used there to create a timedelta Object.
from datetime import *
def f(gap):
print (datetime.now() + datetime.timedelta(gap))
f('hours = -8')
I r
Albert Leibbrandt:
>Just want to check which xml parser you guys have found to be the
>quickest. I have xml documents with 250 000 records or more and the
>processing of these documents are taking way to long.
What type of parser are you using? Dom, minidom or sax? Sax is fastest,
but somewhat m
[quote]
d = {"spam": "1", "egg": "2"}
cols = d.keys()
vals = d.values()
stmt = "INSERT INTO table (%s) VALUES(%s)" % (
",".join(cols), ",".join(["?"]*len(vals))
)
cursor.execute(stmt, tuple(vals))
[/quote]
I will be using the python-mysql API. This looks like what I am looking
for. I ju
Has anyone figured out how to get a legend for each line in a
matplotlib.collections.LineCollection instance?
No problem if I plot lines the default way ie. line,=plot(x,y). But I've had
to resort to using LineCollections for the significant speed boost since I
am routinely plotting up to ten 3000
I'm using standard widows xp installation of Python 2.4.2. I tried to
find some help for print and entered
>>> help()
and then chose
help> print
Sorry, topic and keyword documentation is not available because the
Python
HTML documentation files could not be found. If you have installed
them,
p
Derick van Niekerk wrote:
> [quote]
> d = {"spam": "1", "egg": "2"}
>
> cols = d.keys()
> vals = d.values()
>
> stmt = "INSERT INTO table (%s) VALUES(%s)" % (
> ",".join(cols), ",".join(["?"]*len(vals))
> )
>
> cursor.execute(stmt, tuple(vals))
> [/quote]
>
> I will be using the python-
Derick van Niekerk wrote:
> [quote]
> d = {"spam": "1", "egg": "2"}
>
> cols = d.keys()
> vals = d.values()
>
> stmt = "INSERT INTO table (%s) VALUES(%s)" % (
> ",".join(cols), ",".join(["?"]*len(vals))
> )
>
> cursor.execute(stmt, tuple(vals))
> [/quote]
>
> I will be using the python-mys
Terry Hancock wrote:
> That's interesting. I think many people in the West tend to
> imagine han/kanji characters as archaisms that will
> disappear (because to most Westerners they seem impossibly
> complex to learn and use, "not suited for the modern
> world").
I don't know about "the West". Isn
On Thu, 26 Jan 2006 23:26:14 -0800, Lonnie Princehouse wrote:
>> (objects are not allowed to lie about who they are, or what they are).
>
> Dangit! I need to find a less honest programming language. Anyone
> have a Perl cookbook handy? ...
No, you need a better algorithm.
Why did you want to
Set PYTHONDOCS to "C:\Python24\Doc\Python-Docs-2.4.2", and that should
work.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 27 Jan 2006 01:20:52 +0100, Daniel Nogradi <[EMAIL PROTECTED]> wrote:
>> > Is it possible to have method names of a class generated somehow
>> dynamically?
>> >
>> > More precisely, at the time of writing a program that contains a class
>> > definition I don't know what the names of its ca
Hi all
I am using odbc from pywin32 to connect to MS SQL Server. I am changing
my program from the old (incorrect) style of embedding values in the
SQL command to the new (correct) style of passing the values as
parameters. I have hit a problem.
The following all work -
cur.execute("select *
Philipp wrote:
> from datetime import *
>
> def f(gap):
> print (datetime.now() + datetime.timedelta(gap))
>
> f('hours = -8')
When you need a flexible input format, consider keyword arguments. In
this case, I would pass along the inputs to timedelta:
def from_now(**kwargs):
return da
Thanks, that works :)
--
http://mail.python.org/mailman/listinfo/python-list
Hi all.I attach to you a example XML file to parse and the demo of my objective.The iptRequest.xml is the file to parse in one mode. I can't parse it.The demo.py is my ideal result, manually built, that should be built by parsing the XML.
How can i do to do it?Bye all!
#!/usr/bin/env python
# -*- c
Hi all.I attach to you a example XML file to parse and the demo of my objective.The iptRequest.xml is the file to parse in one mode. I can't parse it.The demo.py is my ideal result, manually built, that should be built by parsing the XML.
How can i do to do it?Bye all!
#!/usr/bin/env python
# -*- c
Michael Tobis wrote:
> I like the design, though I'd prefer stronger colors. I think it would
> be a major improvement except for the logo.
[Much reasoning about logos, Sun, Microsoft Office...]
With the nice font they've used, I don't understand why they didn't
turn the "p" into a snake itself.
Frank Millman wrote:
> Hi all
>
> I am using odbc from pywin32 to connect to MS SQL Server. I am changing
> my program from the old (incorrect) style of embedding values in the
> SQL command to the new (correct) style of passing the values as
> parameters. I have hit a problem.
>
> The following
Hi all
I'm trying to generate test methods in a unittest TestCase
subclass, using decorators. I'd like to be able to say:
class MyTestCase(unittest.TestCase):
@genTests(["Buy", "Sell"], [1,2,3], [True, False])
def something(self, side, price, someFlag):
# etc...
And have it gene
perhapse consider using the pickle module?
http://docs.python.org/lib/module-pickle.html
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> Frank Millman wrote:
>
> >
> > This does not work -
> > cur.execute("select * from users where userid = ?", [u'frank']) #
> > new style
> >
> > I get the following error -
> > OdbcError: Found an insert row that didn't have 1 columns [sic]
>
> To me it looks as if yo
[quote]
(just curious, but from where do people get the idea that arbitrary
data
just have to be inserted into the the SQL statement text all the time?
is
this some PHP misfeature?)
[/quote]
I've never seen it done in this way before, but I do come from a PHP
point of view.
I've only started with
On Mon, 23 Jan 2006 21:00:55 +0200, Ilias Lazaridis <[EMAIL PROTECTED]> wrote:
>within a python script, I like to create a collection which I fill with
>values from an external text-file (user editable).
>
>How is this accomplished the easiest way (if possible without the need
>of libraries whic
Seeing as we're suggesting alternatives, ConfigObj is great for hand
readable/writable data persistence.
You can use validate and ConfigPersist for automatic type conversion.
You can persist (basically) all the standard datatypes using this. The
syntax is usually more 'familiar' than Yaml, but it
Thanks for this answer.
Client do:
size1, passed1 = envoyer(conn, 50)
size2, passed2 = envoyer(conn, int(size1/passed1))
size3, passed3 = recevoir(conn)
size4, passed4 = recevoir(conn)
print size2/passed2
print size4/passed4
Server do:
recevoir(conn)
recevoir(conn)
size1, passed1 = envoyer(conn, 5
Ilias Lazaridis wrote:
> [EMAIL PROTECTED] wrote:
>
>> another approach (probably frowned upon, but it has worked for me) is
>> to use python syntax (a dictionary, say, or a list) and just import (or
>> reload) the file
>>
>
> this sounds good.
>
> can I import a whole collection of instances th
Ido Yehieli wrote:
> perhapse consider using the pickle module?
> http://docs.python.org/lib/module-pickle.html
User editable? We should be kind to our users!
>>> d = {'peter':14, 'paul':23}
>>> pickle.dumps(d)
"(dp0\nS'paul'\np1\nI23\nsS'peter'\np2\nI14\ns."
--
http://mail.python.org/mailman/
Ilias Lazaridis wrote:
> within a python script, I like to create a collection which I fill with
> values from an external text-file (user editable).
If a spreadsheet like layout fits, use the csv module and
a plain comma separated file.
Then the end user can also use e.g. Excel to edit the data.
Bruce Cropley wrote:
> Hi all
>
> I'm trying to generate test methods in a unittest TestCase
> subclass, using decorators. I'd like to be able to say:
>
> class MyTestCase(unittest.TestCase):
> @genTests(["Buy", "Sell"], [1,2,3], [True, False])
> def something(self, side, price, someFla
Bruce Cropley wrote:
> I'm trying to generate test methods in a unittest TestCase
> subclass, using decorators. I'd like to be able to say:
>
> class MyTestCase(unittest.TestCase):
> @genTests(["Buy", "Sell"], [1,2,3], [True, False])
> def something(self, side, price, someFlag):
>
Daniel Nogradi wrote:
>>Here you go:
>>
>> >>> database = {
>> ... "Alice": 24,
>> ... "Bob":25}
>> ...
>> >>> class Lookup(object):
>> ... def __catcher(self, name):
>> ... try:
>> ... print "Hello my name is %s and I'm %s" % (name,
>>database[name])
>> ...
On 26 Jan 2006 15:40:47 -0800, "Murali" <[EMAIL PROTECTED]> wrote:
>In Python, dictionaries can have any hashable value as a string. In
>particular I can say
>
>d = {}
>d[(1,2)] = "Right"
>d["(1,2)"] = "Wrong"
>d["key"] = "test"
>
>In order to print "test" using % substitution I can say
>
>print "
Paddy wrote:
> I find it much better than the current site, thank you!
>
> Whilst reading, http://beta.python.org/about/ I had some slight
> niggles.
> What do you think about the following changes?
>
> About Python
>
> Python is an agile programming language often compared to Tcl, Perl,
> Ruby,
Specifically it's the TOPICS that I can't seem to get to work. The
keywords and modules etc do work. But if I type, e.g.,
help("functions") it says, "No documentation found" If I type
help("os") I get help on the os module.
rpd
--
http://mail.python.org/mailman/listinfo/python-list
Shalabh Chaturvedi wrote:
> Steve Holden wrote:
>
>>How does
>>
>> http://beta.python.org/about/beginners/
>>
>>look?
>>
>
>
>
> Steve,
>
> This is a great writeup. Here are my comments:
>
> 1. "Fortunately Python is something that an experienced programmer of
> another language (be it ...
On Fri, 2006-01-27 at 05:47, Fredrik Lundh wrote:
> (just curious, but from where do people get the idea that arbitrary data
> just have to be inserted into the the SQL statement text all the time? is
> this some PHP misfeature?)
Yes, the need to roll queries by inserting parameters directly into
>>Sure, it's just a Python module with variables in it.
>>
>>I wouldn't try to teach my users Python syntax though.
not to mention the security risks
--
http://mail.python.org/mailman/listinfo/python-list
Still doesn't work for me. I've tried everything. I think it's because
PythonWin keeps trying to read the ActiveState .chm file, even if you
download the html files and set the PYTHONDOCS variable.
Oh well.
rpd
--
http://mail.python.org/mailman/listinfo/python-list
Michael Tobis wrote:
> I like the design, though I'd prefer stronger colors. I think it would
> be a major improvement except for the logo.
>
>
So, are you saying you don't like the new logo?
I'm with you. I don't like it either. It looks like a diagram out of the
well known Anguine Kama Sutra.
Mr.Rech wrote:
> Hi all,
> I've read some thread about isinstance(), why it is considered harmful
> and how you can achieve the same results using a coding style that
> doesn't break polymorphism etc... Since I'm trying to improve my Python
> knowledge, and I'm going to design a class hierarchy fro
>> Python is an agile programming language often compared to Tcl, Perl,
>> Ruby, Scheme or Java. While it has much in common with them it also has
>> unique features that set it apart.
James Stroud wrote:
> Maybe:
>
> "Python is an object oriented programming language designed to increase
> prod
The new Python site is incredibly boring. Sorry to say this. The old
site is/was amateurish but engaged. Now after ~15 years of existence
Pythons looks like it wants to be popular among directors of a german
job centers. It aims to do everything right but what could be said
worse? The text on the b
"aurora" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Greeting,
>
> HTMLTestRunner is an extension to the Python standard library's unittest
> module. It generates easy to use HTML test reports. See a sample report at
> http://tungwaiyip.info/software/sample_test_report.html.
>
> C
On Fri, 27 Jan 2006 13:33:06 +,
Steve Holden <[EMAIL PROTECTED]> wrote:
>>> http://beta.python.org/about/beginners/
My suggestion would be "too much text". IMHO, people do not read
paragraphs of material on the web. The basic structure shouldn't be
the paragraph, but the bullet po
On Thu, 26 Jan 2006 15:28:50 -0800 in comp.lang.python, James Stroud
<[EMAIL PROTECTED]> wrote:
>Rocco Moretti wrote:
>> (Not that I like the logo, mind you...)
>
>Does anyone? There has to be a better logo! I thought the previous
>requirement as established by the BDFL was no snakes. These are s
Daniel Nogradi wrote:
> Well, I would normally do what you suggest, using parameters, but in
> the example at hand I have to have the method names as variables and
> the reason is that the whole thing will be run by apache using
> mod_python and the publisher handler. There a URL
> http://something
Steve Holden wrote:
> How does
>
> http://beta.python.org/about/beginners/
>
> look?
I think it's a well written text, but it looks more like
an introductionary chapter in a book about Python than a
text for a web site. A book looks the same for all its
readers, and it's basically sequential.
My decorator bike:
import logging
import traceback
logging.basicConfig(level=logging.DEBUG,
format="%(asctime)s %(levelname)s:\n%(message)s\n",
filename="/tmp/py.log",
filemode='w')
def log(f):
def new_f(*args, **kwds):
try
Magnus Lycka:
>isinstance() wouldn't be in Python if you weren't supposed to use it,
If this argument was correct, 'goto' wouldn't be in Pascal :-)
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Dave Hansen wrote:
>
> I like it, FWIW. Better than a dead parrot or a killer rabbit IMHO.
> Though maybe not as funny...
Why not just take the Parrot logo and rotate it by 90 degrees? ;-)
http://www.parrotcode.org/
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Just a couple half-serious responses to your comment...
On Fri, 27 Jan 2006 11:05:15 +0100 in comp.lang.python, Magnus Lycka
<[EMAIL PROTECTED]> wrote:
>Terry Hancock wrote:
>> That's interesting. I think many people in the West tend to
>> imagine han/kanji characters as archaisms that will
>> di
On Fri, 27 Jan 2006 08:11:24 GMT in comp.lang.python, [EMAIL PROTECTED]
(Bengt Richter) wrote:
[...]
>Maybe you would like the unambiguousness of
>(+ 8 (* 6 2))
>or
>6 2 * 8 +
>?
Well, I do like lisp and Forth, but would prefer Python to remain
Python.
Though it's hard to fit Python into
Sorry for broken indentation.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 27 Jan 2006 13:33:06 + in comp.lang.python, Steve Holden
<[EMAIL PROTECTED]> wrote:
>Shalabh Chaturvedi wrote:
[...]
>
>> 2. "also available as the python-list mailing list"
>>
>> Add "or a google group (link)".
It's not a "Google Group," it's a Usenet newsgroup. Google merely
provi
> Unicode is one of those grey areas that I know I will have to try to
> understand one day, but I am putting off that day as long as possible!
I suggest you better start right away instead of stumbling over it all the
time. The most problems in that field don't come from the inherent
complexity o
Paul Boddie wrote:
> With the nice font they've used, I don't understand why they didn't
> turn the "p" into a snake itself. I'm sure I've seen that done
> somewhere before.
You're probably thinking of PyPy:
http://codespeak.net/pypy/dist/pypy/doc/news.html
--
http://mail.python.org/mailman/lis
Eric Brunel wrote:
> There's in fact no need to check regularly if there's something in the
> Queue: the secondary thread can post a tk custom event to trigger the
> treatment automatically from within the main GUI loop. See here:
> http://minilien.fr/a0k273
Appreciate the suggestion. This furthe
"bwaha" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Has anyone figured out how to get a legend for each line in a
> matplotlib.collections.LineCollection instance?
>
After frigging around for hours I finally tracked down the real cause of the
plotting speed problem which led me t
What about some permutation of the PyCon logo? It is really quite
brilliant.
Solves many problems:
dynamic, doesn't just sit there, looks like it is moving toward a
goal
direction of motion surprising and memorable
refers to software in the minds of experienced coders
takes advanta
Steve Holden wrote:
> How does
>
> http://beta.python.org/about/beginners/
>
> look?
>
> regards
> Steve
I think the content is good, but I would suggest putting some bullet
points with links at the top. IMO top part of the beginner page should
somehow indicate that tutorial and FAQ is acc
Magnus Lycka wrote:
> ...
>
>I don't like anyone to hand me different texts based on whom
>I say I am. I want to know what the texts are about and decide
>for myself where to go. These are texts, not dressing rooms!
>
>
Unfortunately most people do.. That's why there are beginners books,
busines
On Fri, 27 Jan 2006 09:30:20 -0600
Rocco Moretti <[EMAIL PROTECTED]> wrote:
> Paul Boddie wrote:
> > With the nice font they've used, I don't understand why
> > they didn't turn the "p" into a snake itself. I'm sure
> > I've seen that done somewhere before.
>
> You're probably thinking of PyPy:
H
Just thought I'd see if you guys had an answer for this. My website
analytics page shows that people come to my site after searching for
"Python drive name" but I don't think I'm offering any help with such
a thing.
However I would like to help since I'm getting a few people a day for
this. So d
Gregory Piñero wrote:
> Just thought I'd see if you guys had an answer for this. My website
> analytics page shows that people come to my site after searching for
> "Python drive name" but I don't think I'm offering any help with such
> a thing.
>
> However I would like to help since I'm getting
> "bwaha" == bwaha <[EMAIL PROTECTED]> writes:
bwaha> added the location argument. Finally realised it was due to
bwaha> having a default of 'best' location in my code which meant
bwaha> it went searching for intersection with lines that don't
bwaha> exist (outside of the LineC
> Ouch! This certainly seems like a possible security hole!
>
> As someone else said, use rewrite rules to get this passed
> in as a parameter.
I don't get it, why is it more safe to accept GET variables than
method names? Concretely, why is the URL
http://something.com/script?q=parameter safer th
Rinzwind wrote:
> Something like this:
> progname = 'c:\tmp\myprog.exe arg1 '+'-- help'
> os.system(r'progname)
Well, other than the ways in which it wouldn't work:
1. "arg1" doesn't get substituted with anything, if that's what you
meant, but rather is inserted as the literal string "arg1". If
Daniel Nogradi wrote:
>>Ouch! This certainly seems like a possible security hole!
>>
>>As someone else said, use rewrite rules to get this passed
>>in as a parameter.
>
> I don't get it, why is it more safe to accept GET variables than
> method names? Concretely, why is the URL
> http://something.
Gregory Piñero:
>Just thought I'd see if you guys had an answer for this. My website
>analytics page shows that people come to my site after searching for
>"Python drive name" but I don't think I'm offering any help with such
>a thing.
>
>However I would like to help since I'm getting a few people
hi,
there is a soap service:
http://waluty.k2.pl/ws/NBPRates.asmx
the question is why when i call GetRateValue method i always get '0' result?
>>> import SOAPpy
>>> srv = SOAPpy.WSDL.Proxy("http://waluty.k2.pl/ws/NBPRates.asmx?WSDL";)
>>> srv.GetAllCodes()
'AUD CAD CHF CYP CZK DKK EEK EUR GBP H
On 27 Jan 2006 08:08:58 -0800,
Michael Tobis <[EMAIL PROTECTED]> wrote:
> What about some permutation of the PyCon logo? It is really quite
> brilliant.
...
> http://www.python.org/pycon/2006/logo.png
>
> Kudos to whoever came up with that, by the way!
It was Michael Bernstein who des
On 1/27/06, Magnus Lycka <[EMAIL PROTECTED]> wrote:
> > After taking a couple of semesters of Japanese, though, I've
> > come to appreciate why they are preferred. Getting rid of
> > them would be like convincing English people to kunvurt to
> > pur fonetik spelin'.
> >
> > Which isn't happening e
I've been doing some file system benchmarking. In the process, I need to
create a large file to copy around to various drives. I'm creating the
file like this:
fd = file('large_file.bin', 'wb')
for x in xrange(40960):
fd.write('0')
fd.close()
This takes a few minutes to do. How can I s
One way to speed this up is to write larger strings:
fd = file('large_file.bin', 'wb')
for x in xrange(5120):
fd.write('')
fd.close()
However, I bet within an hour or so you will have a much better answer
or 10. =)
--
http://mail.python.org/mailman/listinfo/python-list
I want my code to be Python 3000 compliant, and hear
that lambda is being eliminated. The problem is that I
want to partially bind an existing function with a value
"foo" that isn't known until run-time:
someobject.newfunc = lambda x: f(foo, x)
The reason a nested function doesn't work for thi
rbt wrote:
> I've been doing some file system benchmarking. In the process, I need to
> create a large file to copy around to various drives. I'm creating the
> file like this:
>
> fd = file('large_file.bin', 'wb')
> for x in xrange(40960):
> fd.write('0')
> fd.close()
>
> This takes a fe
> Untested, but this should be faster.
>
> block = '0' * 409600
> fd = file('large_file.bin', 'wb')
> for x in range(1000):
> fd.write('0')
> fd.close()
Just checking...you mean
fd.write(block)
right? :) Otherwise, you end up with just 1000 "0" characters in
your file :)
Is ther
Russell wrote:
> I want my code to be Python 3000 compliant, and hear
> that lambda is being eliminated. The problem is that I
> want to partially bind an existing function with a value
> "foo" that isn't known until run-time:
>
>someobject.newfunc = lambda x: f(foo, x)
>
> The reason a neste
Tim Chase <[EMAIL PROTECTED]> writes:
> Is there anything preventing one from just doing the following?
> fd.write("0" * 40960)
> It's one huge string for a very short time. It skips all the looping
> and allows Python to pump the file out to the disk as fast as the OS
> can handle it. (
On 2006-01-27, rbt <[EMAIL PROTECTED]> wrote:
> I've been doing some file system benchmarking. In the process, I need to
> create a large file to copy around to various drives. I'm creating the
> file like this:
>
> fd = file('large_file.bin', 'wb')
> for x in xrange(40960):
> fd.write(
1 - 100 of 199 matches
Mail list logo