On 02/16/2015 11:42 AM, Neal Becker wrote:
> Robert Kern wrote:
>> Ah, do you have the package `future` installed?
>>
>> https://github.com/rkern/line_profiler/issues/12
>
> Yes, I do. What do you suggest as a workaround?
I would think importing 'profile' directly would be the workaround.
--
~
Robert Kern wrote:
> On 2015-02-13 13:35, Neal Becker wrote:
>> Robert Kern wrote:
>>
>>> @profile
>>> def run():
>>> pass
>>>
>>> run()
>>
>> No, this doesn't work either. Same failure
>>
>> kernprof -l test_prof.py
>> Wrote profile results to test_prof.py.lprof
>> Traceback (most recent call la
On 2015-02-13 13:35, Neal Becker wrote:
Robert Kern wrote:
@profile
def run():
pass
run()
No, this doesn't work either. Same failure
kernprof -l test_prof.py
Wrote profile results to test_prof.py.lprof
Traceback (most recent call last):
File "/home/nbecker/.local/bin/kernprof", line 9,
Robert Kern wrote:
> @profile
> def run():
> pass
>
> run()
No, this doesn't work either. Same failure
kernprof -l test_prof.py
Wrote profile results to test_prof.py.lprof
Traceback (most recent call last):
File "/home/nbecker/.local/bin/kernprof", line 9, in
load_entry_point('line-pro
Robert Kern wrote:
> On 2015-02-11 01:17, Steven D'Aprano wrote:
>> Neal Becker wrote:
>>
>>
>>> To quote from https://pypi.python.org/pypi/line_profiler/
>>>
>>> $ kernprof -l script_to_profile.py
>>> kernprof will create an instance of LineProfiler and insert it into the
>>> __builtins__ namespa
Robert Kern wrote:
> Referring to that namespace as the
> "`__builtins__` namespace" isn't *wrong*. It may mislead you into thinking
> I've implemented it one particular way
Well it certainly mislead me :-)
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On 2015-02-11 00:06, Neal Becker wrote:
I inserted
@profile
def run(...)
into a module-level global function called 'run'. Something is very wrong here.
1. profile results were written before anything even ran
2. profile is not defined?
kernprof -l ./test_unframed.py --lots --of --args ...
On 2015-02-11 01:17, Steven D'Aprano wrote:
Neal Becker wrote:
To quote from https://pypi.python.org/pypi/line_profiler/
$ kernprof -l script_to_profile.py
kernprof will create an instance of LineProfiler and insert it into the
__builtins__ namespace with the name profile.
Ewww What a R
Neal Becker wrote:
> To quote from https://pypi.python.org/pypi/line_profiler/
>
> $ kernprof -l script_to_profile.py
> kernprof will create an instance of LineProfiler and insert it into the
> __builtins__ namespace with the name profile.
Ewww What a Ruby-esque interface, that makes me sa
Steven D'Aprano wrote:
> Neal Becker wrote:
>
>> I inserted
>> @profile
>> def run(...)
>>
>> into a module-level global function called 'run'. Something is very wrong
>> here. 1. profile results were written before anything even ran
>> 2. profile is not defined?
>
> Well, is it defined? Where
Neal Becker wrote:
> I inserted
> @profile
> def run(...)
>
> into a module-level global function called 'run'. Something is very wrong
> here. 1. profile results were written before anything even ran
> 2. profile is not defined?
Well, is it defined? Where does it come from?
If you defined it
Ethan Furman wrote:
> On 02/10/2015 04:06 PM, Neal Becker wrote:
>> I inserted
>> @profile
>> def run(...)
>>
>> into a module-level global function called 'run'. Something is very wrong
>> here. 1. profile results were written before anything even ran
>> 2. profile is not defined?
>>
>> kernp
On 02/10/2015 04:06 PM, Neal Becker wrote:
> I inserted
> @profile
> def run(...)
>
> into a module-level global function called 'run'. Something is very wrong
> here.
> 1. profile results were written before anything even ran
> 2. profile is not defined?
>
> kernprof -l ./test_unframed.py --
I inserted
@profile
def run(...)
into a module-level global function called 'run'. Something is very wrong here.
1. profile results were written before anything even ran
2. profile is not defined?
kernprof -l ./test_unframed.py --lots --of --args ...
Wrote profile results to test_unframed.py.
On Thu, Oct 24, 2013 at 6:30 PM, Johannes Bauer wrote:
> On 24.10.2013 09:07, Chris Angelico wrote:
>> AES is a stream cipher;
>
> No, it is definitely not! It's a block cipher! However, since he uses
> CFB mode of operation, it behaves like a stream cipher.
Sorry! Quite right. What I meant was,
On 24.10.2013 09:33, Johannes Bauer wrote:
> On 24.10.2013 07:22, Paul Pittlerson wrote:
>
>> What am I doing wrong?
>
> You're not reinitializing the internal state of the crypto engine. When
> you recreate "cipher" with the same IV every time, it will
On 24.10.2013 07:22, Paul Pittlerson wrote:
> What am I doing wrong?
You're not reinitializing the internal state of the crypto engine. When
you recreate "cipher" with the same IV every time, it will work.
Best regards,
Joe
--
>> Wo hattest Du das Beben no
On 24.10.2013 09:07, Chris Angelico wrote:
> On Thu, Oct 24, 2013 at 4:22 PM, Paul Pittlerson
> wrote:
>> msg = cipher.encrypt(txt)
>>
> '|s\x08\xf2\x12\xde\x8cD\xe7u*'
>>
>> msg = cipher.encrypt(txt)
>>
> '\xa1\xed7\xb8h>
>> # etc
>
AES is a stream cipher;
No, it is definitely not! It'
On Thu, Oct 24, 2013 at 4:22 PM, Paul Pittlerson wrote:
> msg = cipher.encrypt(txt)
>
'|s\x08\xf2\x12\xde\x8cD\xe7u*'
>
> msg = cipher.encrypt(txt)
>
'\xa1\xed7\xb8h
> # etc
Is this strictly the code you're using? AES is a stream cipher; what
you've effectively done is encrypt the text
ipher.encrypt(txt)
cipher.decrypt(iv+msg)
>>> '\xfb\xa1\xa8\x9e"L<\x10Rg\xb5f^\x8a\x17\xfd\xbd$=\xf3\xaf@a8t\xd8Bz<\xce\xe26\xde\xc6cD\xdal\'\xf3@(\xa6'
What am I doing wrong?
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-03-16, Chris Angelico wrote:
> On Sun, Mar 17, 2013 at 2:34 AM, Yves S. Garret
> wrote:
>> *facepalm*
>>
>> Yep, I see it :) . Thanks for your help.
>
> Glad to be of service. Welcome to a life of programming, where
> the palm meets the face on a regular basis... more frequently
> if you
On Sun, Mar 17, 2013 at 2:34 AM, Yves S. Garret
wrote:
> *facepalm*
>
> Yep, I see it :) . Thanks for your help.
Glad to be of service. Welcome to a life of programming, where the
palm meets the face on a regular basis... more frequently if you use
Microsoft Windows, tar, non-eight-bit-clean tra
th the book:
>
> http://bin.cakephp.org/view/514822432
>
>
> What I don't understand is, why am I getting that error? I've done
diff -w
> and the code looks for the most part the same. What am I doing wrong
when I
> put the application together?
On Saturday, March 16, 2013 11:23:07 AM UTC-4, Chris Angelico wrote:
> On Sun, Mar 17, 2013 at 2:16 AM, Yves S. Garret
>
> wrote:
>
> > In the example that I have posted from the book it works just fine.
>
>
>
> Yep, I just checked the book's version again and the difference is
>
> clear. Ch
Am 16.03.13 16:14, schrieb Yves S. Garret:
On Saturday, March 16, 2013 11:08:24 AM UTC-4, Chris Angelico wrote:
self.secret_txt.delete(0.0, END)
self.secret_txt.delete(0.0, message)
Is the second one supposed to be adding text? I'm not familiar with
tkinter but that's the line with t
On Sun, Mar 17, 2013 at 2:16 AM, Yves S. Garret
wrote:
> In the example that I have posted from the book it works just fine.
Yep, I just checked the book's version again and the difference is
clear. Check out the two lines I quoted in my previous post, and look
at the corresponding two lines in t
in.cakephp.org/view/399711843
>
> >
>
> > This is the code that came with the book:
>
> >
>
> > http://bin.cakephp.org/view/514822432
>
> >
>
> >
>
> > What I don't understand is, why am I getting that err
view/399711843
>
> >
>
> > This is the code that came with the book:
>
> >
>
> > http://bin.cakephp.org/view/514822432
>
> >
>
> >
>
> > What I don't understand is, why am I getting that error? I've done
>
&
/1107093008
>
> And this is the error that I'm getting:
>
> http://bin.cakephp.org/view/399711843
>
> This is the code that came with the book:
>
> http://bin.cakephp.org/view/514822432
>
>
> What I don't understand is, why am I getting that error? I'
at error? I've done diff -w
> and the code looks for the most part the same. What am I doing wrong when I
> put the application together?
self.secret_txt.delete(0.0, END)
self.secret_txt.delete(0.0, message)
Is the second one supposed to be adding text? I'm not familiar
bin.cakephp.org/view/399711843
This is the code that came with the book:
http://bin.cakephp.org/view/514822432
What I don't understand is, why am I getting that error? I've done diff -w
and the code looks for the most part the same. What am I doing wrong when I
put the application togeth
I assume you have admin privileges on your computer, correct?
On Thu, Feb 21, 2013 at 6:39 AM, Etherus wrote:
> I have downloaded the windows installer for a 32 bit installation of
> python 2.7.3 but it tells me that:
>
> The feature you are trying to use is on a network resource that is
> unava
On 21/02/2013 14:39, Etherus wrote:
> I have downloaded the windows installer for a 32 bit installation of
> python 2.7.3 but it tells me that:
>
> The feature you are trying to use is on a network resource that is
> unavailable.
>
> Click OK to try again, or enter an alternative path to a folder
I have downloaded the windows installer for a 32 bit installation of python
2.7.3 but it tells me that:
The feature you are trying to use is on a network resource that is unavailable.
Click OK to try again, or enter an alternative path to a folder containing the
installation package python 2.7.
On 28/02/2012 17:16, Eric Frederich wrote:
If I do a time.sleep(0.001) right at the beginning of the run() method,
then it completes fine.
I was able to run it through a couple hundred times without problem.
If I sleep for less time than that or not at all, it may or may not
complete.
[snip]
T
If I do a time.sleep(0.001) right at the beginning of the run() method,
then it completes fine.
I was able to run it through a couple hundred times without problem.
If I sleep for less time than that or not at all, it may or may not
complete.
On Mon, Feb 27, 2012 at 9:38 PM, MRAB wrote:
> On 27/
On 27/02/2012 16:57, Eric Frederich wrote:
Still freezing sometimes, like 1 out of 10 times that I run it.
Here is updated code and a couple of outputs.
[snip]
I don't know what the problem is. All I can suggest is a slightly
modified version.
If a worker that says it's terminating without fir
Still freezing sometimes, like 1 out of 10 times that I run it.
Here is updated code and a couple of outputs.
code
#!/usr/bin/env python
import sys
import Queue
import multiprocessing
import time
def FOO(a, b, c):
print 'foo', a, b, c
return (a + b) * c
class MyWorker(mu
On 24/02/2012 17:00, Eric Frederich wrote:
I can sill get it to freeze and nothing is printed out from the other
except block.
Does it look like I'm doing anything wrong here?
[snip]
I don't normally use multiprocessing, so I forgot about a critical
detail. :-(
When the multiprocessing module
I can sill get it to freeze and nothing is printed out from the other
except block.
Does it look like I'm doing anything wrong here?
On Thu, Feb 23, 2012 at 3:42 PM, MRAB wrote:
> On 23/02/2012 17:59, Eric Frederich wrote:
>
>> Below is some pretty simple code and the resulting output.
>> Someti
On 23/02/2012 17:59, Eric Frederich wrote:
Below is some pretty simple code and the resulting output.
Sometimes the code runs through but sometimes it just freezes for no
apparent reason.
The output pasted is where it just got frozen on me.
It called start() on the 2nd worker but the 2nd worker n
Below is some pretty simple code and the resulting output.
Sometimes the code runs through but sometimes it just freezes for no
apparent reason.
The output pasted is where it just got frozen on me.
It called start() on the 2nd worker but the 2nd worker never seemed to
enter the run method.
###
On Sat, 07 May 2011 15:14:07 +1100, Даниил Рыжков wrote:
> Thanks, Cristian! It works.
>> List of Pygtk: http://www.daa.com.au/mailman/listinfo/pygtk
> Thanks again. Subscribed :)
> 2011/5/7 craf :
>> Hi.
>>
>> Try this:
>>
>> #!/usr/bin/env python
>>
>> import gtk.glade
>>
>> class TestPyGtk:
>>
Thanks, Cristian! It works.
> List of Pygtk: http://www.daa.com.au/mailman/listinfo/pygtk
Thanks again. Subscribed :)
2011/5/7 craf :
> Hi.
>
> Try this:
>
> #!/usr/bin/env python
>
> import gtk.glade
>
> class TestPyGtk:
> """This is an Hello World GTK application"""
>
> def __init__(self):
uot;test.py", line 32, in
>gtk.main()
> KeyboardInterrupt
> ---
> So what am I doing wrong?
>
>I haven't used gtk before, but is there a show method or something
>similar you need, to actually make the window appear? The
>KeyboardInterrupt is normal. That&
> I haven't used gtk before, but is there a show method or something similar
> you need, to actually make the window appear?
I don't know. I think "self.wTree = gtk.glade.XML(self.gladefile)"
should do this. For example, author of this tutorial
(http://www.learningpython.com/2006/05/07/creating-a-g
uot;test.py", line 32, in
>gtk.main()
> KeyboardInterrupt
> ---
> So what am I doing wrong?
>
I haven't used gtk before, but is there a show method or something similar
you need, to actually make the window appear? The KeyboardInterrupt is
normal. That's ho
e the script was executed, console did not show anything and
window wasn't displayed. When I pressed CTRL+С console displayed
trackback:
---
CTraceback (most recent call last):
File "test.py", line 32, in
gtk.main()
KeyboardInterrupt
---
So what am I doing wrong?
--
Best wish
In article <75798c2a-44da-4c58-917c-7a41537c5...@y32g2000prd.googlegroups.com>,
Zectbumo wrote:
>
>Here are the steps I am doing that cause me to get the error
>ImportError: No module named _hi.
>I'm running OS X 10.6.1 What am I doing wrong?
You probably want to ask on
Here are the steps I am doing that cause me to get the error
ImportError: No module named _hi.
I'm running OS X 10.6.1 What am I doing wrong?
mkdir -p /tmp/my_swig_test
cd /tmp/my_swig_test
cat >hi.c<<.
#include
void hello(void) {printf("Hello World\n");}
.
gcc -shared
I see. Thanks!
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
On Tue, Jul 14, 2009 at 11:20 PM, Jochen Schulz wrote:
> Xavier Ho:
> >
> > Why doesn't the second output print [1,
Xavier Ho:
>
> Why doesn't the second output print [1, 2, 3, , 7, 8, 9] ?
-- snip
> print a.n.extend([6, 7, 8, 9])
extend doesn't fail. It just returns None and extends the list in place.
In [1]: l = [1, 2, 3]
In [2]: l.extend([4, 5, 6])
In [3]: l
Out[3]: [1, 2, 3, 4, 5, 6]
J.
--
When I
Xavier Ho wrote:
Why doesn't the second output print [1, 2, 3, , 7, 8, 9] ?
The code is run at: http://codepad.org/wgLU4JZh
class A():
def __init__(self):
self.n = [1, 2, 3, 4, 5]
a = A()
print a.n
print a.n.extend([6, 7, 8, 9])
#Output:
#[1, 2, 3, 4, 5]
#None
I reall
This has been asked extensively before, here and elsewhere.
On Tue, Jul 14, 2009 at 09:52, Xavier Ho wrote:
> Why doesn't the second output print [1, 2, 3, , 7, 8, 9] ?
> The code is run at: http://codepad.org/wgLU4JZh
>
> class A():
> def __init__(self):
> self.n = [1, 2, 3, 4, 5
Why doesn't the second output print [1, 2, 3, , 7, 8, 9] ?
The code is run at: http://codepad.org/wgLU4JZh
class A():
def __init__(self):
self.n = [1, 2, 3, 4, 5]
a = A()
print a.n
print a.n.extend([6, 7, 8, 9])
#Output:
#[1, 2, 3, 4, 5]
#None
I really don't know, but I'm proba
On Apr 24, 10:11 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> In python, use attributes starting with a single underscore (such as
> _name). It tells users that they shouldn't mess with them. By
> design, python doesn't include mechanisms equivalent to the Java / C++
> 'private'.
Arnaud, G
Brian Munroe a écrit :
Ok, so thanks everyone for the helpful hints. That *was* a typo on my
part (should've been super(B...) not super(A..), but I digress)
I'm building a public API. Along with the API I have a few custom
types that I'm expecting API users to extend, if they need too. If I
d
Brian Munroe <[EMAIL PROTECTED]> writes:
> Ok, so thanks everyone for the helpful hints. That *was* a typo on my
> part (should've been super(B...) not super(A..), but I digress)
>
> I'm building a public API. Along with the API I have a few custom
> types that I'm expecting API users to extend,
En Thu, 24 Apr 2008 18:18:01 -0300, Brian Munroe
<[EMAIL PROTECTED]> escribió:
Ok, so thanks everyone for the helpful hints. That *was* a typo on my
part (should've been super(B...) not super(A..), but I digress)
I'm building a public API. Along with the API I have a few custom
types that I
Ok, so thanks everyone for the helpful hints. That *was* a typo on my
part (should've been super(B...) not super(A..), but I digress)
I'm building a public API. Along with the API I have a few custom
types that I'm expecting API users to extend, if they need too. If I
don't use name mangling, i
Brian Munroe wrote:
My example:
class A(object):
def __init__(self, name):
self.__name = name
def getName(self):
return self.__name
class B(A):
def __init__(self,name=None):
super(A,self).__init__()
def setName(
Arnaud Delobelle <[EMAIL PROTECTED]> writes:
> That is, if you also pass the name parameter to super(A,self).__init__
> in B's __init__ method
Oops. should be super(B, self).__init__(name), of course.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
Brian Munroe <[EMAIL PROTECTED]> writes:
> My example:
>
> class A(object):
>
> def __init__(self, name):
> self.__name = name
>
> def getName(self):
> return self.__name
>
> class B(A):
>
> def __init__(self,name=None):
> super(A,self)._
On Apr 24, 10:22 pm, Brian Munroe <[EMAIL PROTECTED]> wrote:
> My example:
>
> class A(object):
>
> def __init__(self, name):
> self.__name = name
>
> def getName(self):
> return self.__name
>
> class B(A):
>
> def __init__(self,name=None):
>
My example:
class A(object):
def __init__(self, name):
self.__name = name
def getName(self):
return self.__name
class B(A):
def __init__(self,name=None):
super(A,self).__init__()
def setName(self, name):
tp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440574
>>
>> What am I doing wrong here? I spend almost my entire free time today on
>> this and couldn't find any problem with my code, anyone else has a
>> thought? Thanks in advance.
>>
>> MFB
>
>
ge,accept-charset
> Accept-Ranges: bytes
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=iso-8859-1
> Content-Language: en
>
> Using this nice class (adapted to urllib2) as a basehandler I see that no
> Authentication-header is being s
On Apr 13, 2:11 pm, Michel Bouwmans <[EMAIL PROTECTED]> wrote:
> Using this nice class (adapted to urllib2) as a basehandler I see that no
> Authentication-header is being send
> out:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440574
>
> What am I doing wrong he
ass (adapted to urllib2) as a basehandler I see that no
Authentication-header is being send out:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440574
What am I doing wrong here? I spend almost my entire free time today on this
and couldn't find any problem with my code, anyone else has
Thank you all for the quick replies. It worked! Truely appriciated. I
am python novice and still learning I hope to contribute to this
group someday :)
Hitesh
--
http://mail.python.org/mailman/listinfo/python-list
o create a for loop like this it doesn't work.... how can
>I pass computerName var as an argument?
>What am I doing wrong here? Thank you in advance
>
>import os
>
>Computerlist = ['PC1', 'PC2', 'PC3', 'PC4', 'PC5']
>for C
Thank you Robert, It worked!!!
Thank you so much
--
http://mail.python.org/mailman/listinfo/python-list
Hitesh Joshi a écrit :
(snip)
> But if I try to create a for loop like this it doesn't work how can
> I pass computerName var as an argument?
> What am I doing wrong here? Thank you in advance
>
> import os
>
> Computerlist = ['PC1', 'PC2
Hitesh Joshi wrote:
> ok here is the deal... I figured out how to pass the variable but now
> messages are not popping up on the windows screen if I use this method:
>
> import os
>
> Computerlist = ['PC1', 'PC2', 'PC3', 'PC4', 'PC5']
> for ComputerName in Computerlist:
> print ComputerName
>
ok here is the deal... I figured out how to pass the variable but now
messages are not popping up on the windows screen if I use this method:
import os
Computerlist = ['PC1', 'PC2', 'PC3', 'PC4', 'PC5']
for ComputerName in Computerlist:
print ComputerName
s = "net send %s" % ComputerName
ss computerName var as an argument?
What am I doing wrong here? Thank you in advance
import os
Computerlist = ['PC1', 'PC2', 'PC3', 'PC4', 'PC5']
for ComputerName in Computerlist:
print ComputerName
os.system('net send ComputerName "Message"')
--
http://mail.python.org/mailman/listinfo/python-list
keithlackey wrote:
> I'm relatively new to python and I've run into this problem.
This has two very standard mistakes:
First, as noted by Sybren, messages should just use spaces in order to
be readable.
After correcting that one:
>class structure:
>def __init__(self, folders = []):
>
der([('foo'),])
> print structure1.folders
>
> This returns: [('foo',)]
>
> This works fine. But when I try to make another instance of that class...
>
> structure2 = structure()
> print structure2.folders
>
> This now als
Thus spake keithlackey ([EMAIL PROTECTED]):
> class structure:
> def __init__(self, folders = []):
^
Here's your problem. To understand what's going on, you need to know two
things:
- Default arguments are only evaluated ONCE
keithlackey enlightened us with:
> def __init__(self, folders = []):
> self.folders = folders
Read all about this very common mistake at
http://docs.python.org/tut/node6.html#SECTION00671
> def add_folder(self, folder):
> self.folders.append
another instance of that class...
structure2 = structure()
print
structure2.folders
This
now also returns: [('foo',)]
Even
though I haven’t added any folders to this new instance
What
am I doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list
e2 = structure()
print structure2.folders
This now also returns: [('foo',)]
Even though I haven't added any folders to this new instance
What am I doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list
In article news.t-online.com>,
"Diez B. Roggisch" web.de> wrote:
you confuse unicode with utf8. Expat can parse the latter - the former is
internal to python. And passing it to something that needs a string will
result in a conversion - which fails because of the ascii encoding.
Ahh... that make
In article <[EMAIL PROTECTED]>,
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > I started out working in the context of elementtidy, but now I am
> > running into trouble in general Python-XML areas, so I thought I'd toss
> > the question out here. The code below is fairly self-explanatory. I h
> I started out working in the context of elementtidy, but now I am
> running into trouble in general Python-XML areas, so I thought I'd toss
> the question out here. The code below is fairly self-explanatory. I have
> a small HTML snippet that is UTF-8 encoded and is not 7-bit ASCII
> compatible.
This is a followup to a blog post I wrote the other day
http://www.blueskyonmars.com/archives/2005/01/31/using_unicode_with_elementtidy.html
I started out working in the context of elementtidy, but now I am
running into trouble in general Python-XML areas, so I thought I'd toss
the question out h
86 matches
Mail list logo