On 29/05/24 06:49, Gilmeh Serda via Python-list wrote:
Solved by using a different method.
Hedonist for hire... no job too easy!
This combination of sig-file and content seems sadly ironic.
How about CONTRIBUTING to the community by explaining 'the solution' to
people who may find a simi
On Tue, May 28, 2024 at 9:48 PM Gilmeh Serda via Python-list <
python-list@python.org> wrote:
>
> Solved by using a different method.
>
>
- - - And that was how?
TIA
--
https://mail.python.org/mailman/listinfo/python-list
On 5/26/2024 2:28 AM, Gilmeh Serda via Python-list wrote:
The web claims (I think on all pages I've read about Markdown and Python)
that this code should work, with some very minor variants on the topic:
```python
import os
with open(os.path.join('/home/user/apath', 'somefile')) as f:
pri
With reference to another reply here, the "Weird stuff" came from
reading the question, finding it unclear, and only later realising that
whereas most people write Markdown-formatted documents for later
processing, or perhaps docstrings in Markdown-format for collection by
documentation systems
On 2024-05-26, Gilmeh Serda via Python-list wrote:
> The web claims (I think on all pages I've read about Markdown and Python)
> that this code should work, with some very minor variants on the topic:
>
> ```python
>
> import os
>
> with open(os.path.join('/home/user/apath', 'somefile')) as f:
>
> On 14 Mar 2022, at 21:29, Dan Stromberg wrote:
>
> I expected to see an exec of /usr/bin/python2, but I don't. I just see an
> exec of /tmp/t.
I understand that the kernel handles the #! Line itself, which is why you do
not see it in strace.
Barry
--
https://mail.python.org/mailman/l
On Tue, 15 Mar 2022 at 08:28, Dan Stromberg wrote:
>
> Hi folks.
>
> First off, I know, python2 is ancient history. Porting to 3.x is on my
> list of things to do (though I'm afraid it's not yet at the top of the
> list), and the same thing happens with python3.
>
> So anyway, I'm strace'ing a #!
On 10/13/2020 4:51 AM, Steve wrote:
Why does IDLE always open with the lowest three lines of the window end up
hidden below the bottom of the screen behind the task bar? Every time I use
it, I have to stop and grab the top of the window and drag it up to see the
line and row information. I expl
On 2019-09-13 20:17, CrazyVideoGamez wrote:
For some reason, if you put in the code
def odd_ones_out(numbers):
for num in numbers:
count = numbers.count(num)
if not count % 2 == 0:
for i in range(count):
numbers.remove(num)
return numbers
2 comments:
First: Deleting from a list while you're iterating over it is a bad idea. Your
first iteration gives nums[0] which is 72. But then you delete that and (in
effect) everything moves up. So now the 4 is in the nums[0] slot. Your second
iteration returns nums[1] which is now the 82 mean
Steven D'Aprano wrote:
> Python function default values use *early binding*: the default parameter
> is evaluated, ONCE, when the function is defined, and that value is used
> each time it is needed.
Thanks, "early binding" was the clue I was missing.
robert
--
https://mail.python.org/mailman/
On Thu, 03 May 2018 19:47:37 +, Robert Latest via Python-list wrote:
> Hello,
>
> I don't understand the behavior of the code below. Why does the dict
> property "a" of both objects contain the same keys? This is only if
> "a=dict" is in the initializer. If I put self.a = dict() into the init
This is a well known feature of Python. It's a very common "gotcha" to
new Python programmers.
Google "Mutable default parameters in Python" for long list of
explanations and fixes.
In short, don't use a mutable object as a default parameter.
Gary Herron
On 05/03/2018 12:47 PM, python-
On Fri, Feb 19, 2016 at 10:33 AM, Dan Stromberg wrote:
> On Thu, Feb 18, 2016 at 5:40 PM, Dan Stromberg wrote:
>
>>
>> BTW, this is not a package I pip installed from pypi - it's an
>> internal-only project.
>
> I need to correct this: It's not installed from pypi.python.org, but
> it probably is
On Thu, Feb 18, 2016 at 5:40 PM, Dan Stromberg wrote:
>
> BTW, this is not a package I pip installed from pypi - it's an
> internal-only project.
I need to correct this: It's not installed from pypi.python.org, but
it probably is installed from our internal pypi server.
Thanks!
--
https://mail
[root@nexus cgi-bin]# head -10 ./metrites.py
#!/usr/bin/python3
# coding=utf-8
import cgitb; cgitb.enable()
import cgi, re, os, sys, socket, time, datetime, locale, codecs, random,
smtplib, subprocess, pymysql, geoip2.database
from datetime import datetime, timedelta
from http import cookies
#
#!/usr/bin/python3
# coding=utf-8
import cgitb; cgitb.enable()
import cgi, re, os, sys, socket, time, datetime, locale, codecs, random,
smtplib, subprocess, pymysql, geoip2.database
from datetime import datetime, timedelta
from http import cookies
===
[root@nexus cgi-bin]# /usr/b
On Thu, Feb 18, 2016 at 12:47 AM, Jeremy Leonard wrote:
> On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος
> wrote:
>> Hello,
>>
>> I recentely changed VPS server and when i try to load my webiste iam
>> receiving 500 error which i wasnt receiving in my old VPS server wi
On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος wrote:
> Hello,
>
> I recentely changed VPS server and when i try to load my webiste iam
> receiving 500 error which i wasnt receiving in my old VPS server with the
> same exact cgi scripts.
>
> After looking at Apacher's
On Mon, Dec 14, 2015 at 7:31 AM, Erik wrote:
> On 13/12/15 20:28, Erik wrote:
>>
>> When you call "print", then the list class's __repr__() method is called
>> which in turn calls the contained objects' __repr__() methods in turn
>
>
> I mean the __str__() method, not __repr__() in this case - how
On 12/13/2015 12:05 PM, KP wrote:
On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote:
In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes:
Hi all,
f = open("stairs.bin", "rb")
data = list(f.read(16))
print data
returns
['=', '\x04', '\x00', '\x05', '\
On 13/12/15 20:28, Erik wrote:
When you call "print", then the list class's __repr__() method is called
which in turn calls the contained objects' __repr__() methods in turn
I mean the __str__() method, not __repr__() in this case - however, the
answer is otherwise the same.
E.
--
https://m
On Sun, Dec 13, 2015 at 1:05 PM, KP wrote:
> On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote:
>> In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes:
>> >Hi all,
>> >
>> > f = open("stairs.bin", "rb")
>> > data = list(f.read(16))
>> > print data
>> >
>> >re
On 13/12/15 20:05, KP wrote:
On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote:
In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes:
Hi all,
f = open("stairs.bin", "rb") data = list(f.read(16)) print data
returns
['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '
On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote:
> In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes:
> >Hi all,
> >
> > f = open("stairs.bin", "rb")
> > data = list(f.read(16))
> > print data
> >
> >returns
> >
> >['=', '\x04', '\x00', '\x05', '\x00', '\
On Sun, Dec 13, 2015 at 12:45 PM, wrote:
> Hi all,
>
> f = open("stairs.bin", "rb")
> data = list(f.read(16))
> print data
>
> returns
>
> ['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '\x00',
> '\x00', '\x00', '\x00', '\x00', '\x00', '\x00']
>
> The fir
In a message of Sun, 13 Dec 2015 11:45:19 -0800, high5stor...@gmail.com writes:
>Hi all,
>
> f = open("stairs.bin", "rb")
> data = list(f.read(16))
> print data
>
>returns
>
>['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '\x00',
>'\x00', '\x00', '\x00', '\x0
Shiyao Ma wrote:
> Hi.
>
> My context is a little hard to reproduce.
>
> NS3 is a network simulation tool written in C++. I am using its Python
> binding.
>
> So the class I am dealing with is from a .so file.
So it is written in (probably) C and you don't have source code for it.
> Say, I do
On 02/09/2015 09:52 PM, Shiyao Ma wrote:
Hi.
My context is a little hard to reproduce.
WHY don't you try? Telling us about a class without showing how it's
defined leaves us all guessing.
Start by telling us Python version. And if it's 2.x, tell us whether
this class is an old style or n
It’s a special HTTPS url and searching further it seems to be a SNI problem
talked about here:
http://stackoverflow.com/questions/18578439/using-requests-with-tls-doesnt-give-sni-support
> 25 okt 2014 kl. 08:48 skrev Joel Goldstick :
>
> On Sat, Oct 25, 2014 at 9:40 AM, Roland Hedberg wrote:
>
On Sat, Oct 25, 2014 at 9:40 AM, Roland Hedberg wrote:
> When I try to access a URL using requests I always get:
> socket.error: [Errno 104] Connection reset by peer
>
> If I try to access the same URL using curl I get no error message instead I
> get the page.
> The same result if I use a web br
Oh, by the way!
To make this more interesting :-/
I saw this behavior on a Linux machine (Ubuntu 14.04 LTS) using Python 2.7.6 if
I do the same exercise
on a Mac OS X machine also with Python 2.7.6 - no problem what so ever.
> 25 okt 2014 kl. 08:40 skrev Roland Hedberg :
>
> When I try to acce
30 sep 2014 kl. 00:55 skrev Ned Deily :
> In article ,
> Roland Hedberg wrote:
>
>> Hi!
>>
>> I¹m trying to access
>> https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration
>>
>> Doing it the simplest way I get the following:
>>
> import urllib
> f =
> urllib.
In article ,
Roland Hedberg wrote:
> Hi!
>
> I¹m trying to access
> https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration
>
> Doing it the simplest way I get the following:
>
> >>> import urllib
> >>> f =
> >>> urllib.urlopen("https://stsadweb.one.microsoft.com/adfs/.well
On 2013-10-18, James Harris wrote:
> "Roy Smith" wrote in message
> news:l3riea$82$1...@panix2.panix.com...
>> I'm running:
>>
>> Ubuntu Precise
>> Python 2.7.3
>> django 1.4.5
>> gunicorn 0.17.4
>> gevent 1.0dev (rc3)
>>
>> I haven't been able to pin this down exactly, but it looks like if I
>>
On Friday, October 18, 2013 1:04:38 PM UTC-4, James Harris wrote:
> Those are two different things. You would normally use connect() on a
> SOCK_STREAM socket. It requires that the remote endpoint, in this case
> localhost:9700, has an open socket listening for connections. sendto() is
> the rig
"Roy Smith" wrote in message
news:l3riea$82$1...@panix2.panix.com...
> I'm running:
>
> Ubuntu Precise
> Python 2.7.3
> django 1.4.5
> gunicorn 0.17.4
> gevent 1.0dev (rc3)
>
> I haven't been able to pin this down exactly, but it looks like if I
> do (inside of a custom logging.Handler subclass):
Peter Otten <__pete...@web.de> writes:
> Dave Angel wrote:
>
>> On 28/9/2013 02:26, Daniel Stojanov wrote:
>>
>>> Can somebody explain this. The line number reported by shlex depends
>>> on the previous token. I want to be able to tell if I have just popped
>>> the last token on a line.
[...]
> T
Dave Angel wrote:
> On 28/9/2013 02:26, Daniel Stojanov wrote:
>
>> Can somebody explain this. The line number reported by shlex depends
>> on the previous token. I want to be able to tell if I have just popped
>> the last token on a line.
>>
>
> I agree that it seems weird. However, I don't th
On 28/9/2013 02:26, Daniel Stojanov wrote:
> Can somebody explain this. The line number reported by shlex depends
> on the previous token. I want to be able to tell if I have just popped
> the last token on a line.
>
I agree that it seems weird. However, I don't think you have made
clear why it'
On 28.09.2013 08:26, Daniel Stojanov wrote:
Can somebody explain this. The line number reported by shlex depends
on the previous token. I want to be able to tell if I have just popped
the last token on a line.
[SNIP]
second = shlex.shlex("word1 word2,\nword3")
Punctuation characters like th
On Wed, Sep 18, 2013 at 2:11 AM, Rotwang wrote:
> I don't know tkinter well enough either, but the fact that it behaves
> differently on Linux and Windows suggests to me that at least one version is
> bugging out. Do you think this is worth raising on bugs.python.org?
Possibly, but I'd keep it he
On 17/09/2013 15:35, Chris Angelico wrote:
On Wed, Sep 18, 2013 at 12:25 AM, Rotwang wrote:
In fact, if I replace tkderp with this:
# begin tkderp.py
import tkinter as tk
_root = tk.Tk()
_root.withdraw()
# end tkderp.py
then simply importing tkderp before tkderp2 is enough to make the la
On Wed, Sep 18, 2013 at 12:25 AM, Rotwang wrote:
> In fact, if I replace tkderp with this:
>
>
> # begin tkderp.py
>
> import tkinter as tk
>
> _root = tk.Tk()
> _root.withdraw()
>
> # end tkderp.py
>
>
> then simply importing tkderp before tkderp2 is enough to make the latter
> work properly
Nic
On 17/09/2013 12:32, Chris Angelico wrote:
[...]
If reloading and doing it again makes things different, what happens
if you simply trigger your code twice without reloading?
I've no idea if it'll help, it just seems like an attack vector on the
problem, so to speak.
Thanks for the suggestion
On Tue, Sep 17, 2013 at 9:27 PM, Rotwang wrote:
> On 16/09/2013 23:34, Chris Angelico wrote:
>>
>> On Tue, Sep 17, 2013 at 2:28 AM, Rotwang wrote:
>>>
>>> If I then uncomment those two lines, reload the module and call f() again
>>> (by entering tkderp.reload(tkderp).f()), the function works like
On 16/09/2013 23:34, Chris Angelico wrote:
On Tue, Sep 17, 2013 at 2:28 AM, Rotwang wrote:
If I then uncomment those two lines, reload the module and call f() again
(by entering tkderp.reload(tkderp).f()), the function works like it was
supposed to in the first place: two warnings, no exception
On 16/09/2013 19:43, Serhiy Storchaka wrote:
16.09.13 19:28, Rotwang написав(ла):
On Windows 7 (sys.version is '3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012,
10:57:17) [MSC v.1600 64 bit (AMD64)]') there's no problem; f() works
fine in the first place. Does anybody know what's going on?
What _root.
On Tue, Sep 17, 2013 at 2:28 AM, Rotwang wrote:
> If I then uncomment those two lines, reload the module and call f() again
> (by entering tkderp.reload(tkderp).f()), the function works like it was
> supposed to in the first place: two warnings, no exceptions. I can reload
> the module as many tim
16.09.13 19:28, Rotwang написав(ла):
On Windows 7 (sys.version is '3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012,
10:57:17) [MSC v.1600 64 bit (AMD64)]') there's no problem; f() works
fine in the first place. Does anybody know what's going on?
What _root.wantobjects() returns?
--
https://mail.pytho
On Jun 18, 8:31 pm, zoom wrote:
>
> yes, that's the hing.
>
> thanks a lot
>
> FYI this happens because
> >>> shape(mean(m,1))
> (4, 1)
> >>> shape(mean(array(m),1))
> (4,)
>
> thanks again
And thank you for the 'Thank you' !!
Given the noob-questions the list is currently dealing with, your
q
On 06/18/2013 05:25 PM, Robert Kern wrote:
On 2013-06-18 15:23, zoom wrote:
Hi, I have a strange problem here. Perhaps someone would care to help me.
In the file test.py I have the following code:
from scipy import matrix, tile, mean, shape
import unittest
class TestSequenceFunctions(unittest
On 06/18/2013 04:27 PM, rusi wrote:
On Jun 18, 7:23 pm, zoom wrote:
Hi, I have a strange problem here. Perhaps someone would care to help me.
In the file test.py I have the following code:
from scipy import matrix, tile, mean, shape
import unittest
class TestSequenceFunctions(unittest.TestCa
On 2013-06-18 15:23, zoom wrote:
Hi, I have a strange problem here. Perhaps someone would care to help me.
In the file test.py I have the following code:
from scipy import matrix, tile, mean, shape
import unittest
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
Note that
print [shape(m)[1],1]
just prints a list with two elements where the first element is shape(m)[1]
and the second is the number 1 (regardless of the value of m). I'm pretty
sure that's not what you want.
2013/6/18 zoom
> Hi, I have a strange problem here. Perhaps someone would care t
On Jun 18, 7:23 pm, zoom wrote:
> Hi, I have a strange problem here. Perhaps someone would care to help me.
>
> In the file test.py I have the following code:
>
> from scipy import matrix, tile, mean, shape
> import unittest
>
> class TestSequenceFunctions(unittest.TestCase):
>
> def setUp(se
On Apr 26, 11:25 am, rusi wrote:
> To present these kind of errors, Erlang has a concept of sticky
> modules -- those that come from the system…
??present?? should have been 'prevent'
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 26, 11:04 am, Tim Roberts wrote:
> Forafo San wrote:
>
> >OK, lesson learned: Take care not to have module names that conflict with
> >python's built ins. Sorry for being so obtuse.
>
> You don't have to apologize. We've all been bitten by this at least once.
Yes…
When it comes to keywo
Forafo San wrote:
>
>OK, lesson learned: Take care not to have module names that conflict with
>python's built ins. Sorry for being so obtuse.
You don't have to apologize. We've all been bitten by this at least once.
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
--
http://mail
On Wednesday, April 24, 2013 3:08:27 PM UTC-4, Neil Cerutti wrote:
> On 2013-04-24, Forafo San wrote:
>
> > Hello All,
>
> > I'm running Python version 2.7.3_6 on a FreeBSD system. The following
> > session in a Python interpreter throws a mysterious TypeError:
>
> >
>
> > ---
On 2013-04-24, Forafo San wrote:
> Hello All,
> I'm running Python version 2.7.3_6 on a FreeBSD system. The following session
> in a Python interpreter throws a mysterious TypeError:
>
> --
> [ppvora@snowfall ~/xbrl]$ python
> Python 2.7.3 (default, Apr 22
On Mon, 22 Apr 2013 07:29:57 -0700, nn wrote:
> On Apr 21, 9:19 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> On Mon, 22 Apr 2013 10:56:11 +1000, Chris Angelico wrote:
>> > You're running this under Windows. The convention on Windows is for
>> > end-of-line to be signalled with \
On Tue, Apr 23, 2013 at 9:06 AM, wrote:
> On Tuesday, April 23, 2013 12:29:57 AM UTC+10, nn wrote:
>
>> Maybe it is related to this bug?
>>
>> http://bugs.python.org/issue11272
>
> I'm running Python 2.7.2 (on Windows) and that version doesn't appear to have
> that bug:
>
> Python 2.7.2 (defau
On Tuesday, April 23, 2013 12:29:57 AM UTC+10, nn wrote:
> Maybe it is related to this bug?
>
> http://bugs.python.org/issue11272
I'm running Python 2.7.2 (on Windows) and that version doesn't appear to have
that bug:
Python 2.7.2 (default, Apr 23 2013, 11:49:52) [MSC v.1500 32 bit (Intel)]
On Apr 21, 9:19 pm, Steven D'Aprano wrote:
> On Mon, 22 Apr 2013 10:56:11 +1000, Chris Angelico wrote:
> > You're running this under Windows. The convention on Windows is for
> > end-of-line to be signalled with \r\n, but the convention inside Python
> > is to use just \n. With the normal use of b
On Monday, April 22, 2013 11:05:11 AM UTC+10, Steven D'Aprano wrote:
> I cannot confirm that behaviour. It works fine for me.
As Chris pointed out there is a \r character at the end of the string and that
is causing the if to fail.
I can now see the \r :)
So this is *Windows only* behaviour.
On Mon, 22 Apr 2013 10:56:11 +1000, Chris Angelico wrote:
> You're running this under Windows. The convention on Windows is for
> end-of-line to be signalled with \r\n, but the convention inside Python
> is to use just \n. With the normal use of buffered and parsed input,
> this is all handled for
On Mon, Apr 22, 2013 at 11:05 AM, Steven D'Aprano
wrote:
> I cannot confirm that behaviour. It works fine for me.
I should mention: Under Linux, there's no \r, so -u or no -u, the
program will work fine.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
On Monday, April 22, 2013 10:56:11 AM UTC+10, Chris Angelico wrote:
> so your string actually contains '120\r', as will be revealed
> by its repr().
Thanks Chris. That makes sense.
Cheers Jussi
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 21 Apr 2013 17:37:18 -0700, jussij wrote:
> Can someone please explain the following behaviour?
>
> I downloaded and compiled the Python 2.7.2 code base.
>
> I then created this simple c:\temp\test.py macro:
>
> import sys
>
> def main():
> print("Please Input 120:
On Mon, Apr 22, 2013 at 10:37 AM, wrote:
> Can someone please explain the following behaviour?
>
> If I run the macro using the -u (flush buffers) option the if statement
> always fails:
>
> C:\Temp>python.exe -u c:\temp\test.py
> Please Input 120:
> 120
> Value Inputed: 120
>
On Mon, Dec 3, 2012 at 6:30 PM, Steven D'Aprano
wrote:
> Yeah, in hindsight it was a pretty crappy example. But this sort of
> dynamism really is useful:
>
> def testRaises(exc, func, *args):
> try:
> result = func(*args)
> except exc:
> return
> raise AssertionError("e
On Mon, 03 Dec 2012 16:24:50 +1100, Chris Angelico wrote:
> On Mon, Dec 3, 2012 at 8:31 AM, Steven D'Aprano
> wrote:
>> Consider this piece of legal Python code:
>>
>> Err = None
>> if condition(x) > 100:
>> Err = OneException
>> elif another_condition(x):
>> Err = AnotherException
>> try
On Mon, Dec 3, 2012 at 8:31 AM, Steven D'Aprano
wrote:
> Consider this piece of legal Python code:
>
> Err = None
> if condition(x) > 100:
> Err = OneException
> elif another_condition(x):
> Err = AnotherException
> try:
> spam(a, b, c)
> except Err:
> recover()
Legal it may be, b
On Sun, 02 Dec 2012 12:25:22 -0500, Roy Smith wrote:
> This is kind of weird (Python 2.7.3):
>
> try:
> print "hello"
> except foo:
> print "foo"
>
> prints "hello". The problem (IMHO) is that apparently the except clause
> doesn't get evaluated until after some exception is caught. Wh
On 12/2/2012 12:25 PM, Roy Smith wrote:
This is kind of weird (Python 2.7.3):
try:
print "hello"
except foo:
print "foo"
prints "hello". The problem (IMHO) is that apparently the except clause
doesn't get evaluated until after some exception is caught. Which means
it never notices t
On 2/12/12 18:25:22, Roy Smith wrote:
> This is kind of weird (Python 2.7.3):
>
> try:
> print "hello"
> except foo:
> print "foo"
>
> prints "hello". The problem (IMHO) is that apparently the except clause
> doesn't get evaluated until after some exception is caught. Which means
> it
In article <50b78e26$0$6945$e4fe5...@news2.news.xs4all.nl>,
Hans Mulder wrote:
> That is baffling indeed. It looks like nose is adding some
> directory to sys.path, which contains a module pyza.py instead
> of a package.
We finally figured it out. As it turns out, that's pretty close.
> Anot
On 11/29/2012 9:59 AM, lars van gemerden wrote:
Hi,
I have encountered some strange behavior of isinstance(/issubclass): depending
on the import path used for classes i get different output, while the classes i
compare are in the same file.
Basically if i import a class as:
from mod1.mo
On Thu, Nov 29, 2012 at 9:07 AM, lars van gemerden wrote:
> > PS: this is somewhat simpler than the actual case i've encountered, and
> i haven't tested this exact case, but for now i hope this is enough to get
> some of your insight.
>
> I know for sure that the imports both import the same file,
On 29/11/12 04:13:57, Roy Smith wrote:
> I've got a minimal test script:
>
> -
> $ cat test_foo.py
> import pyza.models
> print pyza.models
>
> def test_foo():
> pass
> -
>
> pyza.models is a package. Under normal conditions, I can imp
On Thursday, November 29, 2012 3:59:37 PM UTC+1, lars van gemerden wrote:
> Hi,
>
>
>
> I have encountered some strange behavior of isinstance(/issubclass):
> depending on the import path used for classes i get different output, while
> the classes i compare are in the same file.
>
>
>
> B
On Fri, Nov 30, 2012 at 1:59 AM, lars van gemerden wrote:
> Basically if i import a class as:
>
> from mod1.mod2 import A
>
> or:
>
> from mod0.mod1.mod2 import A
>
> which both result in importing the same class, a call to isinstance(inst, A)
> in another module can have a different outp
Mik wrote:
Oh thanks alex!
that's kind!
PS: It looks like a party indeed: plenty of interesting
discussions :-)
On Mar 30, 4:33 am, alex23 wrote:
On Mar 29, 10:41 pm, Mik wrote:
What a nice way to introduce myself to the group!!! :-)
Hey, don't beat yourself up, you:
- su
On Thu, Mar 29, 2012 at 11:41 PM, Mik wrote:
>
> I can't believe I am so dumb!
>
> after sound.play() the script was terminating
> I didn't notice that 'play()' actually returns...
>
> What a nice way to introduce myself to the group!!! :-)
>
> sorry for bothering you guys :-)
You've just pro
On Mar 30, 8:33 am, alex23 wrote:
> On Mar 29, 10:41 pm, Mik wrote:
>
> > What a nice way to introduce myself to the group!!! :-)
>
> Hey, don't beat yourself up, you:
>
> - summarised the problem in the subject heading
> - included actual code showing the problem
> - reported back on the prob
Oh thanks alex!
that's kind!
PS: It looks like a party indeed: plenty of interesting
discussions :-)
On Mar 30, 4:33 am, alex23 wrote:
> On Mar 29, 10:41 pm, Mik wrote:
>
> > What a nice way to introduce myself to the group!!! :-)
>
> Hey, don't beat yourself up, you:
>
> - summarised the prob
On Mar 29, 10:41 pm, Mik wrote:
> What a nice way to introduce myself to the group!!! :-)
Hey, don't beat yourself up, you:
- summarised the problem in the subject heading
- included actual code showing the problem
- reported back on the problem you found
That puts you ahead of most new post
I can't believe I am so dumb!
after sound.play() the script was terminating
I didn't notice that 'play()' actually returns...
What a nice way to introduce myself to the group!!! :-)
sorry for bothering you guys :-)
--
http://mail.python.org/mailman/listinfo/python-list
The issue was a version mismatch. When installing python on windows,
it installs a shortcut so when you right click, you can edit things in
IDLE. I had installed python 3 after installing 2.7, so it apparently
changed the extension.
As for not showing tracebacks, I couldn't. When I ran the program
On Jan 26, 4:05 pm, Matty Sarro wrote:
> Here's my code:
>
> from sys import argv
> script,filename=argv
> txt=open(filename)
> print "Here is your file %r:" % filename
> print txt.read()
> print "I'll also ask you to type it again:"
> file_again=raw_input("> ")
> txt_again=open(file_again)
> pri
In Matty Sarro
writes:
> Hey everyone. I'm running into a funky error as I work through "Learn
> Python the Hard Way." What's weird is both idle and the python
> interpreter in idle spit out an error about syntax, but when I run the
> same script from the command line it works just fine, with n
Matty Sarro wrote:
from sys import argv
script,filename=argv
txt=open(filename)
print "Here is your file %r:" % filename
print txt.read()
print "I'll also ask you to type it again:"
file_again=raw_input("> ")
txt_again=open(file_again)
print txt_again.read()
IDLE is saying that my error is on li
On Thu, 26 Jan 2012 17:05:57 -0500, Matty Sarro wrote:
> Hey everyone. I'm running into a funky error as I work through "Learn
> Python the Hard Way." What's weird is both idle and the python
> interpreter in idle spit out an error about syntax, but when I run the
> same script from the command li
On 01/26/2012 10:05 PM, Matty Sarro wrote:
Hey everyone. I'm running into a funky error as I work through "Learn
Python the Hard Way." What's weird is both idle and the python
interpreter in idle spit out an error about syntax, but when I run the
same script from the command line it works just fi
On 20 January 2012 20:47, Yigit Turgut wrote:
> Hi,
>
> In the following code, I am trying to run "black" screen for 3 seconds
> and respectively 2 seconds "white" screen. Black routine takes 3
> seconds and white 2 seconds, 2 x black + white = 8 seconds which
> should be the expected value but wh
On 1/20/2012 12:47 PM Yigit Turgut said...
Hi,
In the following code, I am trying to run "black" screen for 3 seconds
and respectively 2 seconds "white" screen. Black routine takes 3
seconds and white 2 seconds, 2 x black + white = 8 seconds which
should be the expected value but when I run it I
On 20/01/2012 20:47, Yigit Turgut wrote:
Hi,
In the following code, I am trying to run "black" screen for 3 seconds
and respectively 2 seconds "white" screen. Black routine takes 3
seconds and white 2 seconds, 2 x black + white = 8 seconds which
should be the expected value but when I run it I g
Adam Jorgensen wrote:
> Thanks :-) Sorry about the size, I wasn't sure what was relevant...
We prefer that you don't top-post here, because it makes it hard to see
context when people reply.
In general, people asking questions should always try to reduce the problem
to the simplest code that wil
Thanks :-) Sorry about the size, I wasn't sure what was relevant...
On 24 August 2011 15:29, Peter Otten <__pete...@web.de> wrote:
> Adam Jorgensen wrote:
>
>> Hi all, I'm experiencing a weird issue with closuring of parameters
>> and some nested functions I have inside two functions that
>> retur
1 - 100 of 312 matches
Mail list logo