Hello,
I have a python script that uploads multiple files from the local machine to a
remote server in parallel via ftp using p process pool:
p = Pool(processes=x)
Now as I increase the value of x, the overall upload time for all files drops
as expected. If I set x too high however, then an e
This may not be too helpful, but I built a TCP server into the Mixxx
application (in C++). I placed the server in ratecontroller (as I needed to
vary the rate remotely). I then could send and receive TCP packets with a
single board computer that ran a python client.
It wasn't too bad. If you wa
They are telling you not to switch between editors that use tabs as tabs and
ones that use spaces as tabs. Python gets all wonky. No big, use one editor or
have your preferred editor highlight your non-preferred whitespace.
FWIW, I use spaces.
--
http://mail.python.org/mailman/listinfo/python-
any effort
> seems dubious to me.
>
> But I could be wrong, of course. It may be that Python, alone of all
> modern high-level languages, fails to take advantage of 80-bit registers
> in FPUs *wink*
>
> --
> Steven
And note that x64 machines use SSE for all their floating point maths,
which is 64bit max precision anyway
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Could anyone suggest an open source project that has particularly well
written Python? I am especially looking for code that people would
describe as "very Python-ic". (Not trying to start any kind of war -
just wanted some good examples of a well written Python app to read.)
Thanks!
I'm trying to upgrade python from 2.2 to 2.4 on a RH9 system, and can't
find any rpm that will let me install it.
Is FC3 required for python 2.4?
--
http://mail.python.org/mailman/listinfo/python-list
Ah, I figured I would have to resort to that.
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Yes, I already figured that out. I put python 2.4 in /usr/local/bin,
and then, when I installed zope (which is the reason for the new
python), I had to tell it where the newer python was.
--
http://mail.python.org/mailman/listinfo/python-list
riable.
Any help would be greatly appreciated.
Ben.
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> B
> "Ben" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I'm currently trying to develop a demonstrator in python for an
> > ontology of a football team. At present all the fit players are
> > exported t
Hi
In a list I have a number of soccer players. Each player has a
different rating for attacking, defending, midfield fitness and
goalkeeping.
I have devised a while loop that goes through this list to find the
best player at defending, attacking, midfield and goalkeeping. However
there is more t
ss my name. ")
while name != 'Ben' and count < 3:
count = count + 1
if name != 'Ben' and count < 3:
name = raw_input('Guess again. ')
elif name == 'Ben' and count < 3:
p
Thanks for your help.
It is much appreciated.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for your input.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for your reply.
--
http://mail.python.org/mailman/listinfo/python-list
Joal was right. It is a bit beyond me. But I appreciate your response.
--
http://mail.python.org/mailman/listinfo/python-list
, particularly the error correcting stuff.
Very off topic I know, but it's always interesting when two areas of
interest collide (my time at university, and my love of python!)
Cheers,
Ben
Paul Rubin wrote:
> I came across this while looking up some data compression info today.
>
>
instance was created for each list entry...
I hope this makes some sense, and doesn't seem to head bangingly
simple...
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
ist[:] (Slicing gives a copy
of the list, not the pointer).
Hope this helps.
Moi
Dolf
Ah -this is exactly what I was doing wrong -thaks very much! Aologies
also for not posting sooner, I have been away for a few days.
Thanks for all of your help,
Ben
On 6 Oc
John Machin wrote:
> Steve Holden
ents in
the list). In fact it returns 28. looking at outputs from lots of
records, it seems that the length is almost always 7 time too great
(28/7=4)but not always. This is really confusing...can anyon
suggest what is going on?
I've been trying to output the list elements as a string wi
):
self.number=number
self.level=level
self.location=location
self.mops=mops
self.matrix=matrix
abve mops is a list, yet when I access it it is a string...
Fredrik Lundh wrote:
> Ben wrote:
>
> > The output from this would be (for a giv
...and when I print out the string, it is still formatted as one would
expect a list to be:
"['01', '02', '03', '04']"
Ben wrote:
> Ah... my list is a string. That explains the len() results, but not why
> it is a string in the dir
Thanks for the advice - I'm already doing just that, so hopefully will
soon be sorted :-p
John Machin wrote:
> Ben wrote:
> > Ah... my list is a string. That explains the len() results, but not why
> > it is a string in the dirst place.
> >
> > I have a d
posting the entire code earlier on - but
thanks for everyone for puttin up with me, and in particular to
Frederick for his very useful hint :-)
Cheers,
Ben
John Machin wrote:
> Ben wrote:
> > ...and when I print out the string, it is still formatted as one would
> > expe
Ah - I found out why I had cast it to a string. I had not, at that
point, worked out ho to pass the list by value rather than reference,
and so was casting to a string as a stopgap measure that I then forgot
about. Now the problem is fixed after this group told me how to pass a
list by value (by sl
t;
> Which will be done by cursor.execute if you use its parameter-substitution
> mechanism.
>
> > Calling the SQLString routine in this situation would be wrong because it
> > would escape characters such as newline which must not be escaped.
>
> SQLString will convert newlines into the \n sequence in the generated string
> literal, which MySQL will interpret as a newline. cursor.execute's
> parameter-substitution mechanism would do exactly the same thing.
But cursor.execute does not necessarily do parameter-substitution. It
can send the data directly to the database with no escaping. In this
case, doing it yourself is a massive pessimization, and you're more
likely to get it wrong than the driver writers
Ben
--
http://mail.python.org/mailman/listinfo/python-list
eems to
be causing problems - I coudl possibly use nested dictionaries, but
this sounds messy. Ideally I would use structs defined inside the
outer class, but pythn doesn't seem to support these.
I hope I haven't rambled too much here - I'm new to python so have
probably done some silly
camera class to append to its list it
complains.
I'm pretty sure there is a solution, and I think I will kick myself
when I work it out (or have it pointed out)!
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Ah - I think I've sorted it out.
I can now have data1.function()
or
data2.function()
etc
However, I can still call function() directly:
function()
which seems very odd Indeed. The only instances of function are within
classes data1 and data2, and these definitions are different, so I
don'
Finally got it all sorted :-)
I got slightly confused because it seems that if you refer to class
variables from methods within that class you need to explicitly state
that they are self, otherwise, since class variables are all public in
python, things could get quite confusing.
Ben
Ben wrote
it
will only drop it if it exists, if it doesn't do nothing and don't
throw an error.
I'm using MySQL 5.024 and python 2.4.3
It still works, but the unneccesary error is annoying :-) Any ideas?
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Ah well - I turned off warnings as a solution. Its a bit f a bodge, but
it works :-)
Ben wrote:
> Can someone explain why this might be happening:
>
> parser_beta.py:129: Warning: Can't drop database 'foobar'; database
> doesn't exist
> self.cursor.exec
embedded in HTML, and seems to make things like dealing
with forms simpler. Having said that it doesn't seem to appear in the
standard ubuntu repositories, while mod_python PSP does,which would
seemto be a vote against it?
What do peopl here think? Any suggestions?
Cheers (and happy christmas),
..or any of the many other embedded python solutions that seem to be
out thee...
Ben wrote:
> Hi,
>
> I have just tarted trying to transfer some of my knowledge of python to
> server side applications. I stated off using mod_python PSP because it
> was what I found first. I t
imple solution I have missed here!
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
imple solution I have missed here!
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
I've found the unexpand command, which seems to do the trick. However,
it outputs to standard output, and I haven't worked out yet how to
capture that output to a file...
Ben
Ben wrote:
> Hi,
>
> I have a python script on a unix system that runs fine. I have a python
> scri
Great - that worked.Thanks!
Is that a general method in linux you can always use to redirect
standard output to a file?
Cheers,
Ben
Grant Edwards wrote:
> On 2006-12-27, Ben <[EMAIL PROTECTED]> wrote:
> > I've found the unexpand command, which seems to do the trick. Howeve
o them. This is
really confusing and quite annoying - I don't know whether anyone out
there can make head or tail of what I'm doing wrong?
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
eep trying :-)
Thanks for your help,
Ben
Erik Johnson wrote:
> "Ben" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>
>
> > This seems to work without any errors. But bizzarely I find that
> > whatever my record number, the instance of
Ah - I have been very silly indeed!
I had not realised that by creating my lists outside of the
def__init___() constructor they would always be class rather than
instance variables, and so there was only one of them when I referred
to it. Thanks to Erik and Chris for your help!
Ben
Ben wrote
, for instance, lists...?
Cheers,
Ben
Thanks.
Erik Johnson wrote:
> "Ben" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > class record:
> > my_list =[]
> > mops=[]
> >
> > def __init__(self,mops)
t
value of i)
I suspect that this is to vague for anyone to be able to help, but if
anyone has any ideas I'd be really grateful :-)
It occured to me that if I could access the mysql query log that might
help, but I was unsure how to enable logging for MysQL with python.
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Well that's odd...
If I place the exact same Insert statement elswhere in the program it
works as intended.
That would suggest it is never being run in its old position, but the
statements either side of it are printing...
Ben wrote:
> I don't know whether anyone can help, but
Ben wrote:
> Well that's odd...
>
> If I place the exact same Insert statement elswhere in the program it
> works as intended.
> That would suggest it is never being run in its old position, but the
> statements either side of it are printing...
>
>
> Ben wrote:
...
Cheers,
Ben
johnf wrote:
> Ben wrote:
>
> > I don't know whether anyone can help, but I have an odd problem. I have
> > a PSP (Spyce) script that makes many calls to populate a database. They
> > all work without any problem except for one statement.
7;t explain why the NOT EXISTS line is being ignored though...
Ben
Ben wrote:
> I initially had it set up so that when I connected to the database I
> started a transaction, then when I disconnected I commited.
>
> I then tried turning autocommit on, but that didn't seem t
script is
run, and after that the original tables and database is used. This
might explain my pronblem if for some reason the old tables are being
replaced... can anyone see anything wrong with the above?
Ben
Ben wrote:
> One partial explanation might be that for some reason it is recreati
Nope... that can't be it. I tried running those commands manually and
nothing went wrong.
But then again when I execute the problematic command manually nothing
goes wrong. Its just not executing until the last time, or being
overwritten.
Ben wrote:
> Each time my script is run, the foll
Well, I've checked the SQL log, and my insert statements are certainly
being logged. The only option left open is that the table in question
is being replaced, but I can't see why it should be...
Ben wrote:
> Nope... that can't be it. I tried running those commands manually
works. But apparentlyu on
subsequent runs it decides the tables it created arent' actually there,
and overwrites them. Grrrrrrrrr.
Ben
Ben wrote:
> Well, I've checked the SQL log, and my insert statements are certainly
> being logged. The only option left open is that the ta
ether this might be the
problem?
Ben
Ben wrote:
> I have found the problem, but not the cause.
>
> I tried setting the database up manually before hand, which let me get
> rid of the "IF NOT EXISTS" lines, and now it works!
>
> But why the *** should it not wor
:-) Ok, point taken!
I fixed it in the end. It was nothing interesting at all - just a
wayward line of code that was doing exactly what I feared - replacing
the database each time rather than just when it was needed.
Ben
Leo Kislov wrote:
> Ask Ben, he might know, although he's out
if a simple "but I need it because a, b, c" is
> not enough, what good is any further prove?
>
> Stefan
For what it's worth, I can only speak English (bad English schooling!)
and I'm definitely +1 on the PEP. Anyone using tools from the last 5
years can handle UTF-8
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Here are the statistics from Google Trends:
http://benyang22a.blogspot.com/2007/09/perl-vs-python.html
--
http://mail.python.org/mailman/listinfo/python-list
t comprehension? Are there
advantages to it outside of short and pretty code?
Feel free to tell me a different way to do this, as well.
Thanks,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
urity
* support for internationalisation.
I am a happy Plone user, but I'm concerned it or even Zope on its
own wouldn't be fast enough as they have a whole lot of functionality I
really don't need and aren't built for a RDBMS.
Ben
--
http://mail.python.org/mailman/listinfo/python-list
I'm left with some legacy code using plain old str, and I need to make
sure it works with unicode input/output. I have a simple plan to do
this:
- Run the code with "python -U" so all the string literals become
unicode litrals.
- Add this statement
str = unicode
to all .py files so the type
Is the following a known bug?
[temp]$ python -U
Python 2.4.4 (#1, Oct 23 2006, 13:58:18)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
Traceback (most recent call last):
File "", line 1, in ?
File "/u
lot of python projects reimplement interfaces or
adaption of some kind once they reach a certain size (Zope, PEAK, eggs,
TurboGears, etc), which implies that they really do have some benefits,
particularly in documentation.
Cheers,
Ben
> --
> bruno desthuilliers
> python -c "pri
t;.
Therefore, as there is no interface equivalent of full multi-methods,
it shows that multimethods are the only primative you need to implement
all of the above
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
dler)
Here's my sample directory:
-
webbrowser-test.py
testpage.html
m_files/
|_stylesheet.css
|_logo.gif
Thanks for having a look. My next step is to process form input using
AJAX. I'll post working snippets of code here as I
I posted more than once by mistake...I was trying to configure Thunderbird.
--
http://mail.python.org/mailman/listinfo/python-list
of ways to hide
complicated functionality, just not necessarily the way you want to do
it.
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
s :). Sorry for any offence.
Anything that makes programming more fun is good, and I hope the Lisp
true way explodes into my head at some point.
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
ines()
F.close()
#Loop through the file and format each line
a=len(List)
while a > 0:
List.insert(a,"2")
a=a-1
# write the changed data (list) to a file
FileOut = open("C:\\path\\to\\file", "w")
FileOut.writelines(List)
FileOut.close()
Thanks for any hel
On Oct 21, 1:53 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> On Tue, 2008-10-21 at 10:28 -0700, Ben wrote:
> > Hello All:
>
> > I am new to Python, and I love it!! I am running 2.6 on Windows. I
> > have a flat text file here is an example of 3 lin
n that gives me the
matches including the overlap. Can anyone point me in the right
direction? I'd also really like to understand why it returns a tuple
and what the '2', '2' refers to.
Thanks for your help!
-Ben
--
http://mail.python.org/mailman/listinfo/python-list
ask
questions ?
Thanks
Ben Duncan
--
http://mail.python.org/mailman/listinfo/python-list
in itself?
Thanks
Ben ...
--
http://mail.python.org/mailman/listinfo/python-list
Ok, thanks ... I am going to be asking a lot of questions now ;->
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 23, 2:31 pm, Nick Craig-Wood wrote:
> Ben wrote:
> > In My S-Lag Project called, SLAG, I have some function keys that get
> > mapped back to S-lang internal functions.
>
> > My SLAG project works pretty much like Python (as does the S-Lang).
> > You w
On Feb 24, 11:31 am, Nick Craig-Wood wrote:
> Ben wrote:
> > No, It uses the the S-lang for video, and input control. However, SLAG
> > is more of an abstract layer on top of that.
>
> > It has a Structures that contains menus and screens (menumodule /
> > sc
On Jun 11, 3:06 pm, [EMAIL PROTECTED] wrote:
> Printing dollar is a copyright violation
>
>
> I recently heard that the USA government or the unfederal reserve is
> printing dollars. Is this a copyright violation ?
>
> Is this also a theft ?
>
>
Hello,
I am following through the python tutorial which gets to a line that
uses the * operator with zip(). I searched and searched but could find
no information on the operator or how to use it in general. The
example from the tut is as follows:
>>> x = [1, 2, 3]
>>> y = [4, 5, 6]
>>> zipped = zi
I missed it because I skipped to the explanation of zip. I hit the
back arrow and went on and saw the link to "Unpacking Argument Lists"
which explained what I needed to know.
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 20, 8:30 pm, Gringo wrote:
> On 1/20/2010 12:38, ben wrote:
>
>
>
> > Hello,
>
> > I am following through the python tutorial which gets to a line that
> > uses the * operator with zip(). I searched and searched but could find
> > no information on t
I've been using smtpd.py to implement a kind of cowboy SMTP server
(only overriding process_message), and inevitably after a certain time
the server stops accepting incoming connections: the socket on which
it was formerly listening gets closed.
I ran it using strace and discovered that it would g
Why doesn't this work:
class C1:
def f1(self):
print("f1")
class C2(C1):
f1()
It throws this error:
Traceback (most recent call last):
File "./c1.py", line 7, in
class C2(C1):
File "./c1.py", line 8, in C2
f1()
NameError: name 'f1' is not defined
f1() is an attri
7;m not allowed to call any of those methods from the subclass. I
must be thinking of this in the wrong way. Help?
thanks!
On May 8, 7:05 pm, Chris Rebert wrote:
> On Sat, May 8, 2010 at 4:50 PM, ben wrote:
> > Why doesn't this work:
>
> > class C1:
> > def f1(
On Jul 22, 1:04 pm, davidj411 wrote:
> i think "Piet van Oostrum" has resolved my issue.
> good eyes!
Well, he *is* Dutch...
-Ben
--
http://mail.python.org/mailman/listinfo/python-list
f ln(4.0 ft)?
>
> Trigonometric functions do take arguments of particular units: radians
> or (less often) degrees, with conversion needed if you use the "wrong"
> unit.
>
> Torben
Angles aren't "true" units, as they are ratios of two lengths. They
are
ine 1, in
ImportError: cannot import name rfid
Causes an error.
sudo echo $PYTHONPATH yields the same result as echo $PYTHONPATH so I
don't think it's an issue of path.
Can anyone suggest something that might be causing this problem?
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Richard Stallman |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> Ben Finney wrote:
> > This resulted in a library for rolling dice in different
> > combinations, and looking up result tables
> > https://pypi.python.org/pypi/alea>.
>
> Fun fun! Of course, when I hear "rolling dice in different
&
se for Python 3. What ‘python-daemon’ works in
Python 3?
--
\ “We are not gonna be great; we are not gonna be amazing; we are |
`\ gonna be *amazingly* amazing!” —Zaphod Beeblebrox, _The |
_o__)Hitch-Hiker's Guide To The Galaxy_, Douglas Adams |
Ben Finney
d go into
it aware that it may be a little more difficult to find fellow users of
Bazaar than of Mercurial.
--
\ “The lift is being fixed for the day. During that time we |
`\regret that you will be unbearable.” —hotel, Bucharest |
_o__)
essiveness. With Python, even a regular guy can reach |
_o__) for the stars.” —Raymond Hettinger |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
nce is that marvelous thing that enables you to |
`\ recognize a mistake when you make it again.” —Franklin P. Jones |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
o do, you'd |
`\ better not start writing it.” —Edsger W. Dijkstra |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
a better mail client until they fix that.
--
\ “Timid men prefer the calm of despotism to the boisterous sea |
`\of liberty.” —Thomas Jefferson |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
rusi writes:
> On Jun 15, 5:16 am, Ben Finney wrote:
> > Is a web browser a “typical desktop app”? A filesystem browser? An
> > instant messenger? A file transfer application? A podcatcher? All of
> > those typically run for months at a time on my desktop.
> >
&g
Cameron Simpson writes:
> On 15Jun2013 10:42, Ben Finney wrote:
> | The message sent to the individual typically arrives earlier (since
> | it is sent straight from you to the individual), and the message on
> | the forum arrives later (since it typically requires more
&g
eople don't know what they want and are |
`\ willing to go through hell to get it.” —Donald Robert Perry |
_o__) Marquis |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
willing to go through hell to get it.” —Donald Robert Perry |
_o__) Marquis |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
7;]),
level=log.DEBUG, spider=spider)
--
\ “[W]e are still the first generation of users, and for all that |
`\ we may have invented the net, we still don't really get it.” |
_o__) —Douglas Adams |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
rak users of the world flgkd!” —Kirsten Chevalier, |
`\rec.humor.oracle.d |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
rusi writes:
> On Monday, June 24, 2013 11:50:38 AM UTC+5:30, Ben Finney wrote:
> > Any time someone has shown me a “Python script”, I don't see how
> > it's different from what I'd call a “Python program”. So I just
> > mentally replace “scripting with “prog
cally!
--
\ “When we talk to God, we're praying. When God talks to us, |
`\ we're schizophrenic.” —Jane Wagner, via Lily Tomlin, 1985 |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
avoiding a search for |
_o__)real answers.” —Paul Z. Myers, 2009-09-12 |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 5100 matches
Mail list logo