RE: problems installing Python 3.11

2023-08-11 Thread Bernd Lentes via Python-list
>-Original Message- >From: Python-list muenchen...@python.org> On Behalf Of Bernd Lentes via Python-list >Sent: Friday, August 11, 2023 12:01 PM >To: Terry Reedy >Cc: Python ML (python-list@python.org) >Subject: RE: problems installing Python 3.11 Hi, I read the

RE: problems installing Python 3.11

2023-08-11 Thread Bernd Lentes via Python-list
>-Original Message- >From: Terry Reedy >Sent: Thursday, August 10, 2023 9:55 PM >To: Bernd Lentes >Subject: Re: problems installing Python 3.11 > >On 8/10/2023 3:28 PM, Bernd Lentes via Python-list wrote: > >Private response because cannot post at present. >

Re: Problems Installing and getting started.

2023-05-31 Thread Richard Damon
How are you trying to “Open” python? If you get that option screen, that sounds like you are trying to run the installer again. Knowing your Operating System would be very helpful. Python is normally run from the command line, or since you have the PyCharm IDE, it can run python on the program

Re: problems in using libraries

2023-04-03 Thread Thomas Passin
On 4/3/2023 1:25 PM, pranavbhardwaj...@gmail.com wrote: Sent from [1]Mail for Windows Why can't I able to use python libraries in my python 3.11.2. It always throw an error such as and and many more. I installed python from python official website and I i

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-14 Thread darkstone
Dear list, >>So please check that you are running the right version of Python when >>you type "python". If i type “python”, it is C:\>python -V Python 3.11.0 Von: Thomas Passin Gesendet: ‎Sonntag‎, ‎13‎. ‎November‎ ‎2022 ‎16‎:‎18 An: darkst...@o2online.de On 11/13/2022

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-12 Thread Eryk Sun
On 11/12/22, darkst...@o2online.de wrote: > import _tkinter > Traceback (most recent call last): > File "", line 1, in > ImportError: DLL load failed while importing _tkinter: Das angegebene Modul > wurd > e nicht gefunden. Loading the extension module "_tkinter.pyd" tries to load two TCL

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-12 Thread Thomas Passin
On 11/12/2022 11:48 AM, darkst...@o2online.de wrote: Hello Thomas, there is a “_tkinter.pyd” in the *.dll Directory. Is there something more, I can check? Yes, look in the "Lib" (NOT "libs") subdirectory of the Python tree and see if it has a subdirectory named "tkinter". That's where it is

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-12 Thread Thomas Passin
All right, now let's verify that tk is not there (otherwise it might be there but corrupted or not loadable for some reason). Open Windows Explorer and navigate it to the Python directory as I described in my last message. The navigate to the subdirectory named "DLLs". If tkinter is installed

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-11 Thread Eryk Sun
On 11/11/22, darkst...@o2online.de wrote: > > What can I do for the next step to find, why IDLE isn’t working? The question is why tkinter isn't working. IDLE not working is just a symptom of the underlying problem. In the command prompt, run 32-bit Python 3.10 via `py -3.10-32`. In Python's inte

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-09 Thread Thomas Passin
Sorry about the typo at the end. If you need to search the entire disk, use this command instead of the one I had in my last post: where /R c:\ python.exe On 11/9/2022 9:00 PM, Thomas Passin wrote: On 11/9/2022 7:02 PM, darkst...@o2online.de wrote: Is there no one who can help? Is there a

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-09 Thread Eryk Sun
On 11/9/22, darkst...@o2online.de wrote: > Is there no one who can help? If you can't run IDLE via `py -3.10-32 -m idlelib`, then something isn't installed properly. You reported an error that IDLE fails to load because importing tkinter fails. Did you try `import tkinter` in the REPL? tkinter de

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-09 Thread Dennis Lee Bieber
On Thu, 10 Nov 2022 00:02:44 +, declaimed the following: >Is there no one who can help? > Your problem description isn't detailed enough to even guess what you are finding incorrect. If you are on Windows, once you've done an install, shove the installer file off into some a

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-09 Thread Thomas Passin
On 11/9/2022 7:02 PM, darkst...@o2online.de wrote: Is there no one who can help? Is there a reason why you tried to install a 32-bit version? Most personal computers are 64-bit ones these days. Also, I don't remember if you are running Windows or not. One problem for getting help from the

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-09 Thread darkstone
Is there no one who can help? Von: darkst...@o2online.de Gesendet: ‎Freitag‎, ‎4‎. ‎November‎ ‎2022 ‎15‎:‎10 An: Eryk Sun Cc: python-list@python.org Yes, there is always the message “modified successfull”, “installed sucessfully”, but IDLE does’t start. I tried it with the newer Version

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-04 Thread darkstone
Yes, there is always the message “modified successfull”, “installed sucessfully”, but IDLE does’t start. I tried it with the newer Version, too. Ist 3.11.0 for 32 bit, but it also doesn’t work. Do you have other suggetions, that it works? Von: Eryk Sun Gesendet: ‎Donnerstag‎, ‎3‎. ‎Novemb

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-03 Thread Eryk Sun
On 11/3/22, darkst...@o2online.de wrote: > Is there a reason, why it is not installed? Its the same check mark in the > installer like IDLE… Did you try what I suggested? Modify the installation to remove the tkinter/IDLE component. Then modify it again to select the component to be reinstalled.

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-01 Thread Eryk Sun
On 11/1/22, Nithish Ramasamy wrote: > > pip install tkinter > Wait some minutes to install tkinter There is no tkinter package on PyPI. It's part of the standard library and included with the python.org installer as an optional component. -- https://mail.python.org/mailman/listinfo/python-list

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-11-01 Thread Eryk Sun
On 11/1/22, darkst...@o2online.de wrote: > > **IDLE can’t Import TKINTER > > Python may not be configured for TK** > > Checkmark for TK is set in the Installation Progress. What went wrong and ho > can I fix it? Run the following command to check whether the ImportError has any further informatio

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-10-31 Thread Eryk Sun
On 10/31/22, darkst...@o2online.de wrote: > > I installed the Standard Distribution from python.org again, and i ensured, > that the checkmark test Suite is enabled. Idle does’nt start. The installer > says “Installation successfully” at the end. > > What went wrong and how can I further delimit t

