Hello,
I have done mistake while trying to increment int
i=1
i=+
this left i unchangeable and I got no error. But what =+ means at all?
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
What is difference between string definitions:
s="aaa"
and
s='bbb'
--
https://mail.python.org/mailman/listinfo/python-list
Hello
I found several class creation samples:
class ExampleClass1:
class ExampleClass2(object):
What is difference between them? Who is the father of ExampleClass1 ?
--
https://mail.python.org/mailman/listinfo/python-list
On Thursday, 7 September 2017 14:35:58 UTC+3, eryk sun wrote:
> On Thu, Sep 7, 2017 at 1:39 AM, Andrej Viktorovich
> wrote:
> >
> > I have 64 bit python on my windows 10 machine. Install contains 32 bit
> > python libs in path
> > and I would like to remove th
Hello
For my understanding both - __init__() and __new__() works like constructors.
And __new__() looks is closer to constructor. __init__() is more for variable
initialization. Why I can't just initialize in __init__() ?
class ExampleClass(object):
def __new__(cls,value):
print("cr
Hello,
Have working sample with strange property - payload:
class ExampleClass(object):
def __init__(self,value):
print("Initialising instance...")
self.payload = value
exampleInstance = ExampleClass(42)
print(exampleInstance.payload)
Is it some default field that all objec
Hello,
I have 64 bit python on my windows 10 machine. Install contains 32 bit python
libs in path and I would like to remove them.
I do
imprt sys
sys.path.remove("C:\\Users\\me\\AppData\\Local\\Programs\\Python\\Python36-32")
It works for current python instance, but paths appears in new one.
Hello,
Sometimes I find code with strange print function usage. String is passed
without brackets.
#!/usr/bin/python
list = ['physics', 'chemistry', 1997, 2000];
print "Value available at index 2 : "
print list[2]
list[2] = 2001;
print "New value available at index 2 : "
print list[2]
If I use
Found that pythons have different paths. It might be related?
64 bit
C:\Users\me\AppData\Local\Programs\Python\Python36-32
C:\Users\me\AppData\Local\Programs\Python\Python36-32\DLLs
C:\Users\me\AppData\Local\Programs\Python\Python36-32\Lib
C:\Program Files\Python36\python36.zip
C:\Program Files\P
Hello,
I have 32Bit and 64Bit installations on my Windows 10 machine. I do import
importlib in both of them.
32bit works fine while 64bit prints error:
>>> import importlib
Traceback (most recent call last):
File "", line 1, in
File
"C:\Users\me\AppData\Local\Programs\Python\Python36-32\
Hello,
I have Python package tst in my workspace.
tst has files:
__init__.py
tst.py
content of __init__.py:
print("importing Tst")
content of tst.py:
class Tst:
def __init__(self):
print("init Tst")
I run python console in workspace directory. I do
>>>import tst
Run without erro
Hello,
I suppose I can run python module by passing module as param for executable:
python.exe myscr.py
But how to run script when I'm inside of console and have python prompt:
>>>
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
I run Python 3.6 console under windows 10. Where is default console directory?
I run script:
>>> tf = open ("aaa.txt", "w")
>>> tf.write(" %s" % 123)
>>> tf.close()
Where file aaa.txt will be created? Can I change default work space location?
How?
--
https://mail.python.org/mailman/
Hello,
Trying to import my made module to python with helper function:
import os.path.join
("D","pyth_nonsens","workspace_python","PyhonTutorial","reader")
>>> import os.path.join
>>> ("D","pyth_nonsens","workspace_python","PyhonTutorial","reader")
File "", line 1
import os.path.join
Hello,
Trying to understand command:
[p for p in sys.path]
It prints array of paths. I suppose p becomes array of strings but what []
means in this statement?
--
https://mail.python.org/mailman/listinfo/python-list
15 matches
Mail list logo