Re: line_profiler: what am I doing wrong?

2015-02-16 Thread Ethan Furman
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. -- ~

Re: line_profiler: what am I doing wrong?

2015-02-16 Thread Neal Becker
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

Re: line_profiler: what am I doing wrong?

2015-02-16 Thread Robert Kern
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,

Re: line_profiler: what am I doing wrong?

2015-02-13 Thread Neal Becker
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

Re: line_profiler: what am I doing wrong?

2015-02-13 Thread Neal Becker
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

Re: line_profiler: what am I doing wrong?

2015-02-11 Thread Steven D'Aprano
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

Re: line_profiler: what am I doing wrong?

2015-02-11 Thread Robert Kern
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 ...

Re: line_profiler: what am I doing wrong?

2015-02-11 Thread Robert Kern
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

Re: line_profiler: what am I doing wrong?

2015-02-10 Thread Steven D'Aprano
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

Re: line_profiler: what am I doing wrong?

2015-02-10 Thread Neal Becker
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

Re: line_profiler: what am I doing wrong?

2015-02-10 Thread Steven D'Aprano
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

Re: line_profiler: what am I doing wrong?

2015-02-10 Thread Neal Becker
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

Re: line_profiler: what am I doing wrong?

2015-02-10 Thread Ethan Furman
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 --

line_profiler: what am I doing wrong?

2015-02-10 Thread Neal Becker
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.

Re: pycrypto: what am I doing wrong?

2013-10-24 Thread Chris Angelico
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,

Re: pycrypto: what am I doing wrong?

2013-10-24 Thread Johannes Bauer
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

Re: pycrypto: what am I doing wrong?

2013-10-24 Thread Johannes Bauer
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

Re: pycrypto: what am I doing wrong?

2013-10-24 Thread Johannes Bauer
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'

Re: pycrypto: what am I doing wrong?

2013-10-24 Thread Chris Angelico
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

pycrypto: what am I doing wrong?

2013-10-23 Thread Paul Pittlerson
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

Re: What am I doing wrong in this simple tkinter example?

2013-03-19 Thread Neil Cerutti
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

Re: What am I doing wrong in this simple tkinter example?

2013-03-18 Thread Chris Angelico
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

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Mitya Sirenef
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?

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
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

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Christian Gollwitzer
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

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Chris Angelico
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

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
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

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
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 > &

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Mitya Sirenef
/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'

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Chris Angelico
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

What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
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

Re: What am I doing wrong installing Python 2.7.3?

2013-02-21 Thread Michael Herman
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

Re: What am I doing wrong installing Python 2.7.3?

2013-02-21 Thread Tim Golden
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

What am I doing wrong installing Python 2.7.3?

2013-02-21 Thread Etherus
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.

Re: multiprocessing, what am I doing wrong?

2012-02-28 Thread MRAB
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

Re: multiprocessing, what am I doing wrong?

2012-02-28 Thread Eric Frederich
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/

Re: multiprocessing, what am I doing wrong?

2012-02-27 Thread MRAB
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

Re: multiprocessing, what am I doing wrong?

2012-02-27 Thread Eric Frederich
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

Re: multiprocessing, what am I doing wrong?

2012-02-24 Thread MRAB
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

Re: multiprocessing, what am I doing wrong?

2012-02-24 Thread Eric Frederich
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

Re: multiprocessing, what am I doing wrong?

2012-02-23 Thread MRAB
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

multiprocessing, what am I doing wrong?

2012-02-23 Thread Eric Frederich
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. ###

Re: PyGTK, Glade/libglade. What am I doing wrong?

2011-05-07 Thread Alister Ware
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: >>

Re: PyGTK, Glade/libglade. What am I doing wrong?

2011-05-06 Thread Даниил Рыжков
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):

Re: PyGTK, Glade/libglade. What am I doing wrong?

2011-05-06 Thread craf
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&

Re: PyGTK, Glade/libglade. What am I doing wrong?

2011-05-06 Thread Даниил Рыжков
> 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

Re: PyGTK, Glade/libglade. What am I doing wrong?

2011-05-06 Thread Benjamin Kaplan
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

PyGTK, Glade/libglade. What am I doing wrong?

2011-05-06 Thread Даниил Рыжков
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

Re: What am I doing wrong with SWIG in OS X Snow Leopard?

2009-10-22 Thread Aahz
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

What am I doing wrong with SWIG in OS X Snow Leopard?

2009-10-20 Thread Zectbumo
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

Re: Why does extend() fail in this case, and what am I doing wrong?

2009-07-14 Thread Xavier Ho
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,

Re: Why does extend() fail in this case, and what am I doing wrong?

2009-07-14 Thread Jochen Schulz
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

Re: Why does extend() fail in this case, and what am I doing wrong?

2009-07-14 Thread MRAB
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

Re: Why does extend() fail in this case, and what am I doing wrong?

2009-07-14 Thread Pablo Torres N.
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 does extend() fail in this case, and what am I doing wrong?

2009-07-14 Thread Xavier Ho
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

Re: Class Inheritance - What am I doing wrong?

2008-04-25 Thread Brian Munroe
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

Re: Class Inheritance - What am I doing wrong?

2008-04-25 Thread Bruno Desthuilliers
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

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
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,

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Gabriel Genellina
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

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Brian Munroe
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

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Gary Herron
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(

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
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

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
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)._

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Virgil Dupras
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): >

Class Inheritance - What am I doing wrong?

2008-04-24 Thread Brian Munroe
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):

Re: urllib2 Basic authentication, what am I doing wrong?

2008-04-13 Thread Michel Bouwmans
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 > >

Re: urllib2 Basic authentication, what am I doing wrong?

2008-04-13 Thread 7stud
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

Re: urllib2 Basic authentication, what am I doing wrong?

2008-04-13 Thread Max Erickson
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

urllib2 Basic authentication, what am I doing wrong?

2008-04-13 Thread Michel Bouwmans
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

Re: What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
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

Re: What am I doing wrong here

2006-04-24 Thread Gary Herron
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

Re: What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
Thank you Robert, It worked!!! Thank you so much -- http://mail.python.org/mailman/listinfo/python-list

Re: What am I doing wrong here

2006-04-24 Thread Bruno Desthuilliers
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

Re: What am I doing wrong here

2006-04-24 Thread Robert Kern
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 >

Re: What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
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

What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
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

Re: What am I doing wrong?

2005-09-21 Thread Scott David Daniels
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 = []): >

Re: What am I doing wrong?

2005-09-21 Thread Larry Bates
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

Re: What am i doing Wrong?

2005-09-20 Thread Aldo Cortesi
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

Re: What am I doing wrong?

2005-09-20 Thread Sybren Stuvel
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

What am i doing Wrong?

2005-09-20 Thread keithlackey
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

What am I doing wrong?

2005-09-20 Thread keithlackey
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

Re: XML with Unicode: what am I doing wrong?

2005-02-02 Thread Kevin Dangoor
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

Re: XML with Unicode: what am I doing wrong?

2005-02-02 Thread Just
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

Re: XML with Unicode: what am I doing wrong?

2005-02-02 Thread Diez B. Roggisch
> 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.

XML with Unicode: what am I doing wrong?

2005-02-02 Thread Kevin Dangoor
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