Re: Problems with IDLE in Windows 8.1 and installer x86 Version 3.10.8

2022-10-31 Thread Eryk Sun
On 10/31/22, darkst...@o2online.de wrote: > > i uninstalled this, because my Idle doesn’t start by clicking on the Icon. > Are there any Solutions for the problem? If it's the standard distribution from python.org, run the installer again, and ensure that the test suite is installed. In 3.10.8,

Re: Problems with Python

2022-05-31 Thread dn
On 01/06/2022 00.00, Howard Samuels via Python-list wrote: > Good day > I am new to programming.  I have signed up for a virtual online course and > installed Python using Anaconda as well as jupyter notebook. I encountered > problems & then went to YouTube tried going directly to the python webs

Re: Problems with Python

2022-05-31 Thread Howard Samuels via Python-list
Good day I am new to programming.  I have signed up for a virtual online course and installed Python using Anaconda as well as jupyter notebook. I encountered problems & then went to YouTube tried going directly to the python website and used Pycharm. When I used pycharm and try to run the first

Re: Problems with running Python in Npp

2021-09-09 Thread Dennis Lee Bieber
On Wed, 8 Sep 2021 21:54:14 -0400, Ricardo declaimed the following: > Hey Python and crew I'm having difficulties installing and running Python > on my computer. I've seen plenty YouTube videos on how to set it up, but > none of them have worked. Any help or guidance will be greatly > app

Re: Problems deploying from poetry development environment

2021-04-26 Thread Loris Bennett
"Loris Bennett" writes: > Hi, > > I am developing using poetry and deploying to a directory on an NFS > server. The steps I have been using are > > 1. poetry build > 2. poetry install > 3. PYTHONUSERBASE=/my/nfs/dir pip3 install --user > ~/git/funky_prog/dist/funky_prog-0.2.0-py3-none-any

Re: Problems with tool tips...

2020-08-04 Thread Terry Reedy
On 8/3/2020 5:57 PM, Steve wrote: Python/IDLE How do I get rid of the "suggestion" box tool tips AFAIK, you are the first person to request this, though perhaps not the first to think it. Escape closes the box. that always blocks the work I need to see when writing code? AFAIK, the popu

Re: Problems with python383.dll

2020-06-17 Thread Michael Torrie
On 6/16/20 11:18 AM, Manuel Fernandez - Università wrote: > Dear Sirs, > I tried to install the software Python 3.8.3 (32 bit), but after it > finished and I tried to start it, there appeared a message in which it > was written that it couldn't find the file python383.dll and stopped. > What can

