I did not follow the grok bit..
He's creating a Descriptor within class 'Spam' by doing
@Profiled
def bar()
because Profiled replaces 'bar' with it's instance that contains __get__
which means I have to do s.grok = 20 to trigger it? Which would imply,
s.__get__(instance, instance, value) NOT wha
Greg Ewing於 2019年12月9日星期一 UTC+8上午6時18分32秒寫道:
> On 8/12/19 9:30 pm, songbird wrote:
> >wouldn't it make more sense to just go back and fix the
> > converter program than to have to manually convert all this
> > python2 code?
>
> Anything that isn't already fixed by 2to3 is probably
> somewhere
On 08/12/2019 22:06, Greg Ewing wrote:
On 9/12/19 7:47 am, RobH wrote:
I wanted it to work as is, like it did for the author, without
changing anything.
So why should I now start to learn how python works.
There are many, many reasons a piece of code could work in one
environment but not ano
On 9/12/19 6:28 am, R.Wieser wrote:
Are you sure there's a difference between classes and functions here?
Yes, quite sure.
And we're even more sure that there isn't. :-) Try it with
a test module containing a class definition, a function
definition and some top-level code that does somethin
It's a lot like the misuse of the word "theory".
You mean to say that in theory there is no difference between theory and
practice, but in practice there is?
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list
On 9/12/19 8:13 AM, b...@bbhoyer.com wrote:
Just registered
Thanks
Hi @bob, welcome to the gang...
I am a beginner in Python, been working on class material from Mosh
...
from email.mime.multipart import MIMEMultipart
...
Here is the error message:
Trace
On 2019-12-08 20:34, Michael Torrie wrote:
On 12/8/19 11:47 AM, RobH wrote:
Err, excuse me, I was not attempting to hack into someone else's code.
As the code is in the public domain, I wanted it to work as is, like it
did for the author, without changing anything.
No worries, you're totally
On 2019-12-08 19:13, b...@bbhoyer.com wrote:
Just registered
Thanks
Original Message
Subject: ModuleNotFoundError: No module named 'email.mime'; 'email' is
not a package
From: <[1]b...@bbhoyer.com>
Date: Sun, December 08, 2019 11:14 am
On 8/12/19 9:30 pm, songbird wrote:
wouldn't it make more sense to just go back and fix the
converter program than to have to manually convert all this
python2 code?
Anything that isn't already fixed by 2to3 is probably
somewhere between very difficult and impossible to fix
using an automate
On 9/12/19 7:46 am, Dennis Lee Bieber wrote:
Minecraftia appears to be a monospaced font meant to look like the
character set of old 8-bit gaming systems from the 80s.
From the name, it's probably mean to resemble the font in
Minecraft. As used in the game it's not actually monospaced,
On 9/12/19 7:47 am, RobH wrote:
I wanted it to work as is, like it
did for the author, without changing anything.
So why should I now start to learn how python works.
There are many, many reasons a piece of code could work in one
environment but not another. Figuring out why requires actual
u
On 9/12/19 7:29 AM, R.Wieser wrote:
...
Note that in all cases when you import a module (either by import the_file
or from the_file importe whatever) you actually import ALL of it
So much for my assumption only the class itself would be loaded - and a
wrench into my idea to have a number of cl
Just registered
Thanks
Original Message
Subject: ModuleNotFoundError: No module named 'email.mime'; 'email' is
not a package
From: <[1]b...@bbhoyer.com>
Date: Sun, December 08, 2019 11:14 am
To: [2]python-list@python.org
Hello Python Tea
On 12/8/2019 1:08 PM, alok singh wrote:
My system is windows 7 SP1 32-bit . after installing python in my
system,when i try to launch it using command prompt then a message is
shown. I am attaching a screenshot of the following.
Screenshots are not allowed. Copy and paste from CommandPrompt.
On 12/8/19 11:47 AM, RobH wrote:
> Err, excuse me, I was not attempting to hack into someone else's code.
> As the code is in the public domain, I wanted it to work as is, like it
> did for the author, without changing anything.
No worries, you're totally fine. The word "hack" means something
di
On 9/12/19 7:47 AM, RobH wrote:
On 08/12/2019 16:49, Dennis Lee Bieber wrote:
On Sun, 8 Dec 2019 09:44:54 +, RobH declaimed the
following:
def print_time():
current_time = time.strftime("%I:%M")
...
I don't know if that is the correct way as I am just using the code from
the proje
On 12/8/2019 1:29 PM, R.Wieser wrote:
from the_file import ClassName
from somemod import name
has the same effect as
import somemod
name = somemod.name
del somemod
which is to import a particular 'name' linked to a particular python
object into the namespace where the import is executed.
Dennis,
> Common practice is that the class is capitalized. Instances
>are lowercase.
Thanks.
Regards,
Rudy Wieser
--
https://mail.python.org/mailman/listinfo/python-list
Sir,
My system is windows 7 SP1 32-bit . after installing python in my
system,when i try to launch it using command prompt then a message is
shown. I am attaching a screenshot of the following.
kindly look seriously into my problem and tell me the solution..
thank you
--
https://mail.python.org/
On 08/12/2019 16:49, Dennis Lee Bieber wrote:
On Sun, 8 Dec 2019 09:44:54 +, RobH declaimed the
following:
def print_time():
current_time = time.strftime("%I:%M")
returns nothing.
So what did you expect it to do?
All that does is define a function (binding the
Peter,
>> "from file import function" works, but fails when I try to do the same
>> with a class.
>
> Are you sure? It should behave the same for any name in the module.
I am.
At least, that is what the error said: "cannot import 'classname' from
'filename' "
But as it turns out the problem is
Python,
> from the_file import ClassName
>
> should work. I guess that your class name is not "class" right?
You guessed that right. :-) Not a good idea to pick confusing names like
that, especially when you do something the first time.
> Note that in all cases when you import a module (either
Chris,
> Are you sure there's a difference between classes and functions here?
Yes, quite sure.
If not my attempt to load a class he same way as a function would have
worked. Which it doesn't.
> Try "from file import function" and see if it runs commands at
> the root of the file.
What funct
Chris Angelico wrote:
> On Sun, Dec 8, 2019 at 7:36 PM songbird wrote:
>> this would be a heck of a lot of fun.
>
> Then go ahead and do it.
i know you're just being flip here and that's fine
with me. that said, i'd love to! how big is PyPI?
(huge) will it fit on an SSD? (no) my local m
R.Wieser wrote:
> Hello all,
>
> Using Python3 I would like to import a specific class from another file
> (in the same folder), and have trouble doing so.
>
> "from file import function" works, but fails when I try to do the same
> with a class.
Are you sure? It should behave the same for any
R.Wieser wrote:
Hello all,
Using Python3 I would like to import a specific class from another file (in
the same folder), and have trouble doing so.
"from file import function" works, but fails when I try to do the same with
a class.
"import file
x = file.class"
works, but also executes comman
On Mon, Dec 9, 2019 at 3:31 AM R.Wieser wrote:
>
> Hello all,
>
> Using Python3 I would like to import a specific class from another file (in
> the same folder), and have trouble doing so.
>
> "from file import function" works, but fails when I try to do the same with
> a class.
>
> "import file
>
On 12/08/2019 06:32 AM, Python wrote:
Well... Maybe it's time to admit, Rob, that programming is not
your thing.
Rob, my apologies. Whoever this person is, they are not "Python", and their
behavior will not be tolerated.
"Python", if you don't want to help then remain silent. If you don't
Hello all,
Using Python3 I would like to import a specific class from another file (in
the same folder), and have trouble doing so.
"from file import function" works, but fails when I try to do the same with
a class.
"import file
x = file.class"
works, but also executes commands that are in t
On 07/12/2019 17:48, RobH wrote:
> I am trying to do this project on a pi zero:
>
> http://frederickvandenbosch.be/?p=1365
>
> After overcoming a few errors, I now have the display working and the
> start of the code showing on the display, that being the time.
>
> It doesn't move on to the next
On 08/12/2019 14:26, Karsten Hilbert wrote:
Like this?
>>>print_time()
Traceback (most recent call last)
File "stdin>", line 1, in
File "stdin>", line 2, in print_time
File "stdin>", line 2, in print_time
File "stdin>", line 2, in print_time
[Previous line repeated 996 more times]
RecursionEr
On Mon, Dec 9, 2019 at 1:56 AM RobH wrote:
> Thanks, but I am only using the code which someone else has written, and
> apparently it works ok for them and others but not for me.
>
> I only came here to find out why, and that is why I posted the link to
> the code, which I thought would be helpful
On 08/12/2019 14:39, Chris Angelico wrote:
On Mon, Dec 9, 2019 at 1:36 AM Python wrote:
RobH wrote:
On 08/12/2019 13:06, Karsten Hilbert wrote:
In an interactive interpreter:
def print_time():
current_time = time.strftime("%I:%M")
What happens if you then do
print_time()
print_
On Mon, Dec 9, 2019 at 1:36 AM Python wrote:
>
> RobH wrote:
> > On 08/12/2019 13:06, Karsten Hilbert wrote:
> > In an interactive interpreter:
> >
> > def print_time():
> > current_time = time.strftime("%I:%M")
>
> What happens if you then do
>
> print_ti
RobH wrote:
On 08/12/2019 13:06, Karsten Hilbert wrote:
In an interactive interpreter:
def print_time():
current_time = time.strftime("%I:%M")
What happens if you then do
print_time()
print_time()
on it's own returns NameError: name 'print_time' is not defined
Notice the "then" ab
> Like this?
> >>>print_time()
> Traceback (most recent call last)
> File "stdin>", line 1, in
> File "stdin>", line 2, in print_time
> File "stdin>", line 2, in print_time
> File "stdin>", line 2, in print_time
> [Previous line repeated 996 more times]
> RecursionError: maximum recursion depth
On 08/12/2019 13:06, Karsten Hilbert wrote:
In an interactive interpreter:
def print_time():
current_time = time.strftime("%I:%M")
What happens if you then do
print_time()
print_time()
on it's own returns NameError: name 'print_time' is not defined
Notice the "then" above ?
Mo
On 2019-12-07 11:59:31 -0800, Bill Campbell wrote:
> On Sat, Dec 07, 2019, Peter J. Holzer wrote:
> >As an aside, to prevent vim from inserting tabs in the first place, set
> >expandtab
> >sw=4
> >and maybe also
> >ts=4
>
> Inserting a comment in the file like this makes thing easy.
>
> >> In an interactive interpreter:
> >>
> >> def print_time():
> >> current_time = time.strftime("%I:%M")
> >
> > What happens if you then do
> >
> > print_time()
> >
>
> print_time()
> on it's own returns NameError: name 'print_time' is not defined
Notice the "then" above ?
More precisely:
On 08/12/2019 10:39, Karsten Hilbert wrote:
In an interactive interpreter:
def print_time():
current_time = time.strftime("%I:%M")
returns nothing.
That should be correct.
What happens if you then do
print_time()
inside the interpreter ?
Karsten
print_time()
on it's own return
> In an interactive interpreter:
>
> def print_time():
> current_time = time.strftime("%I:%M")
>
> returns nothing.
That should be correct.
What happens if you then do
print_time()
inside the interpreter ?
Karsten
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Dec 8, 2019 at 7:36 PM songbird wrote:
> this would be a heck of a lot of fun.
Then go ahead and do it.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 08/12/2019 04:37, Dennis Lee Bieber wrote:
On Sat, 7 Dec 2019 20:38:20 +, RobH declaimed the
following:
What program has or is an interactive interpreter, if it's not Thonny
Thonny is an IDE... It might expose access to the Python interpreter
(I've only loaded it once -- I t
On 08/12/2019 08:18, Karsten Hilbert wrote:
Sorry, I should have said just the line, and it didn't return anything.
OK, a bit strange, but then that might be due to Thonny.
Is Thonny an interpreter then.
It sort of is, or at least it runs one. We'd like to take
that out of the equation. I m
On 8/12/19 9:18 PM, Karsten Hilbert wrote:
Sorry, I should have said just the line, and it didn't return anything.
OK, a bit strange, but then that might be due to Thonny.
Is Thonny an interpreter then.
It sort of is, or at least it runs one. We'd like to take
that out of the equation. I me
wouldn't it make more sense to just go back and fix the
converter program than to have to manually convert all this
python2 code?
how many small test bits of code from PyPI could be
used as templates for patterns to search for that can then
be automatically converted and the test rerun? thous
> Sorry, I should have said just the line, and it didn't return anything.
OK, a bit strange, but then that might be due to Thonny.
> Is Thonny an interpreter then.
It sort of is, or at least it runs one. We'd like to take
that out of the equation. I meant to run *just* an interpreter, namely,
th
47 matches
Mail list logo