Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 4:45 PM, Terry Reedy wrote: > >> This file should not exist. Python 3 stores .pyc files in a >> __pycache__ subdirectory. It won't even run "idlelib\__init__.pyc" if >> "idlelib\__init__.py" exists, so your installation is incomplete and >> damaged. I suggest that you unins

Re: Python installation in windows

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 9:15 AM, Oscar Benjamin wrote: > > I thought this was suppose to have been fixed in 3.5.1 though so the installer > should now warn that it won't work on XP. The CRT update also requires service pack 1 on Windows 7 and service pack 2 on Vista. 3.5.1's installer was updated

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 11:10 AM, Chris Angelico wrote: > On Wed, Jan 13, 2016 at 3:51 AM, jkn wrote: >> I happy to carve some code without using urllib, but I am not clear what I >> actually need to do to 'open' such a URL using this protocol. FWIW I can >> paste >> this URL into Windows Explor

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 11:52 AM, Chris Angelico wrote: > Is that properly escaped to handle any arbitrary URL? I doubt it. subprocess doesn't know how to quote a command line for the Windows shell, which doesn't follow the rules used by subprocess.list2cmdline. To make matters worse, one often h

Re: problem

2016-01-14 Thread eryk sun
On Thu, Jan 14, 2016 at 3:10 PM, Chris Angelico wrote: > On Fri, Jan 15, 2016 at 6:01 AM, Irmen de Jong wrote: >> Either put something like this at the end of your python scripts, to keep >> the console open: >> >> raw_input("press enter to exit...") > > Small qualification: This is 3.5, so you

Re: problem

2016-01-15 Thread eryk sun
On Thu, Jan 14, 2016 at 7:03 PM, Andrew Ongko wrote: > At least, this way, the cmd doesn't close by itself. This phrasing may perpetuate a common misconception that the Windows console is (or is created by) cmd.exe. The cmd.exe shell is just another console client process, no different from pyth

Re: how do I put the python on my desktop or even access it

2016-01-17 Thread eryk sun
On Sun, Jan 17, 2016 at 9:03 AM, Michael Torrie wrote: > > but if it's a text-mode program you must run it from cmd.exe like this: > > python \path\to\myprogram.py. You only need to run from another console program to keep the window open after Python exits. You can even do t

Re: how do I put the python on my desktop or even access it

2016-01-17 Thread eryk sun
On Sun, Jan 17, 2016 at 6:05 PM, Michael Torrie wrote: > On 01/17/2016 02:46 PM, eryk sun wrote: >> On Sun, Jan 17, 2016 at 9:03 AM, Michael Torrie wrote: >>> >>> but if it's a text-mode program you must run it from cmd.exe like this: >>> >>> py

Re: Python.Exe Problem

2016-01-18 Thread eryk sun
On Mon, Jan 18, 2016 at 5:17 PM, wrote: > > I've installed Python 3.5 AMD64 from python.org > (https://www.python.org/ftp/python/3.5.0/python-3.5.0a1-amd64.exe to be > exact), 3.5.0a1 is the first alpha version, released 7 months before the final version of 3.5.0. Remove it, and install 3.5.1 u

Re: import locale and print range on same line

2016-01-24 Thread eryk sun
On Sat, Jan 23, 2016 at 8:45 PM, Terry Reedy wrote: > On 1/23/2016 8:58 AM, Chris Angelico wrote: >> On Sun, Jan 24, 2016 at 12:45 AM, Steven D'Aprano >> wrote: >>> [steve@ando ~]$ python -c "for i in range(5): >>>> >>>> prin

Re: pip install mitmproxy - fails on watchdog-0.8.3.tar.gz with "Permission denied" error (Python 2.7.11 on Win XP SP3);

2016-01-26 Thread eryk sun
On Sun, Jan 24, 2016 at 7:27 PM, Terry Reedy wrote: > > More specifically, / is not accepted in paths to be executed. It seems to be > generally accepted in path arguments, as in cd path, or > > C:\Users\Terry>C:\programs\python35\python.exe C:/programs/python34/tem.py An ex

Re: problem in installing python

2016-02-03 Thread eryk sun
On Wed, Feb 3, 2016 at 12:57 AM, Salony Permanand wrote: > > I downloaded different version of python but no one is installed on my pc > because of same installation error each time having error code 2203. 2203 may be a Windows Installer error [1]. If so, the error message has the following templ

Re: __bases__ attribute on classes not displayed by dir() command

