Jason writes:
[...]
> Is there a way I can write the subclass but then somehow... extend an
> existing instance all at once rather than monkeypatch methods on one
> by one? So I could take an existing instance of a FileMonitor and make
> it an instance of my subclass? This would even allow me to o
Arnaud Delobelle wrote:
> Jason writes:
> [...]
>> Is there a way I can write the subclass but then somehow... extend an
>> existing instance all at once rather than monkeypatch methods on one
>> by one? So I could take an existing instance of a FileMonitor and make
>> it an instance of my subcla
genxtech wrote:
> Hello. I am still really new to python and I have a project where I
> am trying to use the data files from another program and write a new
> program with new user interface and all. My first step was to open
> one of the files in 'rb' mode and print the contents, but I am
> unf
Dear List,
I have a horrible feeling that this is in some way related to the new
user installation directory in 2.7,or some problem with the framework
built, but I'm having great trouble with the module search path on
2.7.
I usually install modules to install_lib =
~/Library/Python/$py_version_sh
On Sep 5, 3:53 pm, Peter Otten <__pete...@web.de> wrote:
> >>> m = gio.File(".").monitor_directory()
> >>> C = type(m)
'C' will not necessarily be 'gio.FileMonitor' — I think the internals
of the GIO methods might further "subclass" it in some way depending
on what underlying monitors are availabl
In article
,
Nicholas Cole wrote:
> I have a horrible feeling that this is in some way related to the new
> user installation directory in 2.7,or some problem with the framework
> built, but I'm having great trouble with the module search path on
> 2.7.
>
> I usually install modules to install
On Sun, Sep 5, 2010 at 10:20 AM, Ned Deily wrote:
> I'm not sure why you think it is broken. The Apple 2.6 and the
> python.org 2.7 have different site-package directories in different
> locations. That is to be expected. The Apple-supplied Python comes
> with some additional packages pre-insta
Am Sat, 04 Sep 2010 21:29:49 -0700 schrieb shivram:
>
> i want to learn network and socket programming but i would like to do
> this in python.Reason behind this is that python is very simple and the
> only language i know .
> anybody can suggest me which book should i pick. the book should have
>
I am trying to plot a runtime graph using pylab. But the very purpose
of functionality is lost because of high CPU percentage hogged by
plotting the graph.
Here is the piece of code which I have written.
def timerfunc(ulcm, dlcm):
count=0
xaxis=[]
yaxis=[]
ion()
while 1:
On Sat, Sep 4, 2010 at 9:29 PM, shivram wrote:
> i want to learn network and socket programming but i would like to do
> this in python.Reason behind this is that python is very simple and
> the only language i know .
> anybody can suggest me which book should i pick.
> the book should have follow
On 2010-09-05, genxtech wrote:
> I am using Fedora 13. When I run the file command the response is
> that it is a 'data' file. If there are any tips on how to
> programatically figure out the format, I would greatly appreciate it.
I tried python-magic from the fedora repositories, but was unabl
Il Sun, 5 Sep 2010 03:05:54 -0700 (PDT), Madhur ha scritto:
> Is there something which does not makes sense .?
1. How, a computer, is supposed to handle your infinite loop?
2. Running ghraphs shuold be handled in totally different way: look at the
"stripcharting" demo in this zip
http://agni.phy
Jason wrote:
> On Sep 5, 3:53 pm, Peter Otten <__pete...@web.de> wrote:
>> >>> m = gio.File(".").monitor_directory()
>> >>> C = type(m)
>
> 'C' will not necessarily be 'gio.FileMonitor' — I think the internals
> of the GIO methods might further "subclass" it in some way depending
> on what underl
"David Cournapeau" wrote in message
news:mailman.455.1283665528.29448.python-l...@python.org...
On Thu, Sep 2, 2010 at 7:02 PM, Michael Kreim
wrote:
imax = 10
a = 0
for i in xrange(imax):
a = a + 10
print a
Unfortunately my Python Code was much slower [than Matlab] and I do not
On Sep 5, 3:29 pm, geremy condra wrote:
> On Sat, Sep 4, 2010 at 9:29 PM, shivram wrote:
> > i want to learn network and socket programming but i would like to do
> > this in python.Reason behind this is that python is very simple and
> > the only language i know .
> > anybody can suggest me whic
Trying to learn Python for a specific purpose to repair a quicktime
file that's corrupted, is it even possible to create a proof-of-
concept python script that generates a valid 'moov' atom from a
corrupt .mov video ?, "file size 1.3gb" (Kodak camera failed to
finalize file).
[IMG]http://a.images
Trying to learn Python for a specific purpose to repair a quicktime
file that's corrupted, is it even possible to create a proof-of-
concept python script that generates a valid 'moov' atom from a
corrupt .mov video ?, "file size 1.3gb" (Kodak camera failed to
finalize file).
Mac--> http://a.imag
Trying to learn Python for a specific purpose to repair a quicktime
file that's corrupted, is it even possible to create a proof-of-
concept python script that generates a valid 'moov' atom from a
corrupt .mov video ?, "file size 1.3gb" (Kodak camera failed to
finalize file).
Mac--> http://a.imag
On Sun, 05 Sep 2010 05:44:16 -0700, ctops.legal wrote:
> Trying to learn Python for a specific purpose to repair a quicktime file
> that's corrupted, is it even possible to create a proof-of- concept
> python script that generates a valid 'moov' atom from a corrupt .mov
> video ?, "file size 1.3g
why not ssh browser traffic? why use SSL certificate authorities which can't
be trusted in the first place?
Is SSH not proven to be secure?
To this day I have not seen ssh module for say Apache web server, why not?
I understand this maybe wrong list to ask this question, but I love you guys
so mu
On Sunday 05 September 2010, it occurred to alex goretoy to exclaim:
> why not ssh browser traffic? why use SSL certificate authorities which
> can't be trusted in the first place?
> Is SSH not proven to be secure?
>
> To this day I have not seen ssh module for say Apache web server, why not?
>
>
>>> If we were to use SSH on the web, which is certainly not the point of
SSH,
>>> we'd still need some kind of certificate authority to make the whole
system
>>> workable.
Yeah, you are correct. I thought about that after having posted these
questions. Even though it was SSH there still would be
On Fri, 03 Sep 2010 21:17:44 +0100, BartC wrote:
> I'm not sure the Python developers were interested in getting fast
> loops.
>
> For-loops which iterate between two numbers are amongst the easiest
> things to make fast in a language. Yet originally you had to use:
>
> for i in range(N):
I d
On 5 September 2010 14:54, ctops.legal wrote:
> Trying to learn Python for a specific purpose to repair a quicktime
> file that's corrupted, is it even possible to create a proof-of-
> concept python script that generates a valid 'moov' atom from a
> corrupt .mov video ?, "file size 1.3gb" (Koda
On Sun, 05 Sep 2010 12:28:47 +0100, BartC wrote:
>> Getting the above kind of code fast requires the interpreter to be
>> clever enough so that it will use native machine operations on a int
>> type instead of converting back and forth between internal
>> representations.
>
> Writing for i in xra
I'm writing a "literate programming" document, example.txt, which mixes
text and code in ReST format:
This is my excellent module for making spam. It has
one public function, ``make_spam``, which takes a
single argument for how much spam to make:
>>> from module import make_spam
>>> ma
I'am getting this annoying message all the time when using IDLE.
... personal firewall software is blocking the connection
When I am editing a source *.py file and I click on F5 (run) I get the
above message.
What can I do?
I am using Norton Internet Security. I try to find if 127.0.0.1 is
blo
On 5 sep, 18:00, vsoler wrote:
> I'am getting this annoying message all the time when using IDLE.
>
> ... personal firewall software is blocking the connection
>
> When I am editing a source *.py file and I click on F5 (run) I get the
> above message.
>
> What can I do?
>
> I am using Norton Inte
On Sun, 2010-09-05 at 14:00 +, Steven D'Aprano wrote:
> By the way, there's no need to send three messages in 10 minutes
> asking
> the same question, and adding FORM METHOD links to your post will
> probably just get it flagged as spam by many people.
Apparently it has, as I only got this
Steven D'Aprano, 05.09.2010 17:00:
Of course, a real optimizing compiler would realise that the Pascal code
did nothing at all, and compile it all away to an empty a.out file...
Which is just one of the reasons why this kind if "benchmark" provides no
insight into anything that should have an
Hi Steven,
On 2010-09-05 17:30, Steven D'Aprano wrote:
> I run the doctests with:
>
> python2.6 -m doctest examples.txt
>
> and the first example passes, but the second fails with NameError:
> make_spam not defined.
I run my doctests by calling
doctest.testfile(filename)
for each file in
I'm using httplib, and want to get the Location header from the
response. The getheaders() method gives you back a list of (name,
value) tuples. It would be a lot more convenient if it gave you back a
dict, but it is what it is.
Anyway, I came up with:
location = [t[1] for t in headers i
"Steven D'Aprano" wrote in message
news:4c83b425$0$28657$c3e8...@news.astraweb.com...
On Sun, 05 Sep 2010 12:28:47 +0100, BartC wrote:
It would
be nice if you could directly code low-level algorithms in it without
relying on accelerators, and not have to wait two and a half minutes (or
whatev
On Sunday 05 September 2010, it occurred to Roy Smith to exclaim:
> I'm using httplib, and want to get the Location header from the
> response. The getheaders() method gives you back a list of (name,
> value) tuples. It would be a lot more convenient if it gave you back a
> dict, but it is what i
On Sep 5, 2010, at 1:09 PM, Roy Smith wrote:
I'm using httplib, and want to get the Location header from the
response. The getheaders() method gives you back a list of (name,
value) tuples. It would be a lot more convenient if it gave you
back a
dict, but it is what it is.
Anyway, I came
Philip Semanchuk wrote:
>
> On Sep 5, 2010, at 1:09 PM, Roy Smith wrote:
>
>> I'm using httplib, and want to get the Location header from the
>> response. The getheaders() method gives you back a list of (name,
>> value) tuples. It would be a lot more convenient if it gave you
>> back a
>> dic
On 9/4/2010 11:51 PM, Paul Rubin wrote:
John Nagle writes:
Unoptimized reference counting, which is what CPython does, isn't
all that great either. The four big bottlenecks in Python are boxed
numbers, attribute lookups, reference count updates, and the GIL.
The performance hit of havin
On Sep 5, 8:54 am, "ctops.legal" wrote:
> Trying to learn Python for a specific purpose to repair a quicktime
> file that's corrupted, is it even possible to create a proof-of-
> concept python script that generates a valid 'moov' atom from a
> corrupt .mov video ?, "file size 1.3gb" (Kodak camer
On Sep 5, 2010, at 1:45 PM, Peter Otten wrote:
Philip Semanchuk wrote:
On Sep 5, 2010, at 1:09 PM, Roy Smith wrote:
I'm using httplib, and want to get the Location header from the
response. The getheaders() method gives you back a list of (name,
value) tuples. It would be a lot more conv
On Sep 5, 8:54 am, "ctops.legal" wrote:
> Trying to learn Python for a specific purpose to repair a quicktime
> file that's corrupted, is it even possible to create a proof-of-
> concept python script that generates a valid 'moov' atom from a
> corrupt .mov video ?, "file size 1.3gb" (Kodak camer
BartC, 05.09.2010 19:09:
I've thought about it (writing an independent interpreter). But I don't
know enough of the language, and a lot of it I don't understand (eg.
OOP). Besides, I think the language itself deliberately makes it
difficult to get it up to speed. Some of the reasons might be the
In article
,
Nicholas Cole wrote:
> On Sun, Sep 5, 2010 at 10:20 AM, Ned Deily wrote:
> > I'm not sure why you think it is broken. The Apple 2.6 and the
> > python.org 2.7 have different site-package directories in different
> > locations. That is to be expected. The Apple-supplied Python c
Hi! I'm writing a package with several files in it, and I've found
that "isinstance" doesn't work the way I expect under certain
circumstances.
Short example: here are two files.
# fileone.py
import filetwo
class AClass( object ):
pass
if __name__ == '__main__':
a = AClass()
filetwo.is_acl
Spencer Pearson writes:
> Hi! I'm writing a package with several files in it, and I've found
> that "isinstance" doesn't work the way I expect under certain
> circumstances.
>
> Short example: here are two files.
> # fileone.py
> import filetwo
>
> class AClass( object ):
> pass
>
> if __name__
level: beginner
how can i access the contents of a text file in Python?
i would like to compare a string (word) with the content of a text
file (word_list). i want to see if word is in word_list. let's assume
the TXT file is stored in the same directory as the PY file.
def is_valid_word(word, wo
may be something like this
f = open ("file",r)
data = f.read()
f.close
if word in data:
print word, "is present in file"
On Mon, Sep 6, 2010 at 3:17 AM, Baba wrote:
> level: beginner
>
> how can i access the contents of a text file in Python?
>
> i would like to compare a string (word) wit
On 09/05/10 16:47, Baba wrote:
> level: beginner
>
> how can i access the contents of a text file in Python?
>
> i would like to compare a string (word) with the content of a text
> file (word_list). i want to see if word is in word_list. let's assume
> the TXT file is stored in the same director
On Sun, Sep 5, 2010 at 5:47 PM, Baba wrote:
> level: beginner
>
> how can i access the contents of a text file in Python?
>
> i would like to compare a string (word) with the content of a text
> file (word_list). i want to see if word is in word_list. let's assume
> the TXT file is stored in the s
On 05/09/2010 22:47, Baba wrote:
level: beginner
how can i access the contents of a text file in Python?
That's a very basic question.
I suggest you read a tutorial such as "Dive Into Python":
http://diveintopython.org/toc/index.html
i would like to compare a string (word) with the con
Baba wrote:
level: beginner
how can i access the contents of a text file in Python?
i would like to compare a string (word) with the content of a text
file (word_list). i want to see if word is in word_list. let's assume
the TXT file is stored in the same directory as the PY file.
def is_valid
i've got a python.txt that contain python and it must stay as it (python.txt)
how can i include it in my program ?
import python.txt doesn't work
is there a way :
a) to make an include("python.txt")
b) tell him to treat .txt as .py file that i can make an import python ?
i'am using python3
Regards
Em 05-09-2010 19:06, Alexander Kapps escreveu:
> Baba wrote:
>> level: beginner
>>
>> how can i access the contents of a text file in Python?
>>
>> i would like to compare a string (word) with the content of a text
>> file (word_list). i want to see if word is in word_list. let's assume
>> the TXT
On Sun, 05 Sep 2010 18:41:15 +0200, Stefan Schwarzer wrote:
> Hi Steven,
>
> On 2010-09-05 17:30, Steven D'Aprano wrote:
>> I run the doctests with:
>>
>> python2.6 -m doctest examples.txt
>>
>> and the first example passes, but the second fails with NameError:
>> make_spam not defined.
>
> I
On Sep 5, 1:19 pm, Spencer Pearson wrote:
> Hi! I'm writing a package with several files in it, and I've found
> that "isinstance" doesn't work the way I expect under certain
> circumstances.
>
> Short example: here are two files.
> # fileone.py
> import filetwo
>
> class AClass( object ):
> pas
On Mon, 06 Sep 2010 00:57:30 +0200, bussiere bussiere wrote:
> i've got a python.txt that contain python and it must stay as it
> (python.txt)
Why? Is it against the law to change it? *wink*
> how can i include it in my program ?
> import python.txt doesn't work
You could write a custom impor
In article ,
bussiere bussiere wrote:
> i've got a python.txt that contain python and it must stay as it (python.txt)
>
> how can i include it in my program ?
> import python.txt doesn't work
> is there a way :
> a) to make an include("python.txt")
> b) tell him to treat .txt as .py file that i
In article <4c8423d3$0$28657$c3e8...@news.astraweb.com>,
Steven D'Aprano wrote:
> fp = open("python.txt")
> text = fp.read()
> fp.close()
> exec(text)
> But keep in mind that the contents of python.txt will be executed as if
> you had typed it yourself. If you don't trust the source with your
On 05/09/2010 23:57, bussiere bussiere wrote:
i've got a python.txt that contain python and it must stay as it (python.txt)
how can i include it in my program ?
import python.txt doesn't work
is there a way :
a) to make an include("python.txt")
b) tell him to treat .txt as .py file that i can ma
On 9/5/2010 6:57 PM, bussiere bussiere wrote:
i've got a python.txt that contain python and it must stay as it (python.txt)
If you are working for someone who is such an idiot as to impose such a
condition on you, you have our condolences.
how can i include it in my program ?
import python.
On 9/5/2010 7:12 PM, Steven D'Aprano wrote:
fp = open("python.txt")
text = fp.read()
fp.close()
exec(text)
But keep in mind that the contents of python.txt will be executed as if
you had typed it yourself. If you don't trust the source with your life
(or at least with the contents of your compu
On Mon, 06 Sep 2010 00:27:13 +0100, MRAB wrote:
> import imp
> python = imp.load_source("python", "python.txt")
Nice!
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On 2:59 PM, Carl Banks wrote:
On Sep 5, 1:19 pm, Spencer Pearson wrote:
Hi! I'm writing a package with several files in it, and I've found
that "isinstance" doesn't work the way I expect under certain
circumstances.
Short example: here are two files.
# fileone.py
import filetwo
class AClass(
On Sep 5, 6:56 pm, Peter Otten <__pete...@web.de> wrote:
> Does it have to be gio.FileMonitor? pyinotify can automatically add new
> subdirectories out of the box.
Well, since it's for a core part of the software, I'd like it to be
cross platform — not in the sense of Windows/Mac, but FreeBSD,
Sol
On Sep 5, 4:16 am, Peter Otten <__pete...@web.de> wrote:
> genxtech wrote:
> > Hello. I am still really new to python and I have a project where I
> > am trying to use the data files from another program and write a new
> > program with new user interface and all. My first step was to open
> > on
On Sep 6, 8:57 am, Jason wrote:
> But it's looking more and more like I should give up
> that particular goal.
...but on the other hand I just knocked together a pyinotify
threaded watch system in about 50 lines. It's tempting to tell users
of other platforms to write their own and submit a p
On Sep 5, 5:07 pm, Dave Angel wrote:
> On 2:59 PM, Carl Banks wrote:
> > All of this gets a lot more complicated when packages are involved.
>
> Perhaps a better answer would be to import __main__ from the second module.
Then what if the module is imported from a different script? It'll
try to i
MAKE UPTO $5000 P/M $2000 IN FIRST 30 DAYS! NO INV
Generate $50 to $100 whenever you
have a couple of hours free time to spare.
You could make $50 or more in the next 2 hours.
Starting right Now!Today!
GET PAID TO:
Take online surveys and make from $5 to $75, or more
Participate in focus groups a
67 matches
Mail list logo