Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread dn via Python-list
On 29/05/24 06:49, Gilmeh Serda via Python-list wrote: Solved by using a different method. Hedonist for hire... no job too easy! This combination of sig-file and content seems sadly ironic. How about CONTRIBUTING to the community by explaining 'the solution' to people who

Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread o1bigtenor via Python-list
On Tue, May 28, 2024 at 9:48 PM Gilmeh Serda via Python-list < python-list@python.org> wrote: > > Solved by using a different method. > > - - - And that was how? TIA -- https://mail.python.org/mailman/listinfo/python-list

Re: [Solved] Re: Windows registry PermissionError

2022-05-13 Thread Mike Dewhirst
On 13/05/2022 4:37 pm, Eryk Sun wrote: On 5/13/22, Mike Dewhirst wrote: On 13/05/2022 4:14 pm, Eryk Sun wrote: Since self.connect() is always called, you should document that the initial hkey parameter has to be one of the following predefined key handles: HKEY_LOCAL_MACHINE HKEY_

Re: [Solved] Re: Windows registry PermissionError

2022-05-12 Thread Eryk Sun
On 5/13/22, Mike Dewhirst wrote: > On 13/05/2022 4:14 pm, Eryk Sun wrote: >> Since self.connect() is always called, you should document that the >> initial hkey parameter has to be one of the following predefined key >> handles: >> >> HKEY_LOCAL_MACHINE >> HKEY_USERS > > I'm targeting HK

Re: [Solved] Re: Windows registry PermissionError

2022-05-12 Thread Mike Dewhirst
On 13/05/2022 4:14 pm, Eryk Sun wrote: Since self.connect() is always called, you should document that the initial hkey parameter has to be one of the following predefined key handles: HKEY_LOCAL_MACHINE HKEY_USERS I'm targeting HKEY_CURRENT_USER so I assume HK_USERS includes that.

Re: [Solved] Re: Windows registry PermissionError

2022-05-12 Thread Eryk Sun
Since self.connect() is always called, you should document that the initial hkey parameter has to be one of the following predefined key handles: HKEY_LOCAL_MACHINE HKEY_USERS HKEY_PERFORMANCE_DATA WinAPI RegConnectRegistryW() only matters when the target computer is a different machi

[Solved] Re: Windows registry PermissionError