2016-02-04 Thread eryk sun
On Thu, Feb 4, 2016 at 2:03 AM, ast wrote: > but if I am using dir to display all Carre's attributes and methods, > __bases__ is not on the list. Why ? The __bases__ property is defined by the metaclass, "type". dir() of a class doesn't show attributes from the metaclass [1]. Because dir() i

Re: How this C function was called through ctypes this way?

2016-02-04 Thread eryk sun
On Thu, Feb 4, 2016 at 3:33 AM, wrote: > > class DoubleArrayType: > def from_param(self, param): > > [snip] > > DoubleArray = DoubleArrayType() > _avg = _mod.avg > _avg.argtypes = (DoubleArray, ctypes.c_int) > > [snip] > > What confuse me are: > (1) at line: _avg.argtypes = (DoubleArray, ctyp

Re: Copying void * string to

2016-02-10 Thread eryk sun
On Wed, Feb 10, 2016 at 6:07 AM, Martin Phillips wrote: > > Several functions in the C library return pointers to dynamically allocated > w_char null > terminated strings. I need to copy the string to a Python variable and call > an existing > library function that will free the dynamically allo

Re: Python Not Working as expected on Win 8 and above.

2016-02-13 Thread eryk sun
On Sat, Feb 13, 2016 at 7:35 AM, MWS wrote: > couldn't find the default install python directory (maybe i didn't pay > attention earlier), later, after some scratching my head and other > intelligent thoughts and experiments i found it got installed in the users > hidden appdata folder by default(

Re: extending PATH on Windows?

2016-02-16 Thread eryk sun
On Tue, Feb 16, 2016 at 2:30 AM, Ulli Horlacher wrote: > > So far, I use: > >system('setx PATH "%PATH%;'+bindir+'"') > > The problem: In a new process (cmd.exe) PATH contains a lot of double > elements. As far as I have understood, Windows builds the PATH > environment variable from a system c

Re: [Glitch?] Python has just stopped working

2016-02-16 Thread eryk sun
On Tue, Feb 16, 2016 at 10:19 AM, Theo Hamilton wrote: > Whenever I run python (3.5), I get the following message: > > Fatal Python error: Py_initialize: unable to load the file system codec > ImportError: No module named 'encodings' > > Current thread 0x2168 (most recent call first): The int

Re: extending PATH on Windows?

2016-02-17 Thread eryk sun
On Wed, Feb 17, 2016 at 11:49 AM, Ulli Horlacher wrote: > At startup cmd.exe runs a script which is defined by the registry variable > AutoRun in "HKCU\Software\Microsoft\Command Processor" > > I set this variable with: > > rc = "HKCU\Software\Microsoft\Command Processor" > ar = "%USERPROFILE%

Re: extending PATH on Windows?

2016-02-17 Thread eryk sun
On Wed, Feb 17, 2016 at 2:29 PM, Ulli Horlacher wrote: > eryk sun wrote: >> > >> > set PATH=%PATH%;%USERPROFILE%\Desktop >> >> The AutoRun command (it's a command line, not a script path) > > A script path is a legal command line, too. If the regist

Re: extending PATH on Windows?

2016-02-18 Thread eryk sun
On Wed, Feb 17, 2016 at 6:53 PM, Dennis Lee Bieber wrote: > On Wed, 17 Feb 2016 17:49:11 + (UTC), Ulli Horlacher > declaimed the following: > >>Thorsten Kampe wrote: >> >>> By the way: there is a script called `win_add2path.py` in your Python >>> distribution >> >>I have >>"Python 2.7.11 (v2

Re: extending PATH on Windows?

2016-02-19 Thread eryk sun
On Fri, Feb 19, 2016 at 4:48 AM, Chris Angelico wrote: > On Fri, Feb 19, 2016 at 9:42 PM, Ulli Horlacher > wrote: >> pyotr filipivich wrote: >> >>> > Windows (especially 7) search function is highly crippled. There is >>> >some command sequence that will open it up to looking at other file

Re: extending PATH on Windows?

2016-02-19 Thread eryk sun
On Thu, Feb 18, 2016 at 10:55 AM, Ulli Horlacher wrote: > Ulli Horlacher wrote: > >> > but simpler still and more reliable to just call QueryValueEx. >> >> I find it more complicated. > > I have now (after long studying docs and examples):: > > def get_winreg(key,subkey): > try: > rkey = wi

Re: extending PATH on Windows?

2016-02-19 Thread eryk sun
On Fri, Feb 19, 2016 at 8:18 AM, Gisle Vanem wrote: > Dennis Lee Bieber wrote: > How can one search for files with DOS? >>> >>> dir /s /b \*add2path.* >>> >>> ChrisA >> >> Or move to PowerShell... >> >> Windows PowerShell >> Copyright (C) 2009 Microsoft Corporation. All rights reserved.

Re: extending PATH on Windows?

2016-02-20 Thread eryk sun
On Fri, Feb 19, 2016 at 6:57 PM, Dennis Lee Bieber wrote: > > Problem -- if the OP's PATH had contained the location of the add2path > script, the OP might not have needed to search for it... (presuming their > configuration also was set up to treat .py files as executable, entering > win_

Re: How to define what a class is ?

2016-02-25 Thread eryk sun
On Thu, Feb 25, 2016 at 3:54 AM, ast wrote: > So we can conclude that inspect.isclass(x) is equivalent > to isinstance(x, type) > > lets have a look at the source code of isclass: > > def isclass(object): >"""Return true if the object is a class. > >Class objects provide these attributes:

Re: Bug in Python?

2016-02-26 Thread eryk sun
On Fri, Feb 26, 2016 at 4:08 PM, Sven R. Kunze wrote: > Python sometimes seems not to hop back and forth between C and Python code. > Can somebody explain this? Normally a C extension would call PySequence_SetItem, which would call the type's sq_ass_item, which for MyList is slot_sq_ass_item. Th

Re: Bug in Python?

2016-02-26 Thread eryk sun
On Fri, Feb 26, 2016 at 4:37 PM, Ian Kelly wrote: > So I would guess that the difference here is because one > implementation is entirely C, and the other implementation is entirely > Python. Exactly, the C implementation of siftup is only called internally. So there's no need to export it as a f

Re: What arguments are passed to the __new__ method ?

2016-03-01 Thread eryk sun
On Tue, Mar 1, 2016 at 11:24 AM, ast wrote: > > class Premiere: > >def __new__(cls, price): >return object.__new__(cls, price) > >def __init__(self, price): >pass > > p = Premiere(1000) > > it fails. It is strange because according to me it is equivalent to: > > class Premi

Re: What arguments are passed to the __new__ method ?

2016-03-01 Thread eryk sun
On Tue, Mar 1, 2016 at 2:27 PM, Terry Reedy wrote: > On 3/1/2016 12:24 PM, ast wrote: > >> class Premiere: >> def __init__(self, price): >> pass >> p = Premiere(1000) >> >> which is OK. > > Premiere is callable because it inherits object.__call__. That function, or > the implementati

Re: a clarification on the "global" statement sought

2016-03-11 Thread eryk sun
On Fri, Mar 11, 2016 at 2:13 AM, Charles T. Smith wrote: > When might a "global" statement be used in the outermost level of a module? You wouldn't need this in a normal module, because locals and globals are the same. It may be useful if you're using exec with separate locals and globals, and ne

Re: Installed 3.5.0 successfully on Windows 10, but where is DDLs, Doc, Lib, etc?

2016-03-20 Thread eryk sun
On Sun, Mar 20, 2016 at 5:33 PM, wrote: > On Wednesday, October 14, 2015 at 9:06:11 PM UTC+2, John S. James wrote: >> I installed 3.5.0 today and it's working fine -- either from the command >> prompt, or running a .py script. >> >> But the Python 3.4 that

Re: os.rename on Windows

2016-03-23 Thread eryk sun
On Wed, Mar 23, 2016 at 7:17 AM, Steven D'Aprano wrote: > > According to the documentation, os.rename(original, new) will fail if new > already exists. In 3.3+ you can use os.replace. For POSIX systems it's functionally the same as os.rename. pyosreplace [1] backports os.replace for 2.6, 2.7 and

Re: Not downloading

2016-03-23 Thread eryk sun
On Wed, Mar 23, 2016 at 12:31 PM, louis anderson wrote: > After a workshop in my school today regarding python, i have downloaded it on > my laptop > however when i go to launch it, it either tells me to modify python, repair > python or uninstall > python. It will not let me go onto python at a

Re: setup

2016-03-26 Thread eryk sun
On Sat, Mar 26, 2016 at 6:20 PM, Joel Goldstick wrote: > I'm guessing you are on windows and you could google the error code, but > also search the list because this question has been asked and answered I > believe A little knowledge helps. An upper word of 0x8007 indicates a COM HRESULT error (0

Re: win32com problem

2006-10-24 Thread Aries Sun
Have you tried late binding? Does late binding produce the same error? Regards, Aries [EMAIL PROTECTED] wrote: > I'm interacting with a third party application using python and com. > However having problems and don't know what to look at next to resolve > the issue. > > The app. can be driven b

Re: sort one list using the values from another list

2006-02-27 Thread Dolmans Sun
Kent Johnson wrote: > >>> [a for b,a in sorted(zip(B,A))] also, [a for _,a in sorted(zip(B,A))] didn't read refs, tested above python-2.2.3. -- Sun Yi Ming you can logout any time you like, but you can never leave... -- http://mail.python.org/mailman/listinfo/python-list

Re: sort one list using the values from another list

2006-02-27 Thread Simon Sun
27;t know it is a just a plain variable or like something pattern matching in Haskell. -- Simon Sun you can logout any time you like, but you can never leave... -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking out a module for Subversion

2008-08-12 Thread Patrol Sun
Eclipse with PyDev extension cannot debug. Ulipad is able to debug,but it needs wxpython to support. 2008/8/12 Alexandru Palade <[EMAIL PROTECTED]> > As for the open source IDE you can always try Eclipse with PyDev extension. > > > > Dudeja, Rajat wrote: > >> Hi, >> >> I'm new to Python. I only h

Re: Manipulating Python Source

2008-08-12 Thread Patrol Sun
This idea recalls Spring's Bean binding to me. Good idea. Is there similar thing? 2008/8/12 Wilson <[EMAIL PROTECTED]> > Hi, > > I'm wondering if there are any tools available or simple methods for > taking a python source file and parsing into some hierarchical format, > like the ConfigParser. I

Re: Looking out a module for Subversion

2008-08-12 Thread Patrol Sun
Sorry for my wrong information. But the Eclipse is very huge, Ulipad is very small. http://code.google.com/p/ulipad/downloads/list 2008/8/13 Fabio Zadrozny <[EMAIL PROTECTED]> > > On Tue, Aug 12, 2008 at 6:50 AM, Patrol Sun <[EMAIL PROTECTED]> wrote: > >> Eclipse

Re: Logging library unicode problem

2008-08-13 Thread Patrol Sun
What's your system? Simple Chinese Windows??? 2008/8/13 Victor Lin <[EMAIL PROTECTED]> > Hi, > I'm writting a application using python standard logging system. I > encounter some problem with unicode message passed to logging library. > I found that unicode message will be messed up by logging ha

how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
when I use 20 for ,"SystemError: too many statically nested blocks" When I use 100 for ,"IndentationError: too many levels of indentation" How to handle these errors? -- http://mail.python.org/mailman/listinfo/python-list

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
Of course We needn't 100 levels,but I use the exec function can concise the code. See the attachment. 2008/8/17 Fredrik Lundh <[EMAIL PROTECTED]> > Nick Dumas wrote: > > A good quote I read (I can't remember who it was from, though) is "If >> you need more than three levels of indentation, then s

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
I found that the recursive function run very slowly 2008/8/18 Paul Boddie <[EMAIL PROTECTED]> > On 17 Aug, 17:17, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > > required reading: > > > >"The Effects of Moore's Law and Slacking on Large Computations" > >http://arxiv.org/abs/astro-ph/9912

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
Yes, I can solve the problem by recursive function. I guess Function Call consume more resources than nested For. So I use the nested For by using exec function. 2008/8/18 Paul Boddie <[EMAIL PROTECTED]> > On 17 Aug, 19:36, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > > and functions will solve

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
I use the exec function. my code's levels are less than 3. BTW,Linus Torvalds is NOT always right. 2008/8/18 Roel Schroeven <[EMAIL PROTECTED]> > Nick Dumas schreef: > >> A good quote I read (I can't remember who it was from, though) is "If >> you need more than three levels of indentation, then

Re: how many nested for can we utilize?

2008-08-18 Thread Patrol Sun
I test the exec function. As we all know, we can set the recursive levels. How to handle it? 2008/8/17 Fredrik Lundh <[EMAIL PROTECTED]> > Patrol Sun wrote: > > when I use 20 for ,"SystemError: too many statically nested blocks" >> When I use 100 for ,"

Re: how many nested for can we utilize?

2008-08-18 Thread Patrol Sun
Thanks, I cannot utilize the String Class completely. I'm a newbie for python 2008/8/18 Gabriel Genellina <[EMAIL PROTECTED]> > En Sun, 17 Aug 2008 21:57:46 -0300, Patrol Sun <[EMAIL PROTECTED]> > escribió: > > > Of course We needn't 100 levels,but I us

Re: print line number and source filename

2010-11-22 Thread Wei Sun
Here is what you want for printing python source filename: print __file__ > On Tuesday, June 22, 2010 12:44 PM Peng Yu wrote: > I want to print filename and line number for debugging purpose. So far > I only find how to print the line number but not how to print > filename. > > import inspect >

Re: Rename file without overwriting existing files

2017-02-09 Thread eryk sun
On Thu, Feb 9, 2017 at 11:46 AM, Steve D'Aprano wrote: > > So to summarise, os.rename(source, destination): > > - is atomic on POSIX systems, if source and destination are both on the > same file system; > - may not be atomic on Windows? > - may over-write an existing destination on POSIX system

Re: subprocess problem

2017-02-09 Thread eryk sun
On Thu, Feb 9, 2017 at 10:50 PM, Cameron Simpson wrote: > This is why I suggested the check_returncode() method, which examines the > error code. You must be thinking of the returncode attribute, which isn't a method. check_returncode() is a method of the CompletedProcess object that's returned b

Re: subprocess problem

2017-02-09 Thread eryk sun
On Fri, Feb 10, 2017 at 12:05 AM, Wildman via Python-list wrote: > > Corrected code: > > def which(target) > for p in pathlist: > fullpath = p + "/" + target > if os.path.isfile(fullpath) and os.access(fullpath, os.X_OK): > return fullpath, True > return None, F

Re: os.path.isfile

2017-02-10 Thread eryk sun
On Fri, Feb 10, 2017 at 9:09 PM, Vincent Vande Vyvre wrote: > Le 10/02/17 à 22:03, Vincent Vande Vyvre a écrit : >> Le 10/02/17 à 21:36, Peter Otten a écrit : >>> Vincent Vande Vyvre wrote: Le 10/02/17 à 19:11, epro...@gmail.com a écrit : > > Python 3.5.2 > > Windows 10 >

Re: os.path.isfile

2017-02-11 Thread eryk sun
On Sun, Feb 12, 2017 at 3:52 AM, Steve D'Aprano wrote: > In Python, you should always use forward slashes for paths, even on Windows. There are cases where slash doesn't work (e.g. some command lines; \\?\ prefixed paths; registry subkey paths), so it's simpler to follow a rule

Re: Rename file without overwriting existing files

2017-02-12 Thread eryk sun
On Sun, Feb 12, 2017 at 4:09 AM, Steve D'Aprano wrote: > On Fri, 10 Feb 2017 12:07 am, eryk sun wrote: > >> On Thu, Feb 9, 2017 at 11:46 AM, Steve D'Aprano >> wrote: >>> >>> So to summarise, os.rename(source, destination): >>> >>>

Re: os.path.isfile

2017-02-12 Thread eryk sun
On Sun, Feb 12, 2017 at 4:29 AM, Chris Angelico wrote: > Registry subkeys aren't paths, and the other two cases are extremely > narrow. Convert slashes to backslashes ONLY in the cases where you > actually need to. \\?\ paths are required to exceed MAX_PATH (a paltry 260 character

Re: How to access installed scripts on Windows?

2017-02-18 Thread eryk sun
On Sat, Feb 18, 2017 at 8:38 PM, ddbug wrote: > I am very perplexed by inability to tell the Windows installer (bdist_wininst > or pip) where to > install scripts (or "entry points"). > > By default (and I don't see other options) scripts go to > %USERPROFILE%/Appdata/Roaming/Python/Scripts. Tha

Re: Python application launcher (for Python code)

2017-02-21 Thread eryk sun
On Tue, Feb 21, 2017 at 1:25 AM, Steve D'Aprano wrote: > (2) Add each category to the PYTHONPATH. One easy way to do so is by adding > the directories to a .pth file. PYTHONPATH isn't a synonym for sys.path. The PYTHONPATH environment variable gets used by every installed interpreter, which can b

Re: [Glitch?] Python has just stopped working

2017-02-23 Thread eryk sun
On Thu, Feb 23, 2017 at 8:14 AM, wrote: > W dniu wtorek, 16 lutego 2016 21:09:50 UTC+1 użytkownik Theo Hamilton napisał: >> I woke up two days ago to find out that python literally won't work any >> more. I have looked everywhere, asked multiple Stack Overflow questions, >> and am ready to give u

Re: Python 3.6 installation doesn't add launcher to PATH

2017-02-24 Thread eryk sun
On Fri, Feb 24, 2017 at 12:38 PM, ChrisW wrote: > However, I've installed Python 3.6 with the 'include PATH' checkbox ticked > for my user only, and although C:\Windows\py.exe exists, it has not been > added to my PATH. > > I also tried installing for all users, and this also doesn't add it to the

Re: Python 3.6 installation doesn't add launcher to PATH

2017-02-26 Thread eryk sun
On Sun, Feb 26, 2017 at 3:09 PM, ChrisW wrote: > On Saturday, 25 February 2017 07:21:30 UTC, eryk sun wrote: >> On Fri, Feb 24, 2017 at 12:38 PM, ChrisW wrote: >> > However, I've installed Python 3.6 with the 'include PATH' checkbox ticked >> > for my

Re: Odd wording it docs for shutil.move?

2017-03-03 Thread eryk sun
On Fri, Mar 3, 2017 at 5:13 PM, Grant Edwards wrote: > At https://docs.python.org/2/library/shutil.html it says: > > shutil.move(src, dst) > > Recursively move a file or directory (src) to another location > (dst). > > [...] > > If the destination is on the current filesystem, the

Re: How to access installed scripts on Windows?

2017-03-05 Thread eryk sun
On Sun, Mar 5, 2017 at 2:35 AM, ddbug wrote: > >> You can also develop using venv virtual environments. You can symlink >> or shell-shortcut to the activation script of a virtual environment. > > Interesting idea. But I have not seen any installers or guidance how to > d

Re: Export Event log via python in .txt

2017-03-06 Thread eryk sun
On Mon, Mar 6, 2017 at 3:36 PM, wrote: > I'm a student learning about python I would like to know how to export > Security log Application and generate folder path via python please help If you're asking about the Windows event logs, then it'll be easiest from a scripting POV to use wevtutil.exe

Re: Importing with ctypes in Python: fighting overflows

2017-03-07 Thread eryk sun
On Tue, Mar 7, 2017 at 12:45 PM, wrote: > Importing with ctypes in Python: fighting overflows: > https://www.cossacklabs.com/blog/fighting-ctypes-overflows.html C int is 32-bit on all platforms currently supported by CPython -- both 32-bit and 64-bit. It's the default result type and the default

Re: No module named 'encodings' Python 3.6 on Windows 10 failure

2017-03-07 Thread eryk sun
On Wed, Mar 8, 2017 at 1:24 AM, wrote: > > Every attempt to make Python 3.6.0 or 3.6.1rc1 to run on Windows 10 > has resulted in the error message shown below. I was running Python > 3.5.2 successfully and wanted to upgrade. > > C:\Python36-32>python > Fatal Python error: Py_Initialize: unable t

Re: Compiling new Pythons on old Windows compilers

2017-03-12 Thread eryk sun
On Sun, Mar 12, 2017 at 5:02 PM, Eric Frederich wrote: > Any idea why compatibility was dropped recently? There used to be a PC > directory with different VS directories in the source tree, now it isn't > there any more. CPython 3.5+ uses the Universal CRT on Windows, whi

Re: When will os.remove fail?

2017-03-13 Thread eryk sun
On Sun, Mar 12, 2017 at 5:48 PM, Steve D'Aprano wrote: > > Does os.remove work like this under Windows too? os.remove calls DeleteFile on Windows. This in turn calls NtOpenFile to instantiate a kernel File object that has delete access and return a handle to it. Ne

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 11:32 AM, Steve D'Aprano wrote: > On Mon, 13 Mar 2017 08:47 pm, eryk sun wrote: > >> One hurdle to getting delete access is the sharing mode. If there are >> existing File objects that reference the file, they all have to share >> delete acc

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 1:07 PM, Chris Angelico wrote: > On Tue, Mar 14, 2017 at 10:32 PM, Steve D'Aprano > wrote: > >> I take it that you *can* delete open files, but only if the process that >> opens them takes special care to use "delete sharing". Is that correct? > > Yes, but you can't always

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 7:01 PM, Grant Edwards wrote: > > 1. I think I can see the VMS heritage of Windows shining through. That's not surprising considering that VMS and NT have the same architect -- Dave Cutler -- and that I/O system and file systems were design by former DEC programmers that h

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 10:05 PM, Dennis Lee Bieber wrote: > On Wed, 15 Mar 2017 00:07:32 +1100, Chris Angelico > >>Yes, but you can't always control the process that opens them. For >>example, it's annoyingly difficult to update a running executable. >> > I wouldn't be surprised if Windows mmap(

Re: python script Non-ASCII character

2017-03-19 Thread eryk sun
On Sun, Mar 19, 2017 at 11:06 PM, MRAB wrote: > > If you're using Unicode string literals, your choices are: > > 1. Raw string literals: > > var1 = ur"C:\Users\username\Desktop\η γλωσσα μου\mylanguage\myfile" Raw unicode literals are practically useless in P

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 6:42 PM, adam.c.bernier wrote: > > I am on Windows 7. Python 2.7 > > I'm trying to have a program run another program using `subprocess.Popen` > > import subprocess as sp > > args = shlex.split(args) Is this command supposed to run cross-platform? If not, then spli

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 8:24 PM, Ian Kelly wrote: > On Fri, Mar 24, 2017 at 2:09 PM, Chris Angelico wrote: > >> Errr been a while since I messed with Windows from memory, I >> think you can "start /wait programname" to make it wait?? Worth a try, >> at least. > > start /wait is for batch

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 8:44 PM, adam.c.bernier wrote: > On Friday, March 24, 2017 at 1:37:49 PM UTC-7, eryk sun wrote: > >> Without knowing the command you're running, all we can do is >> speculate. It could be that it's an application that uses a single >&g

Re: Installation issue with Python 3.6.1 for 64 bit Windows

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 4:01 AM, arjun.janah wrote: > > I ran the file and it appeared to install properly. But when I tried to run > Python from > the Windows All Programs menu tab, I got the following message, in a small > window by the window with

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 3:37 PM, Chris Angelico wrote: > > Just use Unicode. Everything else, these days, is a subset of Unicode > anyway. Unless you're stuck on the default Windows shell/terminal, you > should be able to use UTF-8 everywhere and have the entire Unicode > r

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:29 PM, Chris Angelico wrote: > Rounded corners? > > ╭─┬─╮ > ├─┼─┤ > ╰─┴─╯ This prints fine in the Windows console with Consolas as the font, but the older Courier New and Lucida Console fonts lack glyphs for the rounded corners. -- https://mail.pyt

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:58 PM, Chris Angelico wrote: >> The Windows console can render any character in the BMP, but it >> requires configuring font linking for fallback fonts. It's Windows, so >> of course the supported UTF format is UTF-16. The console's UTF-8 &g

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:49 PM, eryk sun wrote: > On Sun, Mar 26, 2017 at 5:29 PM, Chris Angelico wrote: >> Rounded corners? >> >> ╭─┬─╮ >> ├─┼─┤ >> ╰─┴─╯ > > This prints fine in the Windows console with Consolas as the font, but > the older Courier Ne

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 6:57 PM, Chris Angelico wrote: > > In actual UCS-2, surrogates are entirely disallowed; in UTF-16, they *must* be > correctly paired. Strictly-speaking UCS-2 disallows codes that aren't defined by the standard, but the kernel couldn't be that restric

Re: Python under PowerShell adds characters

2017-03-29 Thread eryk sun
On Wed, Mar 29, 2017 at 4:06 PM, wrote: > I wrote a Python script, which executed as intended on Linux and > from cmd.exe on Windows. Then, I ran it from the PowerShell >command line, all print statements added ^@ after every character. ISE is the only command-line environment that's specific t

Re: Python under PowerShell adds characters

2017-03-29 Thread eryk sun
On Wed, Mar 29, 2017 at 5:42 PM, Jay Braun wrote: > > I'm not using ISE. I'm using a pre-edited script, and running it with the > python command. > > Consider the following simple script named hello.py (Python 2.7): > > print "Hello" > > If I enter: > python hello.py > out.txt > > from cmd.exe I

Re: Python under PowerShell adds characters

2017-03-29 Thread eryk sun
On Wed, Mar 29, 2017 at 7:13 PM, Marko Rauhamaa wrote: > eryk sun : >> PowerShell is far more invasive. Instead of giving the child process a >> handle for the file, it gives it a handle for a *pipe*. PowerShell >> reads from the pipe, and like an annoying busybody that no

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 4:55 PM, Chris Angelico wrote: > On Sun, Apr 2, 2017 at 2:43 AM, Marko Rauhamaa wrote: >> Steve D'Aprano : >> >>> Open your eyes, there is a whole world past the borders of your insular, >>> close-minded little country. 95% of the wo

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 5:38 PM, Steve D'Aprano wrote: > Or, for Windows, I suppose a dozen or so more characters: > > https://support.office.com/en-us/article/Invalid-characters-in-file-or-folder-names-or-invalid- > file-types-in-OneDrive-for-Business-64883A5D-228E-48F5-B3D2-EB39E07630FA It's mor

Re: VirtualEnvs (venv) and Powershell

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 12:03 AM, Carl Caulkett wrote: > I've just started to investigate VirtualEnvironments as a means of > preventing my 3rd party code becoming chaotic. I've discovered that > venv's can be managed quite effectively using Powershell. When > Activate.ps1 is run, the PowerShell ch

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 9:08 AM, Paul Moore wrote: > I know I've seen this before, but for the life of me I can't find any > reference. > > If I write a simple web server using wsgiref, something like > > from wsgiref.simple_server import make_server, demo_app > > with make_server('', 800

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 12:34 PM, Paul Moore wrote: > On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote: >> It works for me when run from a command prompt in Windows 10. >> serve_forever() uses select() with a timeout of 0.5s, so it doesn't >> block the main t

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 1:20 PM, Paul Moore wrote: > On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: >> It should service the request and return to the serve_forever() loop. >> Do you see a line logged for each request, like "[IP] - - [date] "GET >> ...&quo

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread eryk sun
On Tue, Apr 4, 2017 at 1:45 AM, Dennis Lee Bieber wrote: > > C:\Users\Wulfraed>assoc .py > .py=Python.File > > C:\Users\Wulfraed>ftype python.file > python.file="C:\Python27\python.exe" "%1" %* The Windows shell stores the user file-association choice in HKCU\Software\Microsoft\Windows\CurrentVer

Re: Problem installing 3.6.1 AMD64

2017-04-05 Thread eryk sun
On Wed, Apr 5, 2017 at 6:46 PM, Colin J. Williams wrote: >Successful install reported, but: > > Microsoft Windows [Version 10.0.14393] > (c) 2016 Microsoft Corporation. All rights reserved. You're using Windows 10. > C:\Users\CJW>cd\python > The system cannot find the pat

Re: Problem installing 3.6.1 AMD64

2017-04-05 Thread eryk sun
On Thu, Apr 6, 2017 at 12:12 AM, MRAB wrote: import os [p for p in os.environ['PATH'].split(';') if 'Python35' in p] > > Remove those references from the PATH environment variable: > os.environ['PATH'] = ';'.join(p for p in os.environ['PATH'].split(';') if 'Python35' not in p)

Re: Installing Python 3.6.1 on a Windows 10

2017-04-10 Thread eryk sun
On Mon, Apr 10, 2017 at 3:45 PM, Colin J. Williams wrote: > Below is the tail of my Install Log. > Is this a problem that I should be able to resolve? > Advice sought. Open a Windows / Installation issue on bugs.python.org. Zip up the installation logs and attach the zip to the issue. -- https:/

Re: IOError: [Errno 12] Not enough space

2017-04-11 Thread eryk sun
On Tue, Apr 11, 2017 at 12:30 PM, LnT wrote: > Opening browser 'firefox' to base url 'https://onbdev.nbpa.com/zae' > [ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: > No browser is open > | FAIL | > IOError: [Errno 12] Not enough space >

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 5:29 AM, Steven D'Aprano wrote: > Should you call dunder methods (Double leading and trailing UNDERscores) > manually? For example: > > > my_number.__add__(another_number) > > > The short answer is: > > NO! In general, you shouldn't do it. > > > Guido recently commented: >

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 5:29 AM, Steven D'Aprano wrote: > > my_number.__add__(another_number) > > The short answer is: > > NO! In general, you shouldn't do it. For example: class C: def __add__(self, other): return NotImplemented class D: def __radd__(self, o

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 8:24 AM, Chris Warrick wrote: > On 13 April 2017 at 09:43, eryk sun wrote: >> The functions in the operator module implement abstract behavior (e.g. >> PyNumber_Add in CPython): >> >> >>> operator.__add__(C(), D()) >>

<    1   2   3   4   5   6   7   >