Kirk McDonald <[EMAIL PROTECTED]> wrote:
...
> > def func(callback):
> > for i in [1, 2, 3, 4, 5]:
> > callback(i)
...
> Threads are probably a weak point of mine. I have little experience with
> them, and so I am inclined to paranoia while using them. What
Paranoia is the cor
Language lovers:
Registration is now open for the 9th Annual ICFP Programming Contest!
http://icfpcontest.org/
The contest, associated with the International Conference on
Functional Programming, will be held on the weekend of July 21-24. The
contest task will be released at noon EDT on Frid
Simon Forman skrev:
> Sheldon wrote:
> > Hi,
> >
> > I have a series of classes that are all within the same file. Each is
> > called at different times by the main script. Now I have discovered
> > that I need several variables returned to the main script. Simple,
> > right? I thought so and sim
Scott David Daniels skrev:
> Sheldon wrote:
> > Hi,
> >
> > I have a series of classes that are all within the same file. Each is
> > called at different times by the main script. Now I have discovered
> > that I need several variables returned to the main script. Simple,
> > right? I thought so
Greetings, since there was no reponse to my previous post about an
existing FastCGI server in python, I've taken to writing my own. (which
of course I'll share--*if* there's something to share ;)
My problem now, is that I need to send certain binary data over a
socket. That is, I want to make some
[EMAIL PROTECTED] schrieb:
> Greetings, since there was no reponse to my previous post about an
> existing FastCGI server in python, I've taken to writing my own. (which
> of course I'll share--*if* there's something to share ;)
>
> My problem now, is that I need to send certain binary data over a
Premature sending syndrome...
Diez B. Roggisch schrieb:
> [EMAIL PROTECTED] schrieb:
>> Greetings, since there was no reponse to my previous post about an
>> existing FastCGI server in python, I've taken to writing my own. (which
>> of course I'll share--*if* there's something to share ;)
>>
>> My
[EMAIL PROTECTED] wrote:
> Greetings, since there was no reponse to my previous post about an
> existing FastCGI server in python, I've taken to writing my own. (which
> of course I'll share--*if* there's something to share ;)
>
> My problem now, is that I need to send certain binary data over a
>
On 2006-07-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> My problem now, is that I need to send certain binary data over a
> socket. That is, I want to make some bytes, and stuff them in a TCP
> packet, send them down the pipe, and then listen for a response.
>
> socket.send, as best I can te
Taos is a professional IT Consulting Services firm that has been
delivering technical excellence to its customers for more than 17
years.
We have an immediate openning for a Unix System Administrator with
excellent python scripting experience.
Please contact [EMAIL PROTECTED] for immediate consid
Paul Rubin wrote:
> "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes:
>> If you want an independent data set, you have to take a snapshot.
>> For the above, that's doing:
>>
>> k0 = list(d.keys())
>
> I don't understand. Why have .keys() at all, if it doesn't get you
> an independent da
> Python strings are binary data and can contain
> - in oppostion to e.g. C-strings - null-bytes.
>
> So it is perfectly alright to send "only" strings over a socket.
Agreed. I wasn't trying to imply it was 'wrong' just that the receiving
application wouldn't interpret strings correctly.
--
ht
> It will send the 4 bytes, binary, and not the string as you assumed. If
> you want to satisfy yourself, run tcpdump (or ethereal) to observe what
> is being sent.
Thanks very much for the prompt reply. I'll take your word for it. I
actually tried ethereal to verify my hypothesis before posting,
Paul Rubin wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>> And a "view" of the dictionary is orders faster than creating a copy
>> of it (which is required to keep k0 from changing in your example).
>> If you're LUCKY, copying a dictionary is O(n),
>
> There are ways to do it so you
> Are those not the four octets you wanted to send?
Yes. My understanding of struct was broken. Sukanta corrected it for
me.
thank you
--
matthew
--
http://mail.python.org/mailman/listinfo/python-list
On 7/3/06, Paul McGuire <[EMAIL PROTECTED]> wrote:
> "Alex Biddle" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hey, thanks for the reply Jean-Paul.
> >
> > That's pretty cool knowing that Python 2.5 will have it out of the
> > box, however what about basic out-of-the-box funct
[EMAIL PROTECTED] wrote:
> Greetings, since there was no reponse to my previous post about an
> existing FastCGI server in python, I've taken to writing my own. (which
> of course I'll share--*if* there's something to share ;)
>
> My problem now, is that I need to send certain binary data over a
>
Delaney, Timothy (Tim) wrote:
> Plus copy-on-write isn't something you want in general - it's *much*
> slower since it needs to copy the internal data every time it's
> modified. The vast majority of uses of data structures does not involve
> concurrent modification.
But copy-on-write in the prese
In <[EMAIL PROTECTED]>, gangesmaster
wrote:
> just something i thought looked nice and wanted to share with the rest
> of you:
>
class x(object):
> ... def __metaclass__(name, bases, dict):
> ... print "hello"
> ... return type(name, bases, dict)
> ...
> hello
>>>
Aloha!
I want to terminate a process/program from within a python script.
For example,
if I have a program say foo.sh that starts running, then I can run it
from within a python script using
os.popen('foo.sh') which starts a program/process say 'bar'
At some point later, I want to kill 'bar'. C
Scott David Daniels wrote:
> Delaney, Timothy (Tim) wrote:
>> Plus copy-on-write isn't something you want in general - it's *much*
>> slower since it needs to copy the internal data every time it's
>> modified. The vast majority of uses of data structures does not
>> involve concurrent modificatio
hi...
i'm running into a problem where i'm seeing non-ascii chars in the parsing
i'm doing. in looking through various docs, i can't find functions to
remove/restrict strings to valid ascii chars.
i'm assuming python has something like
valid_str = strip(invalid_str)
where 'strip' removes/strips
bruce:
> valid_str = strip(invalid_str)
> where 'strip' removes/strips out the invalid chars...
This isn't short but it is fast:
import string
valid_chars = string.lowercase + string.uppercase + \
string.digits +
"""|!'\\"£$%&/()=?^*é§_:;>+,.-<\n \t"""
all_chars = "".join(map(
On 4/07/2006 9:27 AM, bruce wrote:
> hi...
>
> i'm running into a problem where i'm seeing non-ascii chars in the parsing
> i'm doing. in looking through various docs, i can't find functions to
> remove/restrict strings to valid ascii chars.
>
It's possible that you would be better off handling
Jeffrey Barish <[EMAIL PROTECTED]> wrote:
> Is there a way to interact with Windows Media Player from Python? I would
> like to be able to do things like tell WMP to play a given sound file or to
> ask WMP for metadata about a sound file.
Take a look at pywinauto, I attended the today talk at EP
bruce wrote:
> hi...
>
> i'm running into a problem where i'm seeing non-ascii chars in the parsing
> i'm doing. in looking through various docs, i can't find functions to
> remove/restrict strings to valid ascii chars.
>
> i'm assuming python has something like
>
> valid_str = strip(invalid_str)
>
bruce wrote:
> hi...
>
> i'm running into a problem where i'm seeing non-ascii chars in the parsing
> i'm doing. in looking through various docs, i can't find functions to
> remove/restrict strings to valid ascii chars.
>
> i'm assuming python has something like
>
> valid_str = strip(invalid_str)
>
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, gangesmaster
> wrote:
>
> > just something i thought looked nice and wanted to share with the rest
> > of you:
> >
> class x(object):
> > ... def __metaclass__(name, bases, dict):
> > ... print "he
Maximilian Michel wrote:
> Hi all,
>
> I have an interesting problem:
> I have written code, that reads a logfile and parses it for date string
> (Thu Jun 29 14:01:23 2006).
> Standalone everthing works fine, all is recognized.
>
> But if I let the same code run in a thread, with the same file as
hi...
update. i'm getting back html, and i'm getting strings like " foo "
which is valid HTML as the ' ' is a space.
i need a way of stripping/removing the ' ' from the string
the needs to be treated as a single char...
text = "foo cat "
ie ok_text = strip(text)
ok_text = "foo cat"
th
Grant Edwards wrote:
> On 2006-07-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > My problem now, is that I need to send certain binary data over a
> > socket. That is, I want to make some bytes, and stuff them in a TCP
> > packet, send them down the pipe, and then listen for a response.
...
> Thanks for the info. No thanks for the smarmy "pony" comment.
Do you really want "smarmy" here? I don't think it works. Don't you
mean "flip" or "smart-alecky" or "facetious"?
Websters 3rd Unabridged
Main Entry:smarmy
Function:adjective
Inflected Form:-er/-est
1 : SLEEK *smarmy-headed David Wa
bruce wrote:
> hi...
>
> update. i'm getting back html, and i'm getting strings like " foo "
> which is valid HTML as the ' ' is a space.
&, n, b, s, p, ; Those are all ascii characters.
> i need a way of stripping/removing the ' ' from the string
>
> the needs to be treated as a single char.
BartlebyScrivener wrote:
> > Thanks for the info. No thanks for the smarmy "pony" comment.
>
> Do you really want "smarmy" here? I don't think it works. Don't you
> mean "flip" or "smart-alecky" or "facetious"?
Hmm. I think the word we're looking for here is "snarky". ;-)
Although, I confess to
Hi everyone,
Here is my simple Tkinter script:
## start of entry.py
from Tkinter import *
root=Tk()
e1=Entry(root, width=16)
e1.pack()
e2=Entry(root, width=16)
e2.pack()
mainloop()
## end
First, it works on win2k. When I run it as 'python entry.py' on linux,
both 'e1' and 'e2' appear perfectly e
Apologies in advance if this is a bit bloggy, but I'd like to get
comments on whether I've lost the plot (or, more likely, failed to
acquire it) before I start reporting bugs etc.
From "What's new ...":
"""
# Create table
c.execute('''create table stocks
(date timestamp, trans varchar, symbol v
Hi everyone,
Here is my simple Tkinter script:
## start of entry.py
from Tkinter import *
root=Tk()
e1=Entry(root, width=16)
e1.pack()
e2=Entry(root, width=16)
e2.pack()
mainloop()
## end
First, it works on win2k. When I run it as 'python entry.py' on linux,
both 'e1' and 'e2' appear perfectly e
Andy Dingley <[EMAIL PROTECTED]> wrote:
> Simon Forman wrote:
>
> > There's more to it, but that's the basic idea.
>
> This much I knew, but _why_ and _when_ would I choose to use list
> comprehension (for good Python style), rather than using a simple
> "traditional" loop ?
They are a very co
Terry Hancock <[EMAIL PROTECTED]> wrote:
...
> Although, I confess to ignorance on what a "snark" is or whether
http://www.gutenberg.org/etext/13
Alex
--
http://mail.python.org/mailman/listinfo/python-list
In one of the examples in the book I'm reading, it says:
def __init__(self):
...
...
...
return
It has nothing after "return". I expected it to have some number like 0
or 1.
What does it mean to have nothing after return?
Why do we even include "return" if we are not putting any
Marc 'BlackJack' Rintsch wrote:
> But why use a metaclass? If the meta class is only applied to *one*
> class, can't you do at class level whatever the metaclass is doing!?
The very fact that you can put a loop inside __metaclass__ may be reason
enough for a one-off metaclass.
Here's a contrived
Alex Martelli wrote:
> http://www.gutenberg.org/etext/13
Leave it to the guy who can quote Borges and The Celestial Emporium of
Benevolent Knowledge while explaining multiple inheritance.
See Cookbook 2nd Ed pg. 234
--
http://mail.python.org/mailman/listinfo/python-list
simon...
the ' ' is not to be seen/viewed as text/ascii.. it's a representation
of a hex 'u\xa0' if i recall...
i'm looking to remove or replace the insances with a ' ' (space)
-bruce
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf
Of Simon Forman
Sent: Mond
On 3/07/2006 6:57 PM, Maximilian Michel wrote:
> Hi all,
>
> I have an interesting problem:
> I have written code, that reads a logfile and parses it for date string
> (Thu Jun 29 14:01:23 2006).
> Standalone everthing works fine, all is recognized.
>
> But if I let the same code run in a thread,
please send it to-[EMAIL PROTECTED]
Fredrik Lundh wrote:
> "arvind" <[EMAIL PROTECTED]> wrote:
>
> > thanx for replynig.
> > but functios are independent
> > and the button is inside one of the functions.
> > will u please reshape ur code and send it to me?
>
> where do I send the invoice ?
BartlebyScrivener <[EMAIL PROTECTED]> wrote:
> Alex Martelli wrote:
>
> > http://www.gutenberg.org/etext/13
>
> Leave it to the guy who can quote Borges and The Celestial Emporium of
> Benevolent Knowledge while explaining multiple inheritance.
>
> See Cookbook 2nd Ed pg. 234
...;-)
Alex
--
Hi Walter,
I just read your message about "dollar-hosting.org"
that you posted a couple months ago,
and I wonder how was your experience with this
service so far.
How does mod_python work?
Are the basic handlers properly configured?
(publisher, psp)
Is it easy to use?
Is it possible to
John Machin wrote:
> Apologies in advance if this is a bit bloggy, but I'd like to get
> comments on whether I've lost the plot (or, more likely, failed to
> acquire it) before I start reporting bugs etc.
These are not, in fact, bugs. One of SQLite's features is that it does
not enforce type, mea
update...
here is a sample of the text i'm looking to do hte search/replace for...
ACCT 209 - SURVEY OF ACCT PRIN
i'm trying to figure out how to replace the " " with a ''. in html, the
' ' char is not a valid ascii char...
in perl, i'd do 's / //' and be done with it
It's a dream of human beings to build machines that can think and
behave like human beings. The most important part of of such a
machine is an artificial mind that can emulate the cognitive processing
of human mind.
This book, "Next Generation Artificial Intelligence, Artificial Mind -
Part One
On 2006-07-04, yaru22 <[EMAIL PROTECTED]> wrote:
> What does it mean to have nothing after return?
It means to return None.
> Why do we even include "return" if we are not putting any
> value after?
If it's the last statement in the function, you don't need it.
Some people do it just as a forma
hi all,
i've created the myclass instance and calles the "function second()".
i want to access the text entered in 'w' through Entry widget in
"function third()"
i am getting the 'fuction not having 'w' attribute error.
how to overcome it?
class myclass:
senter='arvind'
def __init__(self
"yaru22" <[EMAIL PROTECTED]> wrote:
>In one of the examples in the book I'm reading, it says:
>
>def __init__(self):
>...
>...
>...
>return
>
>It has nothing after "return". I expected it to have some number like 0
>or 1.
>
>What does it mean to have nothing after return?
It means
valpa schrieb:
> Can I do it automatically by python? After that, there have 20 xterm
> consoles opened and telneted to their corresponding servers. Then I
> could start to type command in these xterms.
Is there a framework/module to automate ssh-sessions/scp-filetransfers
with python-programmi
bruce wrote:
> simon...
>
> the ' ' is not to be seen/viewed as text/ascii.. it's a representation
> of a hex 'u\xa0' if i recall...
Did you not see this part of the post that you're replying to?
> 'nbsp': '\xa0',
My point was not that '\xa0' is an ascii character... It was that your
initial re
"Jeffrey Barish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Is there a way to interact with Windows Media Player from Python? I would
> like to be able to do things like tell WMP to play a given sound file or to
> ask WMP for metadata about a sound file.
> --
> Jeffrey Barish
I am using Python IDLE 2.4.3 on Windows XP. I use File->New Window
to create a new program. In the Save As dialog, it always takes me to
the python program directory (where python is installed). Since this
is not where I want to save my source file, I have to select the
directory I want.
Is there
Hi All,
Am looking for a python script that can convert fileformats to txt
format. Am unable to find anything in python. Currently the InfoCon
projects looks pretty good to use, but it is return in java.
Thanks and Regards,
Gaurav Agarwal
--
http://mail.python.org/mailman/listinfo/python-list
Hi All,
Am looking for a python script that can convert fileformats to txt
format. Am unable to find anything in python. Currently the InfoCon
projects looks pretty good to use, but it is return in java.
Thanks and Regards,
Gaurav Agarwal
--
http://mail.python.org/mailman/listinfo/python-list
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Project: Network News Transport Protocol Server Program
Description:
基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子
Reference:
NNTP协议: http://www.mibsoftware.com/userkt/0099.htm
正则表达式:
http://wiki.woodpecker.org.cn/moin/RegExpInPython#head-235876538484
In <[EMAIL PROTECTED]>, arvind wrote:
> i've created the myclass instance and calles the "function second()".
> i want to access the text entered in 'w' through Entry widget in
> "function third()"
> i am getting the 'fuction not having 'w' attribute error.
> how to overcome it?
Make `w` an attri
Netkiller 写道:
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> """
> Project: Network News Transport Protocol Server Program
> Description:
> 基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子
import sys,re
import MySQLdb
class NewsDB:
conn = None
cursor = None
def connect(self):
try:
In <[EMAIL PROTECTED]>, bruce wrote:
> here is a sample of the text i'm looking to do hte search/replace for...
>
> bgcolor="#ff" > ACCT 209 - SURVEY OF ACCT PRIN
>
> i'm trying to figure out how to replace the " " with a ''. in html, the
> ' ' char is not a valid
Netkiller 写道:
> Netkiller 写道:
>
> > #!/usr/bin/python
> > # -*- coding: utf-8 -*-
> > """
> > Project: Network News Transport Protocol Server Program
> > Description:
> > 基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子
>
>
Database SQL Script follow:
-- phpMyAdmin SQL Dump
-- version 2.7.0-rc1
-- http://www.ph
On Tue, 04 Jul 2006 05:02:39 +0200, jkuo22 <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> Here is my simple Tkinter script:
>
> ## start of entry.py
> from Tkinter import *
> root=Tk()
> e1=Entry(root, width=16)
> e1.pack()
> e2=Entry(root, width=16)
> e2.pack()
> mainloop()
> ## end
>
> First, it
In <[EMAIL PROTECTED]>, Gaurav Agarwal
wrote:
> Am looking for a python script that can convert fileformats to txt
> format. Am unable to find anything in python. Currently the InfoCon
> projects looks pretty good to use, but it is return in java.
What do you mean by 'fileformats'? A script that
101 - 166 of 166 matches
Mail list logo