Re: Problems with Python install on Windows 10

2020-01-13 Thread Eryk Sun
On 1/13/20, Mike Weaver wrote: > > I've tried downloading from https://www.python.org/downloads/windows/ > (the Windows x86-64 executable installer > ) > and running that. Again says it is installed - but it clearly isn't. Maybe you

Re: Problems with "Tarfile.close()"

2019-12-21 Thread Barry
> On 20 Dec 2019, at 15:31, Dr Rainer Woitok wrote: > > Greetings, > > One of my Python scripts basically does the following: > > source = tarfile.open(name=tar_archive , mode='r|*') > dest = tarfile.open(fileobj=sys.stdout, mode='w|', format=fmt) > > . > . > . > > source.close() > dest

Re: Problems with "Tarfile.close()"

2019-12-21 Thread Dr Rainer Woitok
Chris, On Saturday, 2019-12-21 06:45:24 +1100, you wrote: > ... > This construct can be simplified down to: > > stdout = getattr(sys.stdout, "buffer", sys.stdout) Nice! And with my admittedly trivial test case it correctly works under both, Python 2 and Python 3. Now I'll do some more serious

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Chris Angelico
On Sat, Dec 21, 2019 at 6:13 AM Peter Otten <__pete...@web.de> wrote: > > Dr Rainer Woitok wrote: > > > Ethan, > > > > On Friday, 2019-12-20 07:41:51 -0800, you wrote: > > > >> ... > >> In Python 3 `sys.stdout` is a character interface, not bytes. > > > > Does that mean that with Python 3 "Tarfile

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Peter Otten
Dr Rainer Woitok wrote: > Ethan, > > On Friday, 2019-12-20 07:41:51 -0800, you wrote: > >> ... >> In Python 3 `sys.stdout` is a character interface, not bytes. > > Does that mean that with Python 3 "Tarfile" is no longer able to write > the "tar" file to a pipe? Or is there now another wa

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Dr Rainer Woitok
Ethan, On Friday, 2019-12-20 07:41:51 -0800, you wrote: > ... > In Python 3 `sys.stdout` is a character interface, not bytes. Does that mean that with Python 3 "Tarfile" is no longer able to write the "tar" file to a pipe? Or is there now another way to write to a pipe? And if that new

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Ethan Furman
On 12/20/2019 04:19 AM, Dr Rainer Woitok wrote: One of my Python scripts basically does the following: source = tarfile.open(name=tar_archive , mode='r|*') dest = tarfile.open(fileobj=sys.stdout, mode='w|', format=fmt) . . . source.close() dest.close() In an attempt to move my Pytho

Re: Problems with "Tarfile.close()"

2019-12-20 Thread Chris Angelico
On Sat, Dec 21, 2019 at 2:29 AM Dr Rainer Woitok wrote: > > Greetings, > > One of my Python scripts basically does the following: > > source = tarfile.open(name=tar_archive , mode='r|*') > dest = tarfile.open(fileobj=sys.stdout, mode='w|', format=fmt) > > . > . > . > > source.close() > dest.

Re: Problems with wxPython _core_.pyd on windows98

2018-08-03 Thread Thomas Jollans
On 02/08/18 18:02, Wanderer wrote: I have a laptop with windows 98 I use to connect to the OBD2 port on my car. I'm trying to install pyobd. I have a build for Python 2.7 for Windows98 that works but I'm having trouble with running wxPython. I get the following error. I'm sure you have your rea

Re: Problems with wxPython _core_.pyd on windows98

2018-08-02 Thread Wanderer
On Thursday, August 2, 2018 at 12:03:01 PM UTC-4, Wanderer wrote: > I have a laptop with windows 98 I use to connect to the OBD2 port on my car. > I'm trying to install pyobd. I have a build for Python 2.7 for Windows98 that > works but I'm having trouble with running wxPython. I get the followin

Re: Problems with imports on multiple threads, with embedded Python

