Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-13 Thread eryk sun
On Thu, Oct 13, 2016 at 9:45 PM, Irmen de Jong wrote: > >>> On 12-10-2016 12:56, Robin Becker wrote: >>> I notice an extra space at the windows command prompt compared with 3.5, is that deliberate? > > Wow that was stupid, sorry. Anyway, I'm not seeing it with 3.6.0b2 either:

Re: Making IDLE3 ignore non-BMP characters instead of throwing an exception?

2016-10-17 Thread eryk sun
On Mon, Oct 17, 2016 at 2:20 PM, Adam Funk wrote: > I'm using IDLE 3 (with python 3.5.2) to work interactively with > Twitter data, which of course contains emojis. Whenever the running > program tries to print the text of a tweet with an emoji, it barfs > this & stops running: > > UnicodeEncod

Re: Making IDLE3 ignore non-BMP characters instead of throwing an exception?

2016-10-17 Thread eryk sun
On Mon, Oct 17, 2016 at 8:35 PM, Random832 wrote: > On Mon, Oct 17, 2016, at 14:20, eryk sun wrote: >> You can patch print() to transcode non-BMP characters as surrogate >> pairs. For example: >> >> On Windows this should allow printing non-BMP characters such as

Re: Making IDLE3 ignore non-BMP characters instead of throwing an exception?

2016-10-17 Thread eryk sun
On Tue, Oct 18, 2016 at 2:09 AM, Chris Angelico wrote: > That's not a UTF-16 encoded byte string, though. It's a Unicode string > that contains two surrogates. So maybe the solution is to convert from > true Unicode strings into strings like the above - but if so, it > absolutely must not be done

Re: dll files missings ....how to solve this problem

2016-10-21 Thread eryk sun
On Fri, Oct 21, 2016 at 4:05 PM, Dennis Lee Bieber wrote: > On Fri, 21 Oct 2016 15:00:58 +, mohammed iqtefan > declaimed the following: > >>i installed python 3.5.2 >> ... >>api-ms-win-crt-conio-l1-1-0.dll is missing >>and its not the only dll file that missing there is dozens more > > While

Re: Odd name shadowing in comprehension

2016-10-22 Thread eryk sun
On Sat, Oct 22, 2016 at 11:57 PM, Chris Angelico wrote: > > Normally, a comprehension is described as being equivalent to an > unrolled loop, inside a nested function. > ... > But it seems that the first iterator (and only that one) is evaluated > in the parent context: > > Why is this? It seems r

Re: Odd name shadowing in comprehension

2016-10-22 Thread eryk sun
On Sun, Oct 23, 2016 at 1:28 AM, Chris Angelico wrote: > > Fair enough, except that a generator expression is syntactic sugar for > a generator function, and the return value of a generator function is > a generator object that hasn't yet been started. So where the boundary >

Re: Odd name shadowing in comprehension

2016-10-22 Thread eryk sun
On Sun, Oct 23, 2016 at 3:44 AM, Steve D'Aprano wrote: > > https://www.python.org/dev/peps/pep-0289/#early-binding-versus-late-binding > > But this isn't a question about early or late binding, it is asking why the > variable y is treated as both global and local in the s

Re: Odd name shadowing in comprehension

2016-10-23 Thread eryk sun
On Sun, Oct 23, 2016 at 6:15 AM, Steve D'Aprano wrote: > On Sun, 23 Oct 2016 01:15 pm, eryk sun wrote: > >> I meant the behavior seems to have been copied to align with generator >> expressions, even though the cited rationale doesn't apply. I'm not >> say

Re: Why doesn't Python include non-blocking keyboard input function?

2016-10-26 Thread eryk sun
On Wed, Oct 26, 2016 at 11:39 AM, Dennis Lee Bieber wrote: > Curses tends to not be available on Windows as M$ hasn't implemented a > compatible console driver. The PDCurses library supports the Windows console. Christoph Gohlke distributes a curses extension module based on it: http://www.

Re: Windows switch between python 2 and 3

2016-10-27 Thread eryk sun
On Thu, Oct 27, 2016 at 3:41 PM, Steve D'Aprano wrote: > On Fri, 28 Oct 2016 02:11 am, Daiyue Weng wrote: > >> Hi, I installed Python 2.7 and Python 3.5 64 bit versions on Win 10. Under >> >> C:\Python35 >> >> C:\Python27 >> >> Both have been set in environment variable Path. >> >> When I type pyt

Re: Installing Python on Windows 7

2016-10-27 Thread eryk sun
On Thu, Oct 27, 2016 at 10:10 PM, Karen Hermann wrote: > > Can you help please, is there something wrong with my system / setup, should > I be > downloading a different Python version? The system is missing the new C runtime. Enable Windows Update and install the recommended updates. -- https:/