2022-05-12 Thread Mike Dewhirst
Eryk Many thanks. It is working perfectly now. See below for the reworked code. Cheers Mike On 13/05/2022 1:42 pm, Eryk Sun wrote: On 5/12/22, Mike Dewhirst wrote: access=wr.KEY_ALL_ACCESS + wr.KEY_WRITE, import winreg as wr class Registry: def __init__(self, computer=None,

Re: [SOLVED] Module exists and cannot be found

2020-09-10 Thread James Moe via Python-list
On 9/8/20 10:35 PM, James Moe wrote: > Module PyQt5 is most definitely installed. Apparently there is more to getting > modules loaded than there used to be. > Cause: Operator Error The python installation had become rather messy resulting in the errors I showed. After installing python correc

[SOLVED] Re: Installing Python 3.8.3 with tkinter

2020-07-24 Thread Klaus Jantzen
On 7/22/20 12:20 PM, Klaus Jantzen wrote: Hi, Trying to install Python 3.8.3 with tkinter I run configure with the following options ./configure --enable-optimizations --with-ssl-default-suites=openssl --with-openssl=/usr/local --enable-loadable-sqlite-extensions --with-pydebug --with-tcltk

Re: Solved: Re: Missing python curses functions?

2020-06-29 Thread Tony Flury via Python-list
Maybe you should raise a bug (bugs.python.org) and flag that this function is missing. It could be that it can be introduced by whoever is maintaining the existing code. On 20/05/2020 08:31, Alan Gauld via Python-list wrote: On 19/05/2020 20:53, Alan Gauld via Python-list wrote: One of the

Solved: Re: Missing python curses functions?

2020-05-20 Thread Alan Gauld via Python-list
On 19/05/2020 20:53, Alan Gauld via Python-list wrote: > One of the functions discussed that does not appear to have > a Python equivalent is attr_get() which gets the current > attributes. OK, Using inch() I've written the following function: def attr_get(win): """ return current window at

Re: No module named 'gi' [SOLVED]

2020-04-13 Thread Jon Danniken
On 4/13/20 8:46 PM, Jon Danniken wrote: Hello all, I am coming up with this error when, after installing Dropbox, I try to run Dropbox on my machine (kubuntu 18.04): SNIP Well it looks like I solved this issue with $pip uninstall conda. Sometimes I just have to ask a question

[Solved] Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Stephan Lukits
On 3/31/20 8:00 PM, Dieter Maurer wrote: Stephan Lukits wrote at 2020-3-31 17:44 +0300: background: - a daemon creates package p1 (e.g. directory with __init__.py-file) and in p1 a module m1 is created. - Then the daemon wants to import from m1, which functions (so far all the time). - Then

Re: Suppress tooltips in Pygal charts (solved)

2019-10-12 Thread Roy Hann
Roy Hann wrote: > Is there any way to tell Pygal not to generate references to on-line > resources? I can now answer my own question. The solution was not obvious from reading the documentation but a glance at the pygal code uncovered the answer. The js configuration parameter specifies where

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Peter Otten
Sayth Renshaw wrote: > On Thursday, 29 August 2019 20:33:46 UTC+10, Peter Otten wrote: >> Sayth Renshaw wrote: >> >> > will find the added >> > pairs, but ignore the removed ones. Is that what you want? >> > >> > Yes, I think. I want to find the changed pairs. The people that moved >> > team nu

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Sayth Renshaw
On Thursday, 29 August 2019 20:33:46 UTC+10, Peter Otten wrote: > Sayth Renshaw wrote: > > > will find the added > > pairs, but ignore the removed ones. Is that what you want? > > > > Yes, I think. I want to find the changed pairs. The people that moved team > > numbers. > > To find the people

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Peter Otten
Sayth Renshaw wrote: > will find the added > pairs, but ignore the removed ones. Is that what you want? > > Yes, I think. I want to find the changed pairs. The people that moved team > numbers. To find the people that moved team numbers I would tear the pairs apart. Like: >>> people = ["Tim","

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Sayth Renshaw
will find the added pairs, but ignore the removed ones. Is that what you want? Yes, I think. I want to find the changed pairs. The people that moved team numbers. Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-28 Thread Peter Otten
Sayth Renshaw wrote: > On Thursday, 29 August 2019 14:03:44 UTC+10, Sayth Renshaw wrote: >> On Thursday, 29 August 2019 13:53:43 UTC+10, Sayth Renshaw wrote: >> > On Thursday, 29 August 2019 13:25:01 UTC+10, Sayth Renshaw wrote: >> > > Hi >> > > >> > > Trying to find whats changed in this exam

[SOLVED] Re: Compare zip lists where order is important

2019-08-28 Thread Sayth Renshaw
On Thursday, 29 August 2019 14:03:44 UTC+10, Sayth Renshaw wrote: > On Thursday, 29 August 2019 13:53:43 UTC+10, Sayth Renshaw wrote: > > On Thursday, 29 August 2019 13:25:01 UTC+10, Sayth Renshaw wrote: > > > Hi > > > > > > Trying to find whats changed in this example. Based around work and te

Re: Block Ctrl+S while running Python script at Windows console? (solved)

2019-03-18 Thread Malcolm Greene
Eryk, > Another common culprit is quick-edit mode, in which case a stray mouse click > can select text, even just a single character. The console pauses while text > is selected. MYSTERY SOLVED !! THANK YOU !! Apparently, while mouse clicking between windows, I was inadvertently sel

RE: python3.7.2 won't compile with SSL support (solved)

2019-02-21 Thread Felix Lazaro Carbonell
Incredibly: ./configure --with-ssl=/usr/include/openssl/ Made the trick!! Although --with-ssl is not documented in ./configure --help. Cheers, Felix. -- https://mail.python.org/mailman/listinfo/python-list

Re: [solved] C API version of str(exception) is not the same as pure python version

2019-02-10 Thread Barry Scott
On Sunday, 10 February 2019 11:59:16 GMT Barry Scott wrote: > When I use the C API to get the str() of an execption I see this text: > > > > But python reports the following for the same exception: > > TypeError: unsupported operand type(s) for +: 'int' and 'str' > > What do I need

[SOLVED] Re: ah, progress...

2018-12-23 Thread ant
dieter wrote: ... thank you for your help. :) i finally worked through the changes needed at last. my current package in testing PyPI is at: https://test.pypi.org/project/ngfp/ which uses my code from: https://salsa.debian.org/ant-guest/gfpoken-in-python i ended up needing to

Solved: pip hangs after successful operation (sandboxed environment problem)

2018-10-05 Thread Ryan Johnson
It turns out that Comodo Antivirus auto-sandboxes any program that it doesn’t recognize, and this included python in the C:\Users\$user\AppData\Programs directory. This also affects Cygwin and MSYS2 (but not MSYS). If you are thinking about using Comodo, disable the Auto-Containment feature. A

[SOLVED] Re: Querying MariaDB from python

2018-10-02 Thread Tony van der Hoff
On 02/10/18 17:13, Larry Martell wrote: > On Tue, Oct 2, 2018 at 12:09 PM Tony van der Hoff > wrote: >> >> On 02/10/18 16:47, Ervin Hegedüs wrote: >>> hi, >>> >>> now rows will looks like this: >>> ({'id':...,...},{'id':...,}...) >> >> Thanks Ervin, but: >> >>cursor = cnx.cursor(pymysql.curso

[SOLVED]: problem with json.dumps / complexjson.loads in python 3.4 virtualenv

2018-09-05 Thread M. Fioretti
On 2018-09-05 08:21, dieter wrote: "M. Fioretti" writes: I have an error in a python application that I installed... ... https://github.com/shaarli/python-shaarli-client/issues/33 ... Looks like the problem is immediately at the start of the response (--> "ValueError: Expecting value: line 1 c

Re: Python web server weirdness SOLVED

2018-06-07 Thread Gregory Ewing
Steven D'Aprano wrote: Never mind -- it turned out I had an "index.html" file in the directory which had been wget'ed from LiveJournal. That's okay, then. The other possibility was that your computer had been recruited into an evil botnet set up by LiveJournal to create backup servers for their

Re: Python web server weirdness SOLVED

2018-06-07 Thread Steven D'Aprano
On Thu, 07 Jun 2018 13:32:10 +, Steven D'Aprano wrote: [...] > python3.5 -m http.server 8000 > > What I expected was a directory listing of my current directory. > > What I got was Livejournal's front page. Never mind -- it turned out I had an "index.html" file in the directory which had b

Re: Uploading on PyPI fail (solved)

2018-05-15 Thread Vincent Vande Vyvre
= *** [pypi] repository = https://upload.pypi.org/legacy/ username = VinsS password = ** - Note: I've tested on test.pypi.org without problems. Thanks for all advices, Vincent (send at Tue, 15 May 2018 12:04:10 +0200) Solved with $ twine upload  dist/* ... Vi

Re: urllib.request.urlopen fails with https - SOLVED

2018-03-16 Thread Irv Kalb
Thank you, thank you, thank you. That fixed it (at least on my computer, I'll see if I can do that at my school). Irv > On Mar 15, 2018, at 7:39 PM, Ned Deily wrote: > > On 2018-03-14 18:04, Irv Kalb wrote: >> File >> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/re

Re: Re: Problem with StreamReaderWriter on 3.6.3? SOLVED

2017-10-20 Thread Peter via Python-list
Thanks MRAB, your solution works a treat. I'm replying to the list so others can know that this solution works. Note that sys.stderr.detach() is only available in >= 3.1, so one might need to do some version checking to get it to work properly in both versions. It also can mess up with the buf

Solved (Was: Re: [Q] days -> months)

2017-10-11 Thread Byung-Hee HWANG (황병희, 黃炳熙)
Oh never mind it, after so many trial and error, i did make months format with success, thanks!!! Sincerely, Byung-Hee. -- ^고맙습니다 _救濟蒼生_ 감사합니다_^))// -- https://mail.python.org/mailman/listinfo/python-list

Re: [SOLVED] Re: Firebird 1.5 and Python 3.4 - is this possible?

2017-08-10 Thread Ben Finney
Nagy László Zsolt writes: > Problem solved! Congratulations. And thank you for reporting the succesful resolution :-) -- \ “It is clear that thought is not free if the profession of | `\ certain opinions makes it impossible to earn a living.” | _o__) —Bertrand Russ

[SOLVED] Re: Firebird 1.5 and Python 3.4 - is this possible?

2017-08-09 Thread Nagy László Zsolt
client. - The official fdb module (https://pypi.python.org/pypi/fdb right now at version 1.7) can be used from Python 3, and it works with Firebird 2.5 Problem solved! > Hi! > > I have an old HIS program written in Delphi. It uses Firebird 1.5 > database. I need to make an

Re: Extended ASCII [solved]

2017-01-13 Thread D'Arcy Cain
On 2017-01-13 05:44 PM, Grant Edwards wrote: On 2017-01-13, D'Arcy Cain wrote: Here is the failing code: with open(sys.argv[1], encoding="latin-1") as fp: for ln in fp: print(ln) Traceback (most recent call last): File "./load_iff", line 11, in print(ln) UnicodeEncodeError:

Re: Append/Replace a row in a pandas DataFrame [SOLVED]

2016-04-14 Thread Peter Otten
Paulo da Silva wrote: > Às 21:10 de 13-04-2016, Paulo da Silva escreveu: >> Hi all. > ... > >> [6 rows x 4 columns] >> >>> dft=pd.DataFrame([[1,2,3,4]], >> index=[datetime.date(2016,1,12)],columns=df.columns) >> >>> dft >> A B C D >> 2016-01-12 1 2 3 4 >> >> [1 rows x 4 colu

Re: Append/Replace a row in a pandas DataFrame [SOLVED]

2016-04-13 Thread Paulo da Silva
Às 21:10 de 13-04-2016, Paulo da Silva escreveu: > Hi all. ... > [6 rows x 4 columns] > >> dft=pd.DataFrame([[1,2,3,4]], > index=[datetime.date(2016,1,12)],columns=df.columns) > >> dft > A B C D > 2016-01-12 1 2 3 4 > > [1 rows x 4 columns] > >> pd.concat([df,dft]) > Out[71]

Re: [SOLVED] There has to be a better way to split this string!

2016-02-09 Thread Chris Kaynor
On Tue, Feb 9, 2016 at 5:58 PM, Anthony Papillion wrote: > > On 02/09/2016 07:47 PM, Ben Finney wrote: > > Anthony Papillion writes: > > > >> On 02/09/2016 07:26 PM, Anthony Papillion wrote: > >>> I am using datetime.now() to create a unique version of a filename. > >>> […] > >> > >> Found the so

Re: [SOLVED] There has to be a better way to split this string!

2016-02-09 Thread Anthony Papillion
On 02/09/2016 07:47 PM, Ben Finney wrote: > Anthony Papillion writes: > >> On 02/09/2016 07:26 PM, Anthony Papillion wrote: >>> I am using datetime.now() to create a unique version of a filename. >>> […] >> >> Found the solution in strftime(). Exactly what I was looking for. > > For the task of

Re: [SOLVED] There has to be a better way to split this string!

2016-02-09 Thread Ben Finney
Anthony Papillion writes: > On 02/09/2016 07:26 PM, Anthony Papillion wrote: > > I am using datetime.now() to create a unique version of a filename. > > […] > > Found the solution in strftime(). Exactly what I was looking for. For the task of making a unique filename, you should also consider th

Re: [SOLVED] There has to be a better way to split this string!

2016-02-09 Thread Anthony Papillion
On 02/09/2016 07:26 PM, Anthony Papillion wrote: > Hello Everyone, > > I am using datetime.now() to create a unique version of a filename. > When the final file is named, it will look something like: > > myfile-2015-02-09-19-08-45-4223 > > Notice I'm replacing all of the "."'s, " "'s, and ":"'s

Re: SSL certification fails / tweepy [SOLVED]

2016-01-14 Thread dieter
"K. Elo" writes: > ... > I still wonder why openSuSE certificates are not working out-of-box > with python. Maybe some of the packages were not correctly installed... Certificates have a validity period -- usually, they need to be renewed from time to time (to get a new vality period). -- https

Re: SSL certification fails / tweepy [SOLVED]

2016-01-14 Thread K. Elo
nstalled... Anyway, thanks for your quick reply - the issue is now solved :) Best, Kimmo -- https://mail.python.org/mailman/listinfo/python-list

Re: Accessing container's methods [solved]

2015-12-08 Thread Tony van der Hoff
Hum, sorry about the empty reply; just finger trouble! Anyway I wasn't expecting such a great response; thanks to all. On 07/12/15 23:47, Erik wrote: [snip] As you can't sensibly put the object into more than one container at a time anyway, then you can pass the container object to the Actor o

Re: Unicode failure (Solved)

2015-12-06 Thread Dave Farrance
allowing the entire BMP is better than >> any Windows codepage. > >Thanks to all. Following up on the various posts brought me to >information that solved my problem. Basicall I added "export >PYTHONIOENCODING=utf8" to my environment and "SetEnv PYTHONIOENCOD

Re: Unicode failure (Solved)

2015-12-05 Thread D'Arcy J.M. Cain
. Thanks to all. Following up on the various posts brought me to information that solved my problem. Basicall I added "export PYTHONIOENCODING=utf8" to my environment and "SetEnv PYTHONIOENCODING utf8" in my Apache config and now things are working as they should. Thanks

Re: Data integrity problem with sqlite3 - solved

2015-08-11 Thread Frank Millman
"Frank Millman" wrote in message news:mqcslv$tee$1...@ger.gmane.org... "Frank Millman" wrote in message news:mqcmie$po9$1...@ger.gmane.org... > Hi all > > I have a 'data integrity' problem with sqlite3 that I have been battling > with for a while. I have not got to the bottom of it yet but I

Re: Data integrity problem with sqlite3 - solved

2015-08-11 Thread Frank Millman
"Frank Millman" wrote in message news:mqcmie$po9$1...@ger.gmane.org... Hi all I have a 'data integrity' problem with sqlite3 that I have been battling with for a while. I have not got to the bottom of it yet but I do have some useful info, so I thought I would post it here in the hope that

Re: Improper Django Project error (solved)

2015-08-01 Thread Gary Roach
t the settings.py files for Django 1.7 and 1.8 have some very significant differences with the format of the TEMPLATES = [] tuple. So the problem's solved --- sort of . I am using Ninja-IDE as my IDE. I like it a lot. At this point both projects are essentially identical with the exce

Re: Improper Django Project error (solved)

2015-07-31 Thread Gary Roach
t the settings.py files for Django 1.7 and 1.8 have some very significant differences with the format of the TEMPLATES = [] tuple. So the problem's solved --- sort of . I am using Ninja-IDE as my IDE. I like it a lot. At this point both projects are essentially identical with the exce

Re: password authentication failed (SOLVED)

2015-07-24 Thread Gary Roach
On 07/22/2015 04:44 PM, Chris Angelico wrote: On Thu, Jul 23, 2015 at 9:35 AM, Gary Roach wrote: At this point, I'm confused about a few things. Does the postgresql server and my archivedb reside globally or are they inside my archivedb virtual environment. I think globally. Your virtual envir

Re: Matplotlib X-axis timezone trouble [SOLVED]

2015-07-04 Thread Peter Pearson
On Sat, 04 Jul 2015 07:29:45 +0300, Akira Li <4kir4...@gmail.com> wrote: > Peter Pearson writes: > >> The following code produces a plot with a line running from (9:30, 0) to >> (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >> If I use timezone None instead of pacific, the plot is as

[Solved] Python.exe has stopped working

2015-06-19 Thread Alexis Dubois
02419/pyqt-5-error-on-exit > > Laura Hello Everybody, Thank you for your support and sorry for the late answer, I'm back from holidays. I tried each solution but unfortunately, nothing works. Finally, I solved my issue by adding "sip.setdestroyonexit(False)" just before &qu

Re: Problem with Android Build [SOLVED]

2014-10-22 Thread Cyd Haselton
On Tue, Oct 21, 2014 at 1:57 PM, Chris Angelico wrote: > On Wed, Oct 22, 2014 at 5:53 AM, Cyd Haselton wrote: > > I forgot to add...I also removed and/or commented out lines referencing > > Modules/pwdmodule.o. > > Sounds like the normal sort of work involved in porting to a new > platform. I've

Re: pyserial on freebsd 10.10 i386 [SOLVED]

2014-10-19 Thread Mark Lawrence
On 19/10/2014 16:06, Grant Edwards wrote: On 2014-10-18, Nagy L?szl? Zsolt wrote: Strangely, pyserial will accept the number 0, but then it tries to open a device that exists on Linux only... I'm sure Chris would be happy to accept a patch fixing that problem. Sadly to some people a patch

Re: pyserial on freebsd 10.10 i386 [SOLVED]

2014-10-19 Thread Grant Edwards
On 2014-10-18, Nagy L?szl? Zsolt wrote: > Strangely, pyserial will accept the number 0, but then it tries to open > a device that exists on Linux only... I'm sure Chris would be happy to accept a patch fixing that problem. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: pyserial on freebsd 10.10 i386 [SOLVED]

2014-10-18 Thread Nagy László Zsolt
The port parameter of serial.Serial should be /dev/ttyu0 instead of COM1, and /dev/ttyu1 instead of COM2. Strangely, pyserial will accept the number 0, but then it tries to open a device that exists on Linux only... Anyway, problem solved. -- https://mail.python.org/mailman/listinfo/python

Re: win32serviceutil: ImportError: DLL load failed: The specified module could not be found [SOLVED]

2014-05-26 Thread Nagy László Zsolt
Python 3.4 does not run any bdist_wininst postinstall scripts. Try to run `C:\Python34\python.exe C:\Python34\Scripts\pywin32_postinstall.py -install` manually from an elevated command prompt. Christoph C:\>C:\Python34\python.exe C:\Python34\Scripts\pywin32_postinstall.py -install Copied py

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Andrew Cooper
On 22/04/2q014 13:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > > Excellent! Shebangs are *extremely* specific, so you may want to > cons

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Andrew Cooper
On 22/04/2q014 13:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > > Excellent! Shebangs are *extremely* specific, so you may want to > cons

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 11:01 PM, Antoon Pardon wrote: > On 22-04-14 14:26, Chris Angelico wrote: > >> On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon >> wrote: >>> Yes that was it. I changed the first line of my script to: >>> >>> #!/opt/local/bin/python2.7 >>> >>> and it now works. >> Excellent

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Antoon Pardon
On 22-04-14 14:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > Excellent! Shebangs are *extremely* specific, so you may want to > consider

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon wrote: > Yes that was it. I changed the first line of my script to: > > #!/opt/local/bin/python2.7 > > and it now works. Excellent! Shebangs are *extremely* specific, so you may want to consider using "/usr/bin/env python" to get a bit more flexibil

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Antoon Pardon
On 22-04-14 14:09, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 8:29 PM, Antoon Pardon > wrote: >> However if I call the script directly and want the #! line do its work I get >> the following error. >> >> # /usr/local/bin/ldapwatch /opt/local/log/openldap.log | head >> /usr/local/bin/ldapwatc

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2014-03-09 Thread Terry Reedy
On 3/9/2014 10:46 AM, Wesley wrote: I hit a problem alike yours. Cannot fix according your method. Here is snippet: root@localhost python]# gdb python 40290 GNU gdb (GDB) 7.7 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2014-03-09 Thread Wesley
I hit a problem alike yours. Cannot fix according your method. Here is snippet: root@localhost python]# gdb python 40290 GNU gdb (GDB) 7.7 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are

Re: random.sample with large weighted sample-sets? [SOLVED]

2014-02-16 Thread Tim Chase
On 2014-02-16 14:47, Terry Reedy wrote: > > 2) the data has to be sorted for bisect to work > > cumulative sums are automatically sorted. Ah, that they were *cumulative* was the key that I missed in my understanding. It makes sense now and works like a charm. Thanks to all who offered a hand

Re: [Solved]Re: Help with TypeError: Can't convert 'list' object to str implicitly

2014-02-05 Thread Chris Angelico
On Thu, Feb 6, 2014 at 5:08 PM, Dave Angel wrote: > print('The secretWord is ' + secretWord > print('The secretKey is ' + key )) http://xkcd.com/859/ ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re:[Solved]Re: Help with TypeError: Can't convert 'list' object to str implicitly

2014-02-05 Thread Dave Angel
dave em Wrote in message: > > > Fixed the error and am now onto the next issue. > > Solution was to return a list (I think) and then break out the components of > the list and put in the variable. Here is how we did it: > > secretWord = getRandomWord(words) > print('The secretWord is ' + str

[Solved]Re: Help with TypeError: Can't convert 'list' object to str implicitly

2014-02-05 Thread dave em
On Wednesday, February 5, 2014 7:21:29 PM UTC-7, dave em wrote: > Hello, > > > > Background. My 11 y/o son and I have taken on the task to learn python and > work our way through the http://inventwithpython.com/chapters/ book. > > - We are currently on Chapter 9 and trying to modify the hang

Re: unicode troubles and postgres [SOLVED]

2014-01-09 Thread Chris Angelico
On Fri, Jan 10, 2014 at 6:51 AM, Ethan Furman wrote: > The problem was I had created the database from template0 instead of > template1, and 0 is SQL-ASCII while 1 is UTF8. Ah, this is one of the traps with Postgres. This is one of the reasons I prefer not to touch template[01] and to script the

Re: unicode troubles and postgres [SOLVED]

2014-01-09 Thread Ethan Furman
On 01/09/2014 10:49 AM, Ethan Furman wrote: So I'm working with postgres, and I get a datadump which I try to restore to my test system, and I get this: ERROR: value too long for type character varying(4) CONTEXT: COPY res_currency, line 32, column symbol: "руб" "py6" sure looks like it shou

Re: Beginner python 3 unicode question [SOLVED]

2013-11-16 Thread Chris Angelico
On Sun, Nov 17, 2013 at 8:44 AM, Laszlo Nagy wrote: > >> >> So is the default utf-8 or not? Should the documentation be updated? Or do >> we have a bug in the interactive shell? >> > It was my fault, sorry. The other program used os.system at some places, and > it accidentally used python2 instead

Re: Beginner python 3 unicode question [SOLVED]

2013-11-16 Thread Laszlo Nagy
So is the default utf-8 or not? Should the documentation be updated? Or do we have a bug in the interactive shell? It was my fault, sorry. The other program used os.system at some places, and it accidentally used python2 instead of python 3. :-( -- This message has been scanned for viruse

[solved]Re: Python PDB conditional breakpoint

2013-11-06 Thread Tom P
On 06.11.2013 16:14, Tom P wrote: ok I figured it. ID is a tuple, not a simple variable. The correct test is ID[0]==11005 I can't get conditional breakpoints to work. I have a variable ID and I want to set a breakpoint which runs until ID==11005. Here's what happens - -- https://mail.pyth

Re: sorting german characters äöü... solved

2013-10-30 Thread Ulrich Goebel
Hi, Am 30.10.2013 19:48, schrieb Skip Montanaro: Perhaps this? http://stackoverflow.com/questions/816285/where-is-pythons-best-ascii-for-this-unicode-database There I found the module unidecode (http://pypi.python.org/pypi/Unidecode), and I found it very helpful. Thanks a lot! So my function

Re: UnicodeEncodeError: SOLVED

2013-10-10 Thread Walter Hurry
On Thu, 10 Oct 2013 01:47:52 +, Steven D'Aprano wrote: > On Wed, 09 Oct 2013 14:41:53 +, Walter Hurry wrote: > >> Many thanks to those prepared to forgive my transgression in the >> 'Goodbye' thread. I mentioned there that I was puzzled by a >> UnicodeEncodeError, and said I would rise it

Re: UnicodeEncodeError: SOLVED

2013-10-09 Thread Steven D'Aprano
On Wed, 09 Oct 2013 14:41:53 +, Walter Hurry wrote: > Many thanks to those prepared to forgive my transgression in the > 'Goodbye' thread. I mentioned there that I was puzzled by a > UnicodeEncodeError, and said I would rise it as a separate thread. > > However, via this link, I was able to r

UnicodeEncodeError: SOLVED

2013-10-09 Thread Walter Hurry
Many thanks to those prepared to forgive my transgression in the 'Goodbye' thread. I mentioned there that I was puzzled by a UnicodeEncodeError, and said I would rise it as a separate thread. However, via this link, I was able to resolve the issue myself: http://stackoverflow.com/questions/3224

Re: django admin.py error (solved)

2013-09-19 Thread Gary Roach
On 09/19/2013 11:56 AM, John Gordon wrote: In Gary Roach writes: On 09/19/2013 11:15 AM, John Gordon wrote: Does /home/gary/ProgramFiles/mysite/mysite/models.py define an object named 'membership'? Yes. The following is the top part of the models.py file: q class Membership(models.Mod

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-11 Thread Roy Smith
In article , Fábio Santos wrote: One suggested solution: > > > > sansfirstline = '\n'.join(fullstring.split('\n')[1:]) To which I suggested a couple of alternatives: > > i = s.index('\n') > > print s[i+1:] > > [...] > > print re.sub(r'^[^\n]*\n', '', s) > > I'll admit, the split/slice/joi

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-11 Thread Terry Reedy
On 9/11/2013 8:08 AM, Fábio Santos wrote: Is there not a limit argument to str.split? This should be trivial. Yes, I posted an example using it the first day. I also showed how to use iter and next with files and avoid copying. first, rest = multiline_str.split('\n', 1) This does not work

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-11 Thread Fábio Santos
On 2 Sep 2013 18:13, "Roy Smith" wrote: > > In article , > Anthony Papillion wrote: > > > On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: > > > On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion > > > wrote: > > >> Hello Everyone, > > >> > > >> I have a multi-line string and I need to re

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-02 Thread Roy Smith
In article , Anthony Papillion wrote: > On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: > > On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion > > wrote: > >> Hello Everyone, > >> > >> I have a multi-line string and I need to remove the very first line from > >> it. How can I do tha

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-02 Thread Anthony Papillion
On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: > On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion wrote: >> Hello Everyone, >> >> I have a multi-line string and I need to remove the very first line from >> it. How can I do that? I looked at StringIO but I can't seem to figure >> out how

Re: How do I process this using Python? (SOLVED)

2013-08-31 Thread Anthony Papillion
On 08/31/2013 07:32 PM, Chris Angelico wrote: > On Sun, Sep 1, 2013 at 10:19 AM, Anthony Papillion > wrote: >> On 08/31/2013 06:48 PM, Chris Angelico wrote: >>> On Sun, Sep 1, 2013 at 9:44 AM, Anthony Papillion >>> wrote: I'm writing a processor for Bitmessage messages and I am needing to

Re: Simple I/O problem can't get solved

2013-06-22 Thread Peter Otten
Chris Angelico wrote: > On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@web.de> wrote: >> Combining these modifications: >> >> for line in f: >> word = line.strip() >> if is_palindrome.is_palindrome(word): >> print word > > Minor quibble: I wouldn't use the name 'word' her

Re: Simple I/O problem can't get solved

2013-06-22 Thread Chris Angelico
On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@web.de> wrote: > Combining these modifications: > > for line in f: > word = line.strip() > if is_palindrome.is_palindrome(word): > print word Minor quibble: I wouldn't use the name 'word' here, unless you're expecting the file

Re: Simple I/O problem can't get solved

2013-06-21 Thread nickgan . sps
Τη Παρασκευή, 21 Ιουνίου 2013 12:15:59 μ.μ. UTC+3, ο χρήστης Peter Otten έγραψε: > nickgan@windowslive.com wrote: > > > > > I have recently started to solve my first Python problems but I came > > > across to this: > > > Write a version of a palindrome recogniser that accepts a file name f

Re: Simple I/O problem can't get solved

2013-06-21 Thread Jussi Piitulainen
nickgan@windowslive.com writes: > I think I coded it correctly but still I get no output. I do not > have any errors I just do not get any output. > > This is the code: > > *** > import is_palindrome > > filename = raw_input('Enter a file: ') # A text file > f = open(filename) > while True:

Re: Simple I/O problem can't get solved

2013-06-21 Thread Peter Otten
nickgan@windowslive.com wrote: > I have recently started to solve my first Python problems but I came > across to this: > Write a version of a palindrome recogniser that accepts a file name from > the user, reads each line, and prints the line to the screen if it is a > palindrome.(by http://w

Simple I/O problem can't get solved

2013-06-21 Thread nickgan . sps
Greetings to everybody, I have recently started to solve my first Python problems but I came across to this: Write a version of a palindrome recogniser that accepts a file name from the user, reads each line, and prints the line to the screen if it is a palindrome.(by http://www.ling.gu.se/~lag

Re: Building importable _tkinter on Windows (solved)

2013-03-10 Thread Terry Reedy
On 3/9/2013 7:41 PM, Terry Reedy wrote: If you have tried to build _tkinter on Windows from the cpython repository, and have 'import tkinter' work, please share your experience, successful or not. I and another person have both failed. > [snip] Solution from Merlijn van Deen on core-mentorship

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2013-02-20 Thread drevicko
On Friday, December 7, 2012 11:22:12 AM UTC+11, Mark Shroyer wrote: > On Thu, Dec 06, 2012 at 04:39:41PM -0500, Mark Shroyer wrote: > > > I'm having trouble with the py-bt, py-locals, etc. GDB commands (from > > > Python's python-gdb.py) while using GDB 7.4 to debug Python 2.7.3; I was > > > won

Re: Eric - "No module named MainWindow" - solved

2013-02-17 Thread Phil
On 17/02/13 21:35, Vincent Vande Vyvre wrote: Le 17/02/13 10:08, Phil a écrit : Thank you for reading this. I've been playing with Eric all day and I almost have a working GUI application, but not quite. I have followed the two tutorials on the Eric site and I'm sure that I haven't miss entered

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2012-12-06 Thread Mark Shroyer
On Thu, Dec 06, 2012 at 07:37:22PM -0500, MRAB wrote: > On 2012-12-07 00:22, Mark Shroyer wrote: > > > > [...] > > > > 2. Patch Python 2.7.3's python-gdb.py as follows: > > > > === 8< = > > > > --- python-gdb.py.orig 2012-12-06 15:12:18.666760664 -0500 > > +++

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2012-12-06 Thread MRAB
On 2012-12-07 00:22, Mark Shroyer wrote: On Thu, Dec 06, 2012 at 04:39:41PM -0500, Mark Shroyer wrote: I'm having trouble with the py-bt, py-locals, etc. GDB commands (from Python's python-gdb.py) while using GDB 7.4 to debug Python 2.7.3; I was wondering if anyone here could offer advice. Brie

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2012-12-06 Thread Mark Shroyer
On Thu, Dec 06, 2012 at 04:39:41PM -0500, Mark Shroyer wrote: > I'm having trouble with the py-bt, py-locals, etc. GDB commands (from > Python's python-gdb.py) while using GDB 7.4 to debug Python 2.7.3; I was > wondering if anyone here could offer advice. > > Briefly, py-bt seems to identify the p

[SOLVED] Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?

2012-10-24 Thread Daniel Dehennin
Daniel Dehennin writes: > Hello, Hi [...] > I tried to setup the same for my scripts with > "logging.config.dictConfig()" without much success, I want to limit > output to stdout to INFO, everything bellow INFO should be sent to > stderr instead. > > Any hints? I finally find a solution for

  1   2   3   >