2018-01-04 Thread dieter
geoff.ba...@gmail.com writes: > I have a multithreaded application using an embedded Python 3.6.4 (upgraded > from 3.6.2 today in the hope that the problem was now solved: it doesn't seem > to be). The standard library is in a zip file. So long as only one thread is > running Python at a time i

Re: Problems with imports on multiple threads, with embedded Python

2017-12-21 Thread geoff . bache
On Thursday, 21 December 2017 00:33:54 UTC+1, Lawrence D’Oliveiro wrote: > On Thursday, December 21, 2017 at 5:13:33 AM UTC+13, geoff...@gmail.com wrote: > > > > I have a multithreaded application using an embedded Python 3.6.4 ... > > Avoid multithreading if you can. Is your application CPU-bou

Re: problems with Methods in Python 3.4.2

2017-09-25 Thread MRAB
On 2017-09-25 23:17, claudemirxavie...@gmail.com wrote: Traceback (most recent call last): File "", line 1, in nome = input("Digite seu nome:") File "", line 1, in NameError: name 'rick' is not defined Estou com esse problema alguem me ajuda pfvr It looks like what you would get

Re: problems with Methods in Python 3.4.2

2017-09-25 Thread claudemirxavier49
Traceback (most recent call last): File "", line 1, in nome = input("Digite seu nome:") File "", line 1, in NameError: name 'rick' is not defined >>> Estou com esse problema alguem me ajuda pfvr -- https://mail.python.org/mailman/listinfo/python-list

Re: problems installing library (xlsxwriter)

2017-05-31 Thread MRAB
On 2017-06-01 03:35, teni...@g.clemson.edu wrote: I've in need of using xlsxwriter. when running "pip install xlsxwriter" in my command prompt I get the following: "Requirement already satisfied: xlsxwriter in c:\programdata\anaconda3\lib\site-packages" But when running "import xlsxwriter" I g

Re: Problems

2017-05-04 Thread justin walters
On Thu, May 4, 2017 at 4:42 AM, aohK euqsarraT wrote: > I have been using pycharm + python 3.6 for a year and then i updated > pycharm, that was when things became a super buggy mess. I tried to > reinstall everything from scratch but the python installation keeps having > the previous wrong path

Re: problems installing pylab

2017-02-22 Thread breamoreboy
On Tuesday, February 21, 2017 at 3:55:40 PM UTC, Robert William Lunnon wrote: > Dear Python > > I am trying to install pylab alongside python 3.6. However when I type > > python -m pip install pylab > > I get the message > > No module named site > > In the documentation [documentation for inst

Re: problems installing pylab

2017-02-21 Thread Terry Reedy
On 2/21/2017 10:47 AM, Robert William Lunnon wrote: I am trying to install pylab alongside python 3.6. On Windows 10 as you said at the bottom. However when I type python -m pip install pylab Try py -3.6 -m pip install pylab The '.6' should not be needed, but will make the command fail

Re: Problems with scripts

2017-02-13 Thread Steve D'Aprano
On Tue, 14 Feb 2017 03:30 am, lauren.sophia1...@gmail.com wrote: > Hello! I have 2 python assignments that I just can't figure out. The first > one returns the same thing no matter what I input and the second won't > accept "done" to stop the program and return answers. Please help! Hi Lauren, B

Re: Problems with scripts

2017-02-13 Thread Wildman via Python-list
On Mon, 13 Feb 2017 10:08:11 -0800, Lauren Fugate wrote: > So I tried both of these and they didn't change anything, the python shell > printed the same things... The first assignment is overly complicated. The extra input functions are useless. There is no loopback to check the input. Also,

Re: Problems with scripts

2017-02-13 Thread alister
On Mon, 13 Feb 2017 10:08:11 -0800, Lauren Fugate wrote: > So I tried both of these and they didn't change anything, the python > shell printed the same things... No answers (answering you homework for you will not teach you anything useful) but some hints to help you think about the problem 1)

Re: Problems with scripts

2017-02-13 Thread Lauren Fugate
So I tried both of these and they didn't change anything, the python shell printed the same things... -- https://mail.python.org/mailman/listinfo/python-list

Re: Problems with scripts

2017-02-13 Thread Lauren Fugate
So I changed my code to this: print("How old are you: 17, 18, 19, or 20?") answer = input("> ") if int(answer) == 17 or 18 or 19 or 20: print("Wow, you are old!") else: print("You just can't follow drections, can you? Choose either 17, 18, 19, or 20.") input("> ") and now if I in

Re: Problems with scripts

2017-02-13 Thread Wildman via Python-list
On Mon, 13 Feb 2017 08:30:32 -0800, lauren.sophia1998 wrote: > Hello! I have 2 python assignments that I just can't figure out. The first > one returns the same thing no matter what I input and the second won't accept > "done" to stop the program and return answers. Please help! > > 1) > print

Re: Problems with scripts

2017-02-13 Thread Joel Goldstick
On Mon, Feb 13, 2017 at 11:30 AM, wrote: > Hello! I have 2 python assignments that I just can't figure out. The first > one returns the same thing no matter what I input and the second won't accept > "done" to stop the program and return answers. Please help! > > 1) > print("How old are you: 17

Re: Problems with scp script in Python

2017-02-13 Thread Steve D'Aprano
On Mon, 13 Feb 2017 11:17 pm, jhlo...@gmail.com wrote: > I have an SCP script that auto completes just fine from the terminal > window in Pi.  When I use either subprocess or os to try and have it run > under Python it does not do the file transfer from Pi to my Ubuntu > machine.  What am I doing

Re: Problems with scp script in Python

2017-02-13 Thread Michael Torrie
On 2017-02-13 05:17 AM, jhlo...@gmail.com wrote: I have an SCP script that auto completes just fine from the terminal window in Pi. When I use either subprocess or os to try and have it run under Python it does not do the file transfer from Pi to my Ubuntu machine. What am I doing wrong? He

RE: Problems with scp script in Python

2017-02-13 Thread Joaquin Alzola
>I have an SCP script that auto completes just fine from the terminal window in >Pi. When I use either subprocess or os to try and have it run under Python it >does not do the file >transfer from Pi to my Ubuntu machine. What am I doing >wrong? Here is the script: >from subprocess import cal

Re: Problems with python3.6 on one system, but OK on another

2017-01-23 Thread dieter
Cecil Westerhof writes: > I build python3.6 on two systems. On one system everything is OK: > Python 3.6.0 (default, Jan 21 2017, 11:19:56) > [GCC 4.9.2] on linux > Type "help", "copyright", "credits" or "license" for more information. > > > But on another I get: > Could not find platform depend

Re: Problems with read_eager and Telnet

2016-11-03 Thread kenansharon
On Monday, 28 February 2011 10:54:56 UTC-5, Robi wrote: > Hi everybody, > I'm totally new to Python but well motivated :-) > > I'm fooling around with Python in order to interface with FlightGear > using a telnet connection. > > I can do what I had in mind (send some commands and read output fr

Re: Problems using celery and pyelasticsearch

2015-12-10 Thread nonami
On 07/12/2015 02:50, Laura Creighton wrote: In a message of Mon, 07 Dec 2015 02:37:15 +0100, nonami writes: Does anyone have any idea what could be going on or how I can further inspect running tasks. Not sure this will help, but it might ... https://www.caktusgroup.com/blog/2013/10/30/using

Re: Problems using celery and pyelasticsearch

2015-12-06 Thread Laura Creighton
In a message of Mon, 07 Dec 2015 02:37:15 +0100, nonami writes: >Does anyone have any idea what could be going on or how I can further >inspect running tasks. Not sure this will help, but it might ... https://www.caktusgroup.com/blog/2013/10/30/using-strace-debug-stuck-celery-tasks/ Laura --

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-17 Thread Dave Farrance
Steven D'Aprano wrote: >On Mon, 16 Nov 2015 05:15 pm, Gregory Ewing wrote: > >> Ints are not the only thing that // can be applied to: >> >> >>> 1.0//0.01 >> 99.0 > >Good catch! Hmmm. I see that the float for 0.01 _is_ slightly larger than 0.01 >>> Decimal(0.01) Decimal('0.012

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-16 Thread Chris Angelico
On Tue, Nov 17, 2015 at 12:17 AM, Steven D'Aprano wrote: > On Sun, 15 Nov 2015 01:23 pm, Chris Angelico wrote: > >> On Sun, Nov 15, 2015 at 1:08 PM, Steven D'Aprano >> wrote: >>> number = +raw_input("enter a number: ") >>> >>> versus: >>> >>> text = raw_input("enter a number: ") >>> try: >>>

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-16 Thread Steven D'Aprano
On Sun, 15 Nov 2015 01:23 pm, Chris Angelico wrote: > On Sun, Nov 15, 2015 at 1:08 PM, Steven D'Aprano > wrote: >> number = +raw_input("enter a number: ") >> >> versus: >> >> text = raw_input("enter a number: ") >> try: >> number = float(text) >> except ValueError: >> number = int(text) >

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-16 Thread Steven D'Aprano
On Mon, 16 Nov 2015 05:15 pm, Gregory Ewing wrote: > Ian Kelly wrote: >> Unary integer division seems pretty silly since the only possible results >> would be 0, 1 or -1. > > Ints are not the only thing that // can be applied to: > > >>> 1.0//0.01 > 99.0 Good catch! -- Steven -- https:/

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-15 Thread Gregory Ewing
Chris Angelico wrote: Small problem: Since we have / and // operators, it's impossible to have a unary / operator: No, it's not -- '//' is already recognised as a single token distinct from '/ /'. You would just have to leave a space or use parens in some cases. -- Greg -- https://mail.python.

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-15 Thread Gregory Ewing
Ian Kelly wrote: Unary integer division seems pretty silly since the only possible results would be 0, 1 or -1. Ints are not the only thing that // can be applied to: >>> 1.0//0.01 99.0 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-15 Thread Gregory Ewing
Dennis Lee Bieber wrote: And we'd be left looking for a symbol for bitwise inversion. Who needs negation when you have bitwise inversion? minusx = ~x + 1 I know, it doesn't work for floats, but that's just a simple matter of defining ~ on floats appropriately... -- Greg -- https://ma

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Chris Angelico
On Sun, Nov 15, 2015 at 1:08 PM, Steven D'Aprano wrote: > number = +raw_input("enter a number: ") > > versus: > > text = raw_input("enter a number: ") > try: > number = float(text) > except ValueError: > number = int(text) What kinds of strings can float() not handle but int() can, and in

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Steven D'Aprano
On Sun, 15 Nov 2015 02:43 am, Ian Kelly wrote: > On Fri, Nov 13, 2015 at 10:40 PM, Steven D'Aprano > wrote: >> Python has operator overloading, so it can be anything you want it to be. >> E.g. you might have a DSL where +feature turns something on and -feature >> turns it off. > > By that argume

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Steven D'Aprano
On Sun, 15 Nov 2015 09:53 am, Random832 wrote: > Marko Rauhamaa writes: >> Actually, the real question is, is the unary - *really* so useful that >> it merits existence or is it just something that was mindlessly copied >> into programming languages from elementary school arithmetics? > > The al

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread MRAB
On 2015-11-14 22:53, Random832 wrote: Marko Rauhamaa writes: Actually, the real question is, is the unary - *really* so useful that it merits existence or is it just something that was mindlessly copied into programming languages from elementary school arithmetics? The alternative, if you wan

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Marko Rauhamaa
Random832 : > Marko Rauhamaa writes: >> Actually, the real question is, is the unary - *really* so useful >> that it merits existence or is it just something that was mindlessly >> copied into programming languages from elementary school arithmetics? > > The alternative, if you want to be able to

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Random832
Marko Rauhamaa writes: > Actually, the real question is, is the unary - *really* so useful that > it merits existence or is it just something that was mindlessly copied > into programming languages from elementary school arithmetics? The alternative, if you want to be able to specify negative num

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Marko Rauhamaa
Ian Kelly : > On Nov 14, 2015 9:56 AM, "Marko Rauhamaa" wrote: >>r = //(//r1 + //r2 + //r3) > > Unary integer division seems pretty silly since the only possible > results would be 0, 1 or -1. Yep, mixed them up. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Ian Kelly
On Nov 14, 2015 10:10 AM, "Chris Angelico" wrote: > > On Sun, Nov 15, 2015 at 4:04 AM, Ian Kelly wrote: > > Unary integer division seems pretty silly since the only possible results > > would be 0, 1 or -1. > > 1, -1, or ZeroDivisionError. The zero's on the other side. But yes. // 42 == 1 // 42

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Ian Kelly
On Nov 14, 2015 9:56 AM, "Marko Rauhamaa" wrote: > > Ian Kelly : > > > For somebody reading one of these uses of unary plus in real code, I > > imagine it would be a bit of a WTF moment if it's the first time > > they've encountered it. I don't recall ever seeing any code that > > actually used th

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Chris Angelico
On Sun, Nov 15, 2015 at 3:52 AM, Marko Rauhamaa wrote: > What I don't understand is why there is a unary + but no unary /: > >-x ≡ 0 - x >+x ≡ 0 + x >/x ≡ 1 / x >//x ≡ 1 // x >*x ≡ 1 * x > > You could write: > >r = //(//r1 + //r2 + //r3) > > for > >r = 1 // (1//r1 + 1//

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Chris Angelico
On Sun, Nov 15, 2015 at 2:43 AM, Ian Kelly wrote: > On Fri, Nov 13, 2015 at 10:40 PM, Steven D'Aprano wrote: >> Python has operator overloading, so it can be anything you want it to be. >> E.g. you might have a DSL where +feature turns something on and -feature >> turns it off. > > By that argume

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Marko Rauhamaa
Ian Kelly : > For somebody reading one of these uses of unary plus in real code, I > imagine it would be a bit of a WTF moment if it's the first time > they've encountered it. I don't recall ever seeing any code that > actually used this, though. What I don't understand is why there is a unary +

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-14 Thread Ian Kelly
On Fri, Nov 13, 2015 at 10:40 PM, Steven D'Aprano wrote: > Python has operator overloading, so it can be anything you want it to be. > E.g. you might have a DSL where +feature turns something on and -feature > turns it off. By that argument we should also have operators ~, !, $, \, ? because some

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Steven D'Aprano
On Sat, 14 Nov 2015 02:01 pm, Chris Angelico wrote: > On Sat, Nov 14, 2015 at 1:40 PM, Steven D'Aprano > wrote: >> On Sat, 14 Nov 2015 09:42 am, Chris Angelico wrote: >> >>> However, this is a reasonable call for the abolition of unary plus... >> >> The only way you'll take unary plus out of Pyth

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Chris Angelico
On Sat, Nov 14, 2015 at 2:48 PM, Ian Kelly wrote: >> Yes, unary minus has the same issue - but it's a lot more important >> than unary plus is. In ECMAScript, unary plus means "force this to be >> a number"; what's its purpose in Python? > > I'm not sure "force this to be a number" is really a jus

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Chris Angelico
On Sat, Nov 14, 2015 at 2:45 PM, Ian Kelly wrote: >> Yes, unary minus has the same issue - but it's a lot more important >> than unary plus is. In ECMAScript, unary plus means "force this to be >> a number"; what's its purpose in Python? > > It forces a Counter to contain only positive counts? Di

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Ian Kelly
On Nov 13, 2015 8:03 PM, "Chris Angelico" wrote: > > On Sat, Nov 14, 2015 at 1:40 PM, Steven D'Aprano wrote: > > On Sat, 14 Nov 2015 09:42 am, Chris Angelico wrote: > > > >> However, this is a reasonable call for the abolition of unary plus... > > > > The only way you'll take unary plus out of Py

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Ian Kelly
On Nov 13, 2015 8:03 PM, "Chris Angelico" wrote: > > On Sat, Nov 14, 2015 at 1:40 PM, Steven D'Aprano wrote: > > On Sat, 14 Nov 2015 09:42 am, Chris Angelico wrote: > > > >> However, this is a reasonable call for the abolition of unary plus... > > > > The only way you'll take unary plus out of Py

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Chris Angelico
On Sat, Nov 14, 2015 at 1:40 PM, Steven D'Aprano wrote: > On Sat, 14 Nov 2015 09:42 am, Chris Angelico wrote: > >> However, this is a reasonable call for the abolition of unary plus... > > The only way you'll take unary plus out of Python is by prying it from my > cold, dead hands. > > > BTW, unar

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Steven D'Aprano
On Sat, 14 Nov 2015 09:42 am, Chris Angelico wrote: > However, this is a reasonable call for the abolition of unary plus... The only way you'll take unary plus out of Python is by prying it from my cold, dead hands. BTW, unary minus suffers from the same "problem": x =- y # oops, meant x -= y

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Chris Angelico
On Sat, Nov 14, 2015 at 6:45 AM, Ian Kelly wrote: > This sets RegisterAX to 2. Specifically, positive 2. If you want to > *add* 2, you probably meant to write: > > RegisterAX += 2 > > This also points out a good reason for using spaces around operators, > as "RegisterAX =+ 2" would have caused

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Grant Edwards
On 2015-11-13, kent nyberg wrote: > Though, as many times before, the problem was due to misunderstanding > of how python works. I assumed file.read()[xx:yy] was to be > understood as, in the file, read from index xx to place yy. Nope. First, the 'file.read()' part is evaluated. That return

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread kent nyberg
The main problem was that I forgot to do seek(0). Thanks alot people. Though, as many times before, the problem was due to misunderstanding of how python works. I assumed file.read()[xx:yy] was to be understood as, in the file, read from index xx to place yy. That is, [10:20] was the same a

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Grant Edwards
On 2015-11-13, Ian Kelly wrote: > Either retain the read data between calls, or call seek(0) before > reading it again. It has always saddened me that Python files don't have a rewind() method. On Unix, calling rewind() is the same as calling seek(0), so it's utterly pointless except as an amus

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Ian Kelly
On Fri, Nov 13, 2015 at 1:15 PM, kent nyberg wrote: > What bothers me, is the error that says > unpack requires a string argument of 4 bytes. > Im thinking in the line of arguments? Does unpack look at the 4 bytes it has > read, and tell for some > reason say that unpacking needs an argument of 4

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Ian Kelly
On Fri, Nov 13, 2015 at 1:15 PM, kent nyberg wrote: > Even with that, it still gets wrong. > I also tried .read()[RegisterAX:RegisterAX+4] When you call read for the second time, are you just reading the same file again without closing or seeking it in the interim? If that's the case, then you wo

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Laura Creighton
I forgot to add. You get this wretched error message if your data is shorter than expected, and you ask struct to read more than you have, as well. most annoying. Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread kent nyberg
On Fri, Nov 13, 2015 at 12:36:22PM -0700, Ian Kelly wrote: > On Fri, Nov 13, 2015 at 12:20 PM, kent nyberg wrote: > > def LoadCommandAndReact(place_to_read): > > global RegisterAX > > > > tmp = place_to_read.read()[RegisterAX:calcsize('HH')] > > It looks like you're trying to get a slice

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Laura Creighton
In a message of Fri, 13 Nov 2015 14:20:45 -0500, kent nyberg writes: >Hi there, >Im deeply sorry for yet another question to this list. I have come across a >problem to which google seems not >to eager to supply the anwser. > >The problem is the following. >First I do this: > >def setup_drive():

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Ian Kelly
As long as I'm replying to this, I see a few more issues to comment on: On Fri, Nov 13, 2015 at 12:20 PM, kent nyberg wrote: > if place_to_read.closed: >print("Drive error. Drive closed.") You probably also want to break or return here. Even better: raise an exception instead of prin

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Ian Kelly
On Fri, Nov 13, 2015 at 12:20 PM, kent nyberg wrote: > def LoadCommandAndReact(place_to_read): > global RegisterAX > > tmp = place_to_read.read()[RegisterAX:calcsize('HH')] It looks like you're trying to get a slice of length 4 here, starting at the value of RegisterAX. What you're actual

Re: Problems connecting to PostgreSQL

2015-11-09 Thread Cecil Westerhof
On Sunday 8 Nov 2015 09:36 CET, Chris Warrick wrote: > On 8 November 2015 at 00:40, Cecil Westerhof wrote: >> I followed http://zetcode.com/db/postgresqlpythontutorial/. >> >> I used: >> sudo -u postgres createuser stressTest >> this create the role, but also gave: >> could not change directory

Re: Problems connecting to PostgreSQL

2015-11-08 Thread Chris Warrick
On 8 November 2015 at 00:40, Cecil Westerhof wrote: > I followed http://zetcode.com/db/postgresqlpythontutorial/. > > I used: > sudo -u postgres createuser stressTest > this create the role, but also gave: > could not change directory to "/root": Permission denied > and I did not get the q

Re: Problems connecting to PostgreSQL

2015-11-07 Thread Chris Angelico
On Sun, Nov 8, 2015 at 10:40 AM, Cecil Westerhof wrote: > I used: > sudo -u postgres createuser stressTest > this create the role, but also gave: > could not change directory to "/root": Permission denied > and I did not get the questions. > You might need to become root before you can be

Re: problems using python in PowerShell

2015-11-01 Thread navid Rahimi
What error message do you get exactly ? without error message how people gonna know what is going on? best wishes, -navid On Fri, Oct 30, 2015 at 6:39 PM, Chris Angelico wrote: > On Sat, Oct 31, 2015 at 1:53 AM, josephine ewers via Python-list > wrote: >> Hi, >> I am doing an online training c

  1   2   3   4   5   6   7   8   >