Re: Installing Python on Windows 7

2016-10-28 Thread eryk sun
On Fri, Oct 28, 2016 at 2:39 PM, Jens Janzen wrote: > 1. Download C runtime Libraries from Microsoft > https://support.microsoft.com/de-de/kb/2999226 > for Windows 7 The more recent update is here [1], but don't use this. Use Windows Update to get the latest updates. [1]: https://support.microso

Re: Doubled backslashes in Windows paths

2016-10-28 Thread eryk sun
On Fri, Oct 28, 2016 at 8:04 PM, Gilmeh Serda wrote: > > You can use forward slash to avoid the messy problem. There are cases in which you need to use backslash, such as extended paths and command lines. Python 3's pathlib automatically normalizes a Windows path to use backslash. Otherwise you c

Re: First security bug related to f-strings

2016-11-05 Thread eryk sun
On Sat, Nov 5, 2016 at 5:33 PM, Irmen de Jong wrote: > I think perhaps we should have a command line option / environment variable > to be able > to disable 'eval' altogether I don't think that's practical. exec and eval are commonly used by shells and IDEs such as IDLE and IPython. In the s

Re: First security bug related to f-strings

2016-11-05 Thread eryk sun
On Sat, Nov 5, 2016 at 6:50 PM, Irmen de Jong wrote: > Perhaps. But in those cases you could just leave things on the default. > If you choose to run the interpreter with eval (and exec) disabled, you > should be aware > that you'll break tools like that. But for other situations (web server etc)

Re: Confused with installing per-user in Windows

2016-11-07 Thread eryk sun
On Mon, Nov 7, 2016 at 1:11 AM, ddbug wrote: > > In Windows, the user-local directory for scripts is %APPDATA%\Python\Scripts. > It is not in > PATH by default and finding it is hard (because Microsoft made it hidden in > their infinite > wisdom). POSIX "~/.local" is hidden as well, by conventi

Re: Windows: subprocess won't run different Python interpreter

2016-11-10 Thread eryk sun
On Thu, Nov 10, 2016 at 9:58 PM, Thorsten Kampe wrote: > > I'm trying to run a script with a different Python version by > extending the path variable and executing "python.exe". It looks like > subprocess will always run the current executing Python. WinAPI CreateProcess checks the application d

Re: Error message

