+= and =+

2017-09-13 Thread Andrej Viktorovich
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

Hat difference between "" and '' in string definition

2017-09-08 Thread Andrej Viktorovich
Hello, What is difference between string definitions: s="aaa" and s='bbb' -- https://mail.python.org/mailman/listinfo/python-list

class inheritance when not defined

2017-09-08 Thread Andrej Viktorovich
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

Re: remove path forever

2017-09-07 Thread Andrej Viktorovich
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

Why do we nned both - __init__() and __new__()

2017-09-07 Thread Andrej Viktorovich
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

what is payload

2017-09-07 Thread Andrej Viktorovich
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

remove path forever

2017-09-06 Thread Andrej Viktorovich
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.

print without ()

2017-09-06 Thread Andrej Viktorovich
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

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread Andrej Viktorovich
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

No importlib in Python 3 64 bit ?

2017-09-06 Thread Andrej Viktorovich
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\

cant't use package internals

2017-09-06 Thread Andrej Viktorovich
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

Run python module from console

2017-09-05 Thread Andrej Viktorovich
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

Python console's workspace path

2017-09-05 Thread Andrej Viktorovich
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/

Can I use functions while defining paths?

2017-09-04 Thread Andrej Viktorovich
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

meaning of [ ]

2017-09-03 Thread Andrej Viktorovich
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