2016-11-10 Thread eryk sun
On Thu, Nov 10, 2016 at 9:37 PM, Keenan C wrote: > > I am continuously receiving this error after the installation of Python > 3.5.2. The purpose of using this program is for a class I am currently > enrolled in at a University. (I am running Windows 7 Home Premium 64-bit > paired with an i3-210

Re: Windows: subprocess won't run different Python interpreter

2016-11-10 Thread eryk sun
On Fri, Nov 11, 2016 at 6:01 AM, Thorsten Kampe wrote: > * eryk sun (Thu, 10 Nov 2016 23:04:02 +) >> >> On Thu, Nov 10, 2016 at 9:58 PM, Thorsten Kampe >> wrote: >> > >> > I'm trying to run a script with a different Python version by >> >

Re: Windows: subprocess won't run different Python interpreter

2016-11-11 Thread eryk sun
On Fri, Nov 11, 2016 at 8:56 AM, Thorsten Kampe wrote: > * eryk sun (Fri, 11 Nov 2016 06:23:50 +) >> >> That's the application directory, which is the first place >> CreateProcess looks (via the SearchPath call), as both of my examples >> shows. In my c

Re: Windows: subprocess won't run different Python interpreter

2016-11-11 Thread eryk sun
On Fri, Nov 11, 2016 at 10:46 AM, Thorsten Kampe wrote: > * eryk sun (Fri, 11 Nov 2016 09:55:23 +) >> >> If it works like cmd.exe, then it does its own search using %Path% >> and %PathExt%. For example: >> >> C:\>cmd /c "set "PATH=" &

Re: Windows: subprocess won't run different Python interpreter

2016-11-11 Thread eryk sun
On Fri, Nov 11, 2016 at 11:30 AM, Gisle Vanem via Python-list wrote: > Thorsten Kampe wrote: > >> My goal is to verify that other shells/interpreters on Windows work >> the same way as Python when running an application or creating a sub- >> process. Cmd does not. What's else there? I have Bash he

Re: Python does not start

2016-11-11 Thread eryk sun
On Fri, Nov 11, 2016 at 8:36 PM, Jelena Tavcar wrote: > > when I click on the icon "IDLE (Python 3.5 32-bit)" nothing happens. It > used to work and at some point it just didn't react. Try running IDLE from a command prompt by entering the following command: py -3.5-32 -m idlelib If this pr

Re: Python does not start

2016-11-11 Thread eryk sun
On Fri, Nov 11, 2016 at 9:38 PM, wrote: > It says that ’py-3.5-32-m’ is not recognized as an internal or external > command, operable program or batch file. There's supposed to be a space after "py". Let's add the .exe extension to make this clearer: py.exe -3.5-32 -m idlelib And please do

Re: Access to the caller's globals, not your own

2016-11-13 Thread eryk sun
On Mon, Nov 14, 2016 at 5:20 AM, Steven D'Aprano wrote: > but what magic do I need? globals() is no good, because it returns the > library's global namespace, not the caller's. > > Any solution ought to work for CPython, IronPython and Jython, at a minimum. You can access the globals of the calle

Re: if iter(iterator) is iterator

2016-11-13 Thread eryk sun
On Mon, Nov 14, 2016 at 6:25 AM, Serhiy Storchaka wrote: > On 14.11.16 02:40, Steve D'Aprano wrote: >> >> I'm surprised that the inspect module doesn't appear to have isiterable >> and isiterator functions. Here's my first attempt at both: > > Just use isinstance() with collections ABC classes. E

Re: Who owns the memory in ctypes?

2016-11-14 Thread eryk sun
On Tue, Nov 15, 2016 at 3:15 AM, Cem Karan wrote: > if my C code allocates memory via GC_MALLOC() (the standard call for > allocating memory > in the garbage collector), and I access some object via ctypes in python, > will the python > garbage collector assume that it owns it and attempt to dis

Re: __debug__ http://stackoverflow.com/questions/15305688

2016-11-16 Thread eryk sun
On Wed, Nov 16, 2016 at 8:39 AM, Steven D'Aprano wrote: > On Wednesday 16 November 2016 16:21, Veek M wrote: > >> Trying to make sense of that article. My understanding of debug was >> simple: >> 1. __debug__ is always True, unless -O or -OO >> 2. 'if' is optimized out when True and the expr is in

Re: Encountering fatal error x80070643 while installing Python

2016-11-18 Thread eryk sun
On Fri, Nov 18, 2016 at 5:55 PM, MRAB wrote: > On 2016-11-18 11:40, Irene Venditti wrote: >> >> This didn't seem to be a problem, since version 3.5.1 installed to my >> C:\Users\username\appdata\local\... directory. But when I tried to install >> Python 3.5.2 and uninstalled both previous versions

Re: IDLEX association

2016-11-18 Thread eryk sun
On Fri, Nov 18, 2016 at 7:09 PM, Dennis Lee Bieber wrote: > On Fri, 18 Nov 2016 04:46:46 -0800 (PST), Luis Marzulli > declaimed the following: > >>When I double click a .py file, a windows appears and immediately disappears. >>How can I associate the .py file extension to the IDLEX EDITOR? > >

Re: Numpy slow at vector cross product?

2016-11-21 Thread eryk sun
On Mon, Nov 21, 2016 at 1:38 AM, BartC wrote: > On 20/11/2016 20:46, DFS wrote: >> >> import sys, time, numpy as np >> loops=int(sys.argv[1]) >> >> x=np.array([1,2,3]) >> y=np.array([4,5,6]) >> start=time.clock() In Unix, time.clock doesn't measure wall-clock time, but rather an approximation to

Re: Numpy slow at vector cross product?

2016-11-22 Thread eryk sun
On Tue, Nov 22, 2016 at 1:06 PM, BartC wrote: >> In this specific example, the OP is comparing two radically different >> pieces of code that clearly and obviously perform differently. He's doing >> the equivalent of timing the code with his heartbeat, and getting 50 beats >> for one and 150 beats

Re: how do i fix this invalid arguement error

2016-11-27 Thread eryk sun
On Sat, Nov 26, 2016 at 5:55 PM, Dennis Lee Bieber wrote: > On Sat, 26 Nov 2016 08:12:46 -0800 (PST), junko...@gmail.com declaimed the > following: > >> with open('\\192.168.0.1\fe18cb0618cabd41\ninjatrader$EURUSDTestRun >> 2016-11-25-11-11.csv','r') as f: > > Second... does Python open() accept w

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-04 Thread eryk sun
On Sun, Dec 4, 2016 at 10:19 PM, BartC wrote: > > Command parameters /do/ behave differently between Windows and Linux, for > example try writing *.* as that third parameter. > > In Windows, it will print *.*. In Windows each program parses its own command line. Most C/C++ program

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread eryk sun
On Mon, Dec 5, 2016 at 3:41 PM, BartC wrote: > > Are you saying that if someone executes: > > subprocess.Popen(["python","a.py", "*"]) > > the output will be: ['a.py','*']? > > In that case forget Windows vs. Linux, you now have a program that will get > command parameters processed differently

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread eryk sun
On Mon, Dec 5, 2016 at 4:03 PM, Paul Moore wrote: > 2. On Windows, the OS primitive takes a command line. The application is > responsible for splitting it into arguments, if it wants to. Most do, for > compatibility with the normal argv convention inherited via C from Unix. Many > programs let t

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread eryk sun
On Mon, Dec 5, 2016 at 4:49 PM, Steve D'Aprano wrote: > > You've never used cmd.com or command.exe? "The DOS prompt"? The default Windows shell is "cmd.exe", and it's informally called the "Command Prompt", not "DOS Prompt". In Windows 9x it was accurate to say DOS prompt, since the shell was COM

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread eryk sun
On Tue, Dec 6, 2016 at 2:51 AM, Nathan Ernst wrote: > On Mon, Dec 5, 2016 at 8:44 PM, Steve D'Aprano > wrote: >> On Tue, 6 Dec 2016 10:09 am, eryk sun wrote: >> >> > The default Windows shell is "cmd.exe", and it's informally called the >> &

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread eryk sun
On Tue, Dec 6, 2016 at 12:26 PM, Chris Angelico wrote: > On Tue, Dec 6, 2016 at 10:56 PM, BartC wrote: >> In that directory (which was on Windows but accessible via a virtual Linux), >> typing any Linux command followed by * would have required all 3.4 million >> directory entries to be accessed

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread eryk sun
On Tue, Dec 6, 2016 at 3:05 PM, Random832 wrote: > > The fact that Windows was launched at boot by running "win.com" (either > in autoexec.bat or manually at the command line) created a *perception* > that windows ran "on top of DOS", but running it really *replaced* DOS > in memory, putting the C

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread eryk sun
On Wed, Dec 7, 2016 at 1:30 AM, Dennis Lee Bieber wrote: > (Bah... win10 seems to share parts of the PowerShell console config with > the old command prompt -- making it nearly impossible [at least in the > three days I've been on Win10 after the Win7 drive failed] to configure > PowerShell to loo

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread eryk sun
On Tue, Dec 6, 2016 at 10:35 PM, Nathan Ernst wrote: > One other consideration in regards to globbing in the argument list: > there's a static limit to the byte length of argv. On windows, it's 8191 > bytes (I'm assuming a null-terminator brings that to 8192, which is a weird > 2**13). I know str

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread eryk sun
On Wed, Dec 7, 2016 at 8:30 AM, Steven D'Aprano wrote: > > There are Windows programs which understand globs, like dir. Do you honestly > expect us to believe that it is okay to use "dir a*" on Windows because dir > itself expands the glob, but not okay to use "dir a*" on Linux because the > shell

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread eryk sun
On Wed, Dec 7, 2016 at 9:43 AM, Chris Angelico wrote: > Exactly. Back in the 1990s, we had the beginnings of Windows NT, which > was designed for servers. It had (if I recall correctly) no concept of > file/directory permissions, little or no notion of process privilege, > and definitely no way to

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread eryk sun
On Wed, Dec 7, 2016 at 12:39 PM, Chris Angelico wrote: > Note that two of the Beauty Stone tracks include quotes as well as > question marks. How do you identify those? Let's say you want to play > one of these in VLC, and then maybe you decide that the track in > Pirates of Penzance/MusicOnly is

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-08 Thread eryk sun
On Thu, Dec 8, 2016 at 4:34 PM, Grant Edwards wrote: > > So, to avoid _that_ problem, Windows command line apps and the cmd.exe > shell only allow "\" as a path separator. In cmd you can usually clarify the intent with quotes, e.g. `dir C:/Windows` fails because it parses "Windows" as a parameter

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-09 Thread eryk sun
On Fri, Dec 9, 2016 at 7:41 AM, Steve D'Aprano wrote: > Frankly, I think that Apple HFS+ is the only modern file system that gets > Unicode right. Not only does it restrict file systems to valid UTF-8 > sequences, but it forces them to a canonical form to avoid the é é gotcha, > and treats file n

Re: Install Problem

2016-12-13 Thread eryk sun
On Tue, Dec 13, 2016 at 8:37 PM, Rhesa Browning wrote: > I have been trying to install Python 3.5.2 onto my computer. I have > installed and > uninstalled and resinstalled several times. Every time I get an error message > saying that the python35.dll doesn't exist on my computer so it can't op

Re: Unicode script

2016-12-15 Thread eryk sun
On Thu, Dec 15, 2016 at 4:53 PM, Steve D'Aprano wrote: > Suppose I have a Unicode character, and I want to determine the script or > scripts it belongs to. > > For example: > > U+0033 DIGIT THREE "3" belongs to the script "COMMON"; > U+0061 LATIN SMALL LETTER A "a" belongs to the script "LATIN"; >

Re: Re: Install Problem

2016-12-15 Thread eryk sun
On Thu, Dec 15, 2016 at 8:24 PM, Rhesa Browning wrote: > I have not been able to find the temp folder. I am doing this on a work > computer > and don't have access to all the folders. Some are hidden. Enter %temp% in Explorer's location bar or the Win+R dialog. -- https://mail.python.org/mail

Re: ctypes, memory mapped files and context manager

2016-12-29 Thread eryk sun
On Thu, Dec 29, 2016 at 12:18 PM, Hans-Peter Jansen wrote: >> >>> import weakref, ctypes >> >>> T = ctypes.c_ubyte * 3 >> >>> t = T() >> >>> bytes(t) == b"\0" * 3 >> >> True >> >> >>> bytes(weakref.proxy(t)) == b"\0" * 3 >> >> Traceback (most recent call last): >> File "", line 1, in >> Attribu

Re: learning and experimenting python.

2016-12-30 Thread eryk sun
On Fri, Dec 30, 2016 at 7:49 PM, Michael Torrie wrote: > > Is there a special reason bourne shell uses $ and #? To me, "$" is for the [$]tandard shell prompt, and "#" noticeably distinguishes root shells. > Coming from an old DOS background (>) I found that rather jarring at first. DOS is a si

Re: Forcing prompt to be on newline when embedding Python with stdin/out redirection

2017-01-05 Thread eryk sun
On Thu, Jan 5, 2017 at 7:09 AM, H Krishnan wrote: > > I am working on embedding Python in my application. You forgot to tell us the version of Python that you're embedding. > I have redirected sys.stdin and sys.stdout to call methods from a Qt TextEdit > widget. Everything works fine except that

Re: Forcing prompt to be on newline when embedding Python with stdin/out redirection

2017-01-05 Thread eryk sun
On Fri, Jan 6, 2017 at 1:06 AM, H Krishnan wrote: > I tried replacing sys.displayhook with a function that does not print > newline but the newline still got inserted. So, I am not sure where the > newline is coming from. In any case, I could override sys.displayhook to add > a newline at the end

Re: Forcing prompt to be on newline when embedding Python with

2017-01-06 Thread eryk sun
On Thu, Jan 5, 2017 at 7:09 AM, H Krishnan wrote: > > I am working on embedding Python in my application. You forgot to tell us the version of Python that you're embedding. > I have redirected sys.stdin and sys.stdout to call methods from a Qt TextEdit > widget. Everything works fine except that

Re: Forcing prompt to be on newline when embedding Python with

2017-01-06 Thread eryk sun
On Fri, Jan 6, 2017 at 1:06 AM, H Krishnan wrote: > I tried replacing sys.displayhook with a function that does not print > newline but the newline still got inserted. So, I am not sure where the > newline is coming from. In any case, I could override sys.displayhook to add > a newline at the end

Re: Python 3.6 Installation

2017-01-18 Thread eryk sun
On Wed, Jan 18, 2017 at 6:23 AM, Terry Reedy wrote: > Not everyone has run Windows update since the current runtime was released. Python's installer tries (and sometimes fails) to install the KB2999226 update, which installs an old version of the Universal CRT. Some installers instead bundle the

Re: PEP 393 vs UTF-8 Everywhere

2017-01-21 Thread eryk sun
On Sat, Jan 21, 2017 at 8:21 PM, Pete Forman wrote: > Marko Rauhamaa writes: > >>> py> low = '\uDC37' >> >> That should raise a SyntaxError exception. > > Quite. My point was that with older Python on a narrow build (Windows > and Mac) you need to understand that you are using UTF-16 rather than

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread eryk sun
On Sat, Jan 28, 2017 at 8:03 AM, Steve D'Aprano wrote: > print('shutil:', shutil.get_terminal_size(fallback=(999, 999))) > print('os:', os.get_terminal_size(0)) [snip] > But if I pipe the output to something else, the shutil version fails to > determine the correct terminal size, and falls back on

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread eryk sun
On Sat, Jan 28, 2017 at 5:58 PM, Chris Angelico wrote: > Processes in the middle of pipelines *do not have* terminals. No, in the following case stderr is a terminal: $ echo spam | > python3 -c 'import os > print(os.get_terminal_size(2))' | > cat os.terminal_size(columns=132,

Re: Is shutil.get_terminal_size useless?

2017-01-29 Thread eryk sun
On Mon, Jan 30, 2017 at 2:16 AM, Steve D'Aprano wrote: > On Mon, 30 Jan 2017 08:12 am, Serhiy Storchaka wrote: > >> On 28.01.17 10:03, Steve D'Aprano wrote: >>> Is shutil.get_terminal_size useless? When, if ever, should I use it in >>> preference to the os version? If the shutil version is broken,

Re: best way to ensure './' is at beginning of sys.path?

2017-02-04 Thread eryk sun
On Sat, Feb 4, 2017 at 3:19 PM, Wildman via Python-list wrote: > > Personally I don't understand the danger in having the dot in the path. The > './' only > means the current directory. DOS and Windows has searched the current > directory > since their beginning. Is that also dangerous? On W

Re: Console

2018-03-07 Thread eryk sun
On Wed, Mar 7, 2018 at 2:41 PM, Jeremy Jamar St. Julien wrote: > I had an problem when trying to start the python GUI. It said there was a > subprocess startup > error. I was told to start IDLE in a console with idlelib and see what python > binary i was > runnning IDLE with. Im using windows 10

Re: Console

2018-03-07 Thread eryk sun
On Wed, Mar 7, 2018 at 7:59 PM, bartc wrote: > On 07/03/2018 15:34, Wolfgang Maier wrote: >> >> On 03/07/2018 03:41 PM, Jeremy Jamar St. Julien wrote: >>> >>> I had an problem when trying to start the python GUI. It said there was a >>> subprocess startup error. I was told to start IDLE in a conso

Re: Python aliases under Windows?

2018-04-03 Thread eryk sun
On Tue, Apr 3, 2018 at 3:43 PM, Ian Kelly wrote: > > Because py.exe is really meant to solve a slightly different problem. > On Unix if you have a .py script and you run it directly, without > specifying which interpreter to use, the convention is to start the > script with a shebang line, and the

Re: Python aliases under Windows?

2018-04-03 Thread eryk sun
On Tue, Apr 3, 2018 at 8:16 PM, Kirill Balunov wrote: > > will `py -3.6 ...` work if Python36 is not on the Path? Yes, by default it will work. When installed for all users, the launcher is installed in the Windows directory. For a per-user install, the launcher is installed in a subdirectory of

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread eryk sun
On Thu, Apr 12, 2018 at 11:25 PM, Gregory Ewing wrote: > > To get around this, you may need to declare the return type > as POINTER(c_char) instead: > >> For a general character pointer that may also point to binary data, > >> POINTER(c_char) must be used. > > I'm not sure where to go from here, t

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread eryk sun
On Fri, Apr 13, 2018 at 12:38 AM, Jach Fong wrote: > Gregory Ewing at 2018/4/13 上午 07:25 wrote: > >> To get around this, you may need to declare the return type >> as POINTER(c_char) instead: >> >>> For a general character pointer that may also point to binary data, >> >> > POINTER(c_char) must b

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-13 Thread eryk sun
On Fri, Apr 13, 2018 at 8:44 AM, Jach Fong wrote: > > After studying the example you explained in your previous post replied to > Gregory Ewing, I had noticed that until today I was totally misunderstand > the meaning of the c_char_p. I always think it "is" a pointer, but actually > it's just a ct

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-13 Thread eryk sun
On Sat, Apr 14, 2018 at 1:57 AM, Jach Fong wrote: > eryk sun at 2018/4/14 PM 05:27 wrote: > >> The simple types c_void_p, c_char_p, and c_wchar_p are pointers. >> However, since they subclass _SimpleCData instead of _Pointer, they >> inherit the behavior of simple types.

Re: how to set timeout for os.popen

2018-04-16 Thread eryk sun
On Mon, Apr 16, 2018 at 1:33 PM, Jugurtha Hadjar wrote: > On 04/15/2018 12:01 PM, Ho Yeung Lee wrote: >> >> while 1: >> runner = os.popen("tracert -d www.hello.com") >> o=runner.read() >> >> how to set timeout and know that this is timeout? > > @contextmanager > def timeout(duration, handler): >

Re: python 3 creating hard links on ntfs

2018-04-18 Thread eryk sun
On Wed, Apr 18, 2018 at 8:06 PM, wrote: > Is it possible to create hard links on windows with ntfs? > On linux I can use os.link, but how about windows? Windows support was added for os.link years ago in version 3.2. Internally it's implemented via WinAPI CreateHardLink, which in turn calls NTAP

Re: Why exception from os.path.exists()?

2018-06-01 Thread eryk sun
On Fri, Jun 1, 2018 at 3:58 PM, Richard Damon wrote: > > The fundamental question is about case 2. Should os.path.exist, having > been give a value of the right 'Python Type' but not matching the type > of the operating system parameter identify this as an error (as it > currently does), or should

Re: Why exception from os.path.exists()?

2018-06-01 Thread eryk sun
On Sat, Jun 2, 2018 at 12:14 AM, Steven D'Aprano wrote: > > It isn't even a set of minimum requirements. "<" is legal under POSIX, > but not Windows. "<" (i.e. the DOS_STAR wildcard character) is valid in device and stream names. It's only invalid in filenames, since it's reserved for wildcard ma

Re: Why exception from os.path.exists()?

2018-06-04 Thread eryk sun
On Sat, Jun 2, 2018 at 11:28 AM, Chris Angelico wrote: > > I also can't find anything about path names there. What does POSIX say > about the concept of relative paths? Does Windows comply with that? Certainly Windows file-system paths are not POSIX compatible. Seven path types are supported: *

Re: Why exception from os.path.exists()?

2018-06-05 Thread eryk sun
On Tue, Jun 5, 2018 at 3:28 PM, Peter J. Holzer wrote: > > Now, if MacOS uses something like that, this is a different matter. > Presumably (since HFS+ is a native file system) the kernel deals with > NUL characters in a straightforward manner. It might even have a > (non-POSIX) API to expose such

Re: Why exception from os.path.exists()?

2018-06-08 Thread eryk sun
On Fri, Jun 8, 2018 at 11:35 AM, Steven D'Aprano wrote: > > (referring to both the NUL bytes in UTF-16 encoded NTFS file names, and > the lack of NUL bytes in common Linux file names). NTFS filenames are stored as wchar_t strings, for which NUL is L"\x00\x00". Individual null bytes are irrelevant

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sat, Jun 30, 2018 at 11:21 AM, Chris Angelico wrote: > On Sat, Jun 30, 2018 at 9:05 PM, Sharan Basappa > wrote: >> >> 0 >> down vote >> favorite >> >> I need to change directory to my local working directory in windows and then >> open a file for processing. >> Its just a 3 lines code, as bel

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sat, Jun 30, 2018 at 11:42 PM, Chris Angelico wrote: > On Sun, Jul 1, 2018 at 9:36 AM, eryk sun wrote: >> On Sat, Jun 30, 2018 at 11:21 AM, Chris Angelico wrote: >>> On Sat, Jun 30, 2018 at 9:05 PM, Sharan Basappa >>> wrote: >>>> >>>>

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sun, Jul 1, 2018 at 1:58 AM, Chris Angelico wrote: > On Sun, Jul 1, 2018 at 10:20 AM, eryk sun wrote: >> On Sat, Jun 30, 2018 at 11:42 PM, Chris Angelico wrote: >>> "Legacy" implies that it's the old standard that is now deprecated, >> >> I did no

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sun, Jul 1, 2018 at 2:28 AM, Chris Angelico wrote: > On Sun, Jul 1, 2018 at 12:22 PM, eryk sun wrote: >>> So what if, internally, that's done by converting them to backslashes? >>> No Python program needs to care. In fact, there are other conversions, >>>

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sun, Jul 1, 2018 at 1:44 AM, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 23:36:40 +0000, eryk sun wrote: > >> Only use forward slashes for legacy DOS paths passed to Windows API >> functions. Do not use forward slashes for paths in command line >> arguments, \\?

Re: error in os.chdir

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 8:50 AM, Steven D'Aprano wrote: > On Sun, 01 Jul 2018 03:18:23 +0000, eryk sun wrote: > >> The Windows API handles this, but not for a path that begins with \\?\. > > But what about the *Python* API? The Python open() function, and all the > h

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 8:51 AM, Steven D'Aprano wrote: > On Sun, 01 Jul 2018 03:18:23 +0000, eryk sun wrote: > >> Bear in mind that forward slash is just a name character in NT. > > So, using Python, how could you open, write to, and then read from, a > file wit

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 4:00 PM, Abdur-Rahmaan Janhangeer wrote: > one common scenario is > > C:\Users\ > > where \U is taken as a unicode litteral This one is especially annoying in Python 2, since it makes raw unicode strings useless for common path literals. For example

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 4:30 PM, eryk sun wrote: > On Sun, Jul 1, 2018 at 8:51 AM, Steven D'Aprano > >> spam/eggs [...] >> And how would that file be displayed in the Windows GUI file explorer? > > I suppose if a file system allowed forward slash in names that >

Re: RANT why the *%#&%^ does installing pip not install setuptools???

2018-07-05 Thread eryk sun
On Thu, Jul 5, 2018 at 5:37 PM, Steven D'Aprano wrote: > I'm trying to install pip on a Linux Mint box. The maintainers of Mint > (or possibly their upstream distro, Ubuntu) decided in their infinite > wisdom to remove the ensurepip package, so > > python3 -m ensurepip In Debian distros, a cu

Re: copy and paste with a program called clipboard

2018-07-19 Thread eryk sun
On Thu, Jul 19, 2018 at 6:49 PM, wrote: > On Thu, 19 Jul 2018 17:35:24 +0100, MRAB > wrote: > >>I'm assuming you're using Windows. >> >>It might be that the console window's properties need changing: >> >>1. Right-click on the title bar. >> >>2. Click on Properties. >> >>3. In the Options tab, t

Re: copy and paste with a program called clipboard

2018-07-19 Thread eryk sun
On Thu, Jul 19, 2018 at 5:42 PM, Terry Reedy wrote: > > What happens when you right click depends on the program you are interacting > with. When you select and right-click in the current Windows 10 console, > used for Command Prompt, PowerShell, Python, and other programs, the > selection disapp

Re: curses, ncurses or something else

2018-07-23 Thread eryk sun
On Mon, Jul 23, 2018 at 10:24 PM, John Pote wrote: > > So I thought it might be quick and easy to do something with curses to keep > the title line visable while the numbers roll up the screen. But alas I'm a > Windows user and the 'curses' module is not in the Windows standard library > for Pytho

Re: why doesn't an mmap.mmap object have some kind of memoryview method?

2018-08-05 Thread eryk sun
On Sun, Aug 5, 2018 at 11:28 PM, Cameron Simpson wrote: > > It seems obvious to me that a method returning a memoryview of the mapped > file would be very handy here: no data copies at all, and not even any I/O > unless the data are accessed. But I see no such method in the document

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread eryk sun
On Wed, Aug 15, 2018 at 9:22 AM, Thomas Jollans wrote: > > If you really want to, you can pass a *single* argument in your #! line, > e.g.: > > #!/usr/bin/python3 -Wd This works for options that can be grouped into a single argument. Multiple -X options aren't supported, nor is combining a -X opt

Re: Cross platform mutex to prevent script running more than instance?

2018-09-06 Thread eryk sun
On Tue, Sep 4, 2018 at 5:47 PM, Cameron Simpson wrote: > > The downside with mkdir, and also with pd files really, is that a program or > OS abort can leave them lying around. Being persistent objects, some kind of > cleanup is needed. While the OP needs a cross-platform solution, if it's just Wi

Re: missing- api-ms-win-crt-runtime-|1-1-0.dll

2018-09-18 Thread eryk sun
On Tue, Sep 18, 2018 at 11:45 AM, Chandan Kumar Abhimanyu wrote: > how I download and install api-ms-win-crt-runtime-|1-1-0.dll when I am > downloading by googling it is not installable file. The Universal C Runtime (CRT) is an OS component for Windows Vista and later. Make sure Windows Upda

Re: missing- api-ms-win-crt-runtime-|1-1-0.dll

2018-09-18 Thread eryk sun
On Tue, Sep 18, 2018 at 1:43 PM, Gene Heskett wrote: > > > > So apparently the | is a legal filename component, to a windows box. "l1-1-0" starts with "l" (ordinal 0x6c, i.e. lower-case "L"), no

Re: From Mathematica to Jypyter

2018-10-11 Thread eryk sun
On Thu, Oct 11, 2018 at 4:10 AM Thomas Jollans wrote: > > On 2018-10-11 10:48, jfine2...@gmail.com wrote: > > It is fun to find fault in the work of a new Nobel laureate. In this case, > > a typo. > > Not a Nobel laureate. It's not a Nobel prize. More precisely it's the Nobel Memorial Prize in E

Re: PEP 394

2018-10-21 Thread eryk sun
On 10/20/18, Terry Reedy wrote: > > On Windows, there is a better solution: the py launcher. > > py # launches the most most recent version installed* > > py -x # launches the most recent x.y > > py -x.y # launches x.y if installed, else lists installed versions > > * At first, 2.x took

Re: Windows file associations fix

2018-11-09 Thread eryk sun
On 11/9/18, David Raymond wrote: > > And why does the Python installer have a check box for "Associate files with > Python" if it then promptly proceeds to destroy all those associations? > Could we maybe get that part of the installer fixed for future versions? The installer configures the HKCR

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread eryk sun
On Sat, Apr 16, 2016 at 8:30 PM, Tim Chase wrote: > On 2016-04-16 19:39, eryk sun wrote: >> On Sat, Apr 16, 2016 at 4:50 PM, Tim Chase wrote: >> > I also do some editing/diffing within a cmd.exe window on Windows >> > which is limited to 80 characters unless you

<    1   2   3   4   5   6   7   >