Re: Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi

2023-02-26 Thread Hen Hanna
On Sunday, February 26, 2023 at 10:28:41 AM UTC-8, rbowman wrote: > On Sun, 26 Feb 2023 09:17:46 -0800 (PST), Hen Hanna wrote: > > > > To move text-Lines between files --- i do this (below) Maybe > > there's a better (or more standard) way, but i've been doing this for > > 30+ years, so i'

Re: Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi

2023-02-26 Thread rbowman
On Sun, 26 Feb 2023 09:17:46 -0800 (PST), Hen Hanna wrote: > To move text-Lines between files --- i do this (below) Maybe > there's a better (or more standard) way, but i've been doing this for > 30+ years, so i'll prob. keep doing it. > You can use the buffers. "a yy will add the cur

Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi

2023-02-26 Thread Hen Hanna
my .vimrc file. :ab qq q! :ab wt w! ~/temp.vi :ab rt r~/temp.vi So i can .. [1] from one file, do :.wt-- write 1 line to temp file :.,.+5 wt -- write 6 lin

Re: Suggestion: Regex string specifier like r and f

2023-01-08 Thread Barry
> On 8 Jan 2023, at 21:16, Raphael Santiago > wrote: > > Maybe something like re"" > It should behave exactly like a raw string but would be useful for syntax > highlighting and debugging. Perhaps also for type hinting expected regex > input (don't know if this is feasible). This is unlikely

Re: Suggestion: Regex string specifier like r and f

2023-01-08 Thread Cameron Simpson
On 08Jan2023 12:44, Raphael Santiago wrote: Maybe something like re"" It should behave exactly like a raw string but would be useful for syntax highlighting and debugging. Perhaps also for type hinting expected regex input (don't know if this is feasible). A nice idea. (Though I'm personally r

Suggestion: Regex string specifier like r and f

2023-01-08 Thread Raphael Santiago
Maybe something like re"" It should behave exactly like a raw string but would be useful for syntax highlighting and debugging. Perhaps also for type hinting expected regex input (don't know if this is feasible). -- https://mail.python.org/mailman/listinfo/python-list

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-12 Thread Jach Feng
moi 在 2022年12月12日 星期一下午5:38:50 [UTC+8] 的信中寫道: > >>> ast.literal_eval("r'\x7a'") == ast.literal_eval("r'z'") > True > >>> ast.literal_eval("r'\xe0'") == ast.literal_eval("r'à'") > T

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-09 Thread Jach Feng
re gracefully? > *** Attention: This is an external email. Use caution responding, opening > attachments or clicking on links. *** > Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道: > > s0 = r'\x0a' > > At this moment it was done by > > > > def

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-09 Thread Jach Feng
C:\humour> licp($a) > a U+0061 > b U+0062 > U+0009 > c U+0063 > € U+20AC > u U+0075 > r U+0072 > o U+006F > x U+0078 > U+0008 > z U+007A > > PS C:\humour> > > PS C:\humour> py38 sysargwithliteral.py > a\u000ab\u0009c\u000

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-09 Thread Weatherby,Gerard
nvert a raw string r'xdd' to 'xdd' more gracefully? *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道: > s0 = r'\x0a' > At this moment it was done

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-08 Thread Jach Feng
Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道: > s0 = r'\x0a' > At this moment it was done by > > def to1byte(matchobj): > return chr(int('0x' + matchobj.group(1), 16)) > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0) > >

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-08 Thread Jach Feng
Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道: > s0 = r'\x0a' > At this moment it was done by > > def to1byte(matchobj): > return chr(int('0x' + matchobj.group(1), 16)) > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0) > >

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-08 Thread Peter Otten
On 08/12/2022 02:17, Jach Feng wrote: Peter Otten 在 2022年12月8日 星期四清晨5:17:59 [UTC+8] 的信中寫道: On 07/12/2022 03:23, Jach Feng wrote: s0 = r'\x0a' At this moment it was done by def to1byte(matchobj): return chr(int('0x' + matchobj.group(1), 16)) s1 = re.sub(r'\\x([0-9

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-08 Thread Thomas Passin
The original post started out with r'\x0a' but then talked about '\xdd'. I assumed that there was a pattern here, a raw string containing "\x" and two more characters, and made a suggestion for converting any string with that pattern. But the OP was very unclear

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-08 Thread Weatherby,Gerard
I’m not understanding the task. The sample code given is converting the input r’\x0a’ to a newline, it appears. import re def exam(z): print(f"examine {type(z)} {z}") for c in z: print(f"{ord(c)} {c}") s0 = r'\x0a' def to1byte(mat

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-07 Thread Jach Feng
Peter Otten 在 2022年12月8日 星期四清晨5:17:59 [UTC+8] 的信中寫道: > On 07/12/2022 03:23, Jach Feng wrote: > > s0 = r'\x0a' > > At this moment it was done by > > > > def to1byte(matchobj): > > return chr(int('0x' + matchobj.group(1), 16))

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-07 Thread Jach Feng
Roel Schroeven 在 2022年12月7日 星期三下午4:42:48 [UTC+8] 的信中寫道: > Op 7/12/2022 om 4:37 schreef Jach Feng: > > MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道: > > > On 2022-12-07 02:23, Jach Feng wrote: > > > > s0 = r'\x0a' > > > > At this moment i

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-07 Thread Peter Otten
On 07/12/2022 03:23, Jach Feng wrote: s0 = r'\x0a' At this moment it was done by def to1byte(matchobj): return chr(int('0x' + matchobj.group(1), 16)) s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0) But, is it that difficult on doing this sim

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-07 Thread Jach Feng
Thomas Passin 在 2022年12月7日 星期三中午12:51:32 [UTC+8] 的信中寫道: > On 12/6/2022 9:23 PM, Jach Feng wrote: > > s0 = r'\x0a' > > At this moment it was done by > > > > def to1byte(matchobj): > > return chr(int('0x' + matchobj.group(1), 16))

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-07 Thread Roel Schroeven
Op 7/12/2022 om 4:37 schreef Jach Feng: MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道: > On 2022-12-07 02:23, Jach Feng wrote: > > s0 = r'\x0a' > > At this moment it was done by > > > > def to1byte(matchobj): > > return chr(int('0x'

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-06 Thread Thomas Passin
On 12/6/2022 9:23 PM, Jach Feng wrote: s0 = r'\x0a' At this moment it was done by def to1byte(matchobj): return chr(int('0x' + matchobj.group(1), 16)) s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0) But, is it that difficult on doing this s

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-06 Thread Jach Feng
MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道: > On 2022-12-07 02:23, Jach Feng wrote: > > s0 = r'\x0a' > > At this moment it was done by > > > > def to1byte(matchobj): > > return chr(int('0x' + matchobj.group(1), 16)) > > s1

Re: How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-06 Thread MRAB
On 2022-12-07 02:23, Jach Feng wrote: s0 = r'\x0a' At this moment it was done by def to1byte(matchobj): return chr(int('0x' + matchobj.group(1), 16)) s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0) But, is it that difficult on doing this simp

How to convert a raw string r'\xdd' to '\xdd' more gracefully?

2022-12-06 Thread Jach Feng
s0 = r'\x0a' At this moment it was done by def to1byte(matchobj): return chr(int('0x' + matchobj.group(1), 16)) s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0) But, is it that difficult on doing this simple thing? --Jach -- https://mail.python.org/mailman/listinfo/python-list

Python gets a mention on Reddit - in r/tifu

2022-08-07 Thread Skip Montanaro
Not exactly where I expected to see Python mentioned on Reddit, but I found this amusing (yes, despite the subreddit, it should be safe for work): https://www.reddit.com/r/tifu/comments/wibmkh/tifu_by_teaching_my_13yo_brother_python/ Just a little diversion for a Sunday afternoon. I was

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-30 Thread hongy...@gmail.com
owing command, but > > > failed: > > > > > > $ in2csv --sheet 'Sheet1' 2021-2022-1.xls > > > XLRDError: Unsupported format, or corrupt file: Expected BOF record; > > > found b'\r\n\r\n\r\n\r\n' > > > > > > The

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
' 2021-2022-1.xls > > XLRDError: Unsupported format, or corrupt file: Expected BOF record; found > > b'\r\n\r\n\r\n\r\n' > > > > The above testing file is located at here [1]. > > > > [1] https://github.com/hongyi-zhao/temp/blob/master/2021-2022-1.xls

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread Peter J. Holzer
On 2021-09-29 01:22:03 -0700, hongy...@gmail.com wrote: > I tried to convert a xls file into csv with the following command, but failed: > > $ in2csv --sheet 'Sheet1' 2021-2022-1.xls > XLRDError: Unsupported format, or corrupt file: Expected BOF record; found > b&#

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread J.O. Aho
2022-1.xls XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n' The above testing file is located at here [1]. [1] https://github.com/hongyi-zhao/temp/blob/master/2021-2022-1.xls Any hints for fixing this problem? You need to delete the 13 first lin

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
nvert a xls file into csv with the following command, but > >>> failed: > >>> > >>> $ in2csv --sheet 'Sheet1' 2021-2022-1.xls > >>> XLRDError: Unsupported format, or corrupt file: Expected BOF record; > >>> found b&#x

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
> > XLRDError: Unsupported format, or corrupt file: Expected BOF record; found > > b'\r\n\r\n\r\n\r\n' > > > > The above testing file is located at here [1]. > > > > [1] https://github.com/hongyi-zhao/temp/blob/master/2021-2022-1.xls > > &

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread J.O. Aho
On 29/09/2021 10.22, hongy...@gmail.com wrote: I tried to convert a xls file into csv with the following command, but failed: $ in2csv --sheet 'Sheet1' 2021-2022-1.xls XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n' The a

XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
I tried to convert a xls file into csv with the following command, but failed: $ in2csv --sheet 'Sheet1' 2021-2022-1.xls XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n' The above testing file is located at here [1]. [1] https

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Antoon Pardon
Op 27/01/21 om 05:17 schreef Dan Stromberg: On Tue, Jan 26, 2021 at 8:13 PM Dan Stromberg wrote: On Tue, Jan 26, 2021 at 4:01 PM C W wrote: Hello everyone, I'm a long time Matlab and R user working on data science. How do you troubleshooting/debugging in Python? I frequently

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Grant Edwards
On 2021-01-27, C W wrote: > My main takeaway from the discussion so far is that: you can't troubleshoot > Python without some kind of breakpoint or debugger. How odd. I do it all the time. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Alan Gauld via Python-list
On 27/01/2021 23:04, 2qdxy4rzwzuui...@potatochowder.com wrote: > systems are more painful than others, but yes, some debugging > environments are more painful than others, too. Very true! but a good debugger is a godsend. Howevder... > A well placed call to print (they're not "print statements"

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Alan Gauld via Python-list
to have mentioned yet is to use the interactive prompt. Simply run the program with the -i flag and the program will stay in the interpreter at the >>> prompt. Similar to what you seem to be used to doing in R... >From there you can print the current value of variables, inspect ob

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Michael Torrie
On 1/27/21 11:42 AM, C W wrote: > For learning purposes, here's the files: > https://www.dropbox.com/sh/a3iy40rcvib4uvj/AAADmlM2i6NquWC1SV0nZfnDa?dl=0 > > Yes, you are correct about "employee" and "person" discrepancies. For now, > the list comprehension is where I get stuck. > > I'd like to know

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread J. Pic
Also - https://github.com/cool-RR/pysnooper - https://github.com/andy-landy/traceback_with_variables -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread duncan smith
On 27/01/2021 22:41, C W wrote: > Great tutorial Irv, very simple with if-else example, gets the point > across. > > My main takeaway from the discussion so far is that: you can't troubleshoot > Python without some kind of breakpoint or debugger. > [snip] Really? Duncan -- https://mail.python

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread 2QdxY4RzWzUUiLuE
On 2021-01-27 at 17:41:52 -0500, C W wrote: > Great tutorial Irv, very simple with if-else example, gets the point > across. Disclaimer: I did not watch the video. > My main takeaway from the discussion so far is that: you can't > troubleshoot Python without some kind of breakpoint or debugger

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Great tutorial Irv, very simple with if-else example, gets the point across. My main takeaway from the discussion so far is that: you can't troubleshoot Python without some kind of breakpoint or debugger. I suppose I can't take the functional programming debugger style like C, Matlab,

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Irv Kalb
On Jan 26, 2021, at 5:28 PM, William Ray Wing via Python-list wrote: > > > >> On Jan 26, 2021, at 2:00 PM, C W wrote: >> >> Hello everyone, >> >> I'm a long time Matlab and R user working on data science. How do you >> troubleshooting/de

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Dietmar Schwertberger
On 27.01.2021 01:52, Skip Montanaro wrote: Agree with Grant on these points. I certainly use gdb to debug C code (like the interpreter), but for Python code, tracebacks and print statements pretty much take care of things. I thought so for the first 12 year of using Python. For the last 12 years

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
For learning purposes, here's the files: https://www.dropbox.com/sh/a3iy40rcvib4uvj/AAADmlM2i6NquWC1SV0nZfnDa?dl=0 Yes, you are correct about "employee" and "person" discrepancies. For now, the list comprehension is where I get stuck. I'd like to know how the experts on here are approaching and d

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Hi Cameron, Yes, you are correct in all above. There's a mistake in my copy paste. Thanks for pointing that out! On Wed, Jan 27, 2021 at 12:58 AM Cameron Simpson wrote: > On 27Jan2021 00:19, C W wrote: > >Here's the code again, class should be called PERSONDatabase, > >misspelled > >earlier: >

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Michael Torrie
On 1/26/21 10:19 PM, C W wrote: > Traceback (most recent call last): >File "/Users/Mike/Documents/Mike/main.py", line 95, in > main() >File "/Users/Mike/Documents/Mike/main.py", line 86, in main > args = get_feed() >File "/Users/Mike/DocumentsMike/main.py", line 32, in get_

RE: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread David Raymond
In regards to the various comments about adding in print() calls what I've found myself doing is to basically always use the logging module, and use logging.debug() for those. Somewhere at the top of the script I'll have a line like... DEBUG = False ...and when initializing the handler to stdo

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Chris Angelico
On Wed, Jan 27, 2021 at 8:21 PM Chris Green wrote: > > Skip Montanaro wrote: > > CW> How do you troubleshooting/debugging in Python? > > > > GE> Mostly I read exception trace and read the code and think about it. > > GE> If that doesn't work, I add some print() or syslog() calls. > > > > CW> I kn

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Chris Green
Skip Montanaro wrote: > CW> How do you troubleshooting/debugging in Python? > > GE> Mostly I read exception trace and read the code and think about it. > GE> If that doesn't work, I add some print() or syslog() calls. > > CW> I know hardcore computer scientists would tell me about Python debugge

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Cameron Simpson
On 27Jan2021 00:19, C W wrote: >Here's the code again, class should be called PERSONDatabase, >misspelled >earlier: >class PERSONDatabase: > def __init__(self, id, created_at, name, attend_date, distance): > self._id = id > self.created_at = created_at > self.name= name > se

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread joseph pareti
To debug python code I use spyder from the anaconda distribution Am Mittwoch, 27. Januar 2021 schrieb C W : > Hi Michael, > Here's the code again, class should be called PERSONDatabase, misspelled > earlier: > class PERSONDatabase: >def __init__(self, id, created_at, name, attend_date, distan

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Hi Michael, Here's the code again, class should be called PERSONDatabase, misspelled earlier: class PERSONDatabase: def __init__(self, id, created_at, name, attend_date, distance): self._id = id self.created_at = created_at self.name= name self.attend_date = attend_date

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Michael Torrie
On 1/26/21 8:30 PM, Grant Edwards wrote: > Me too (MS in CSci), but I can't remember the last time I used a > debugger. I use a debugger frequency in C++, and sometimes C. Even running a debugger on an attached device like an Arduino is sometimes very useful. Good debuggers let you do things lik

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Michael Torrie
On 1/26/21 8:37 PM, C W wrote: > I have a naive question. How do I use traceback or trace the stack? In > particular, I'm using VS Code with Python interactive console. Show us the traceback here and we can help you interpret it. Copy and paste it from the VS Code console. > Say, I want to print

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Dan Stromberg
On Tue, Jan 26, 2021 at 8:13 PM Dan Stromberg wrote: > > On Tue, Jan 26, 2021 at 4:01 PM C W wrote: > >> Hello everyone, >> >> I'm a long time Matlab and R user working on data science. How do you >> troubleshooting/debugging in Python? >> > > I

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Dan Stromberg
On Tue, Jan 26, 2021 at 4:01 PM C W wrote: > Hello everyone, > > I'm a long time Matlab and R user working on data science. How do you > troubleshooting/debugging in Python? > I frequently read tracebacks and think about what's up in the code. I also often add p

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Grant Edwards
On 2021-01-27, Cameron Simpson wrote: > Me either. Like grant, i fall into the "look at the stack trace and > think a bit, then put in print() calls or similar to show me whether > things are what I expect them to be when the code runs". > > I actually have a Computer Science degree, but I thin

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Thanks for your replies. My apologies for the poor indent. I'm rewriting the code below. class NEODatabase: def __init__(self, id, created_at, name, attend_date, distance): self._id = id self.created_at = created_at self.name = name self.attend_date = attend_date self.distance = distance @classme

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Ed Leafe
On Jan 26, 2021, at 18:16, Grant Edwards wrote: > >> How do you troubleshooting/debugging in Python? > > Mostly I read exception trace and read the code and think about it. > > If that doesn't work, I add some print() or syslog() calls. > > If I really get stuck, I try to write as small a prog

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread William Ray Wing via Python-list
> On Jan 26, 2021, at 2:00 PM, C W wrote: > > Hello everyone, > > I'm a long time Matlab and R user working on data science. How do you > troubleshooting/debugging in Python? > Another approach is to run the code in an IDE. I happen to use Wing, but that is a co

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Cameron Simpson
On 26Jan2021 14:00, C W wrote: >I'm a long time Matlab and R user working on data science. How do you >troubleshooting/debugging in Python? > >I ran into this impossible situation to debug: >class person: >def __init__(self, id, created_at, name, attend_date, distance): &

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Skip Montanaro
CW> How do you troubleshooting/debugging in Python? GE> Mostly I read exception trace and read the code and think about it. GE> If that doesn't work, I add some print() or syslog() calls. CW> I know hardcore computer scientists would tell me about Python debugger. GE> I've been writing Python fo

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Grant Edwards
On 2021-01-26, C W wrote: > How do you troubleshooting/debugging in Python? Mostly I read exception trace and read the code and think about it. If that doesn't work, I add some print() or syslog() calls. If I really get stuck, I try to write as small a program as possible that demonstrates the

How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Hello everyone, I'm a long time Matlab and R user working on data science. How do you troubleshooting/debugging in Python? I ran into this impossible situation to debug: class person: def __init__(self, id, created_at, name, attend_date, distance): """Create a new `person

Re: Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Bischoop
read. I would recommend (a) decoding the >> > bytes to text, and (b) splitting it on "\r\n", thus getting it >> > line-by-line. >> > >> > What you may want to consider, though, is using an actual IRC library. >> > It'll handle all kinds of

Re: Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Chris Angelico
On Fri, Nov 6, 2020 at 11:51 PM Bischoop wrote: > > On 2020-11-06, Chris Angelico wrote: > > > You're currently dumping out the raw bytes. Not very interesting, and > > that's why it's not easy to read. I would recommend (a) decoding the > > bytes to

Re: Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Bischoop
On 2020-11-06, Chris Angelico wrote: > You're currently dumping out the raw bytes. Not very interesting, and > that's why it's not easy to read. I would recommend (a) decoding the > bytes to text, and (b) splitting it on "\r\n", thus getting it > line-by-li

Re: Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Chris Angelico
On Fri, Nov 6, 2020 at 11:26 PM Bischoop wrote: > > > I'm experimenting with irc bot. I've made it connecting, reading etc but > everything is difficult to read. > > It's coming like one long string without breaking lines. > How to mace it printing i

Incoming datas difficult to read "\r\n" and "\n"

2020-11-06 Thread Bischoop
I'm experimenting with irc bot. I've made it connecting, reading etc but everything is difficult to read. It's coming like one long string without breaking lines. How to mace it printing in new line after: \r\n or \n in data? -- b':weber.freenode.net 001 saaaki :Wel

Re: s.sendall(filename + "\r\n") TypeError: a bytes-like object is required, not 'str'

2019-06-19 Thread Chris Angelico
; > port = 70 > host = sys.argv[1] > filename = sys.argv[2] > > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.connect((host, port)) > > s.sendall(filename + "\r\n") > > while 1: > buf = s.recv(2048) > if not len(buf): &

s.sendall(filename + "\r\n") TypeError: a bytes-like object is required, not 'str'

2019-06-19 Thread vakul bhatt
) s.connect((host, port)) s.sendall(filename + "\r\n") while 1: buf = s.recv(2048) if not len(buf): break sys.stdout.write(buf) Error : python goopher.py quux.org / Traceback (most recent call last): File "goopher.p

Re: Mixing R and Python in the same Jupyter Notebook and finding Python code within an RMarkdown document

2018-11-03 Thread Thomas Jollans
On 03/11/2018 00:17, Spencer Graves wrote: > Hello, All: > > >   Two questions: > > >         1.  Is it feasible to mix R and Python code in the same > Jupyter notebook?  If yes, can you please point me to an example? While Jupyter are always linked to *one* s

Mixing R and Python in the same Jupyter Notebook and finding Python code within an RMarkdown document

2018-11-02 Thread Spencer Graves
Hello, All:   Two questions:         1.  Is it feasible to mix R and Python code in the same Jupyter notebook?  If yes, can you please point me to an example?         2.  How can one find Python code from within and R Markdown document?           ** "

Re: File opening modes (r, w, a ...)

2018-02-22 Thread jfong
gt; >> If like me you always forget the details of > >> file opening mode, the following table provides > >> a good summary > >> > >>| r r+ w w+ a a+ > >> --|-- > >

Re: File opening modes (r, w, a ...)

2018-02-22 Thread Lew Pitcher
he following table provides >> a good summary >> >>| r r+ w w+ a a+ >> --|-- >> read | + +++ >> write | ++ ++ + >> write

Re: File opening modes (r, w, a ...)

2018-02-22 Thread jfong
ast於 2018年2月22日星期四 UTC+8下午8時33分00秒寫道: > Hello > > I share a very valuable table I found on > StackOverflow about file opening modes > > If like me you always forget the details of > file opening mode, the following table provides > a good summary > >

Re: File opening modes (r, w, a ...)

2018-02-22 Thread Steven D'Aprano
On Thu, 22 Feb 2018 13:32:45 +0100, ast wrote: > Hello > > I share a very valuable table I found on StackOverflow about file > opening modes > > If like me you always forget the details of file opening mode, the > following table provides a good summary Thanks! -- Steve -- https://mail.py

File opening modes (r, w, a ...)

2018-02-22 Thread ast
Hello I share a very valuable table I found on StackOverflow about file opening modes If like me you always forget the details of file opening mode, the following table provides a good summary | r r+ w w+ a a+ --|-- read

Re: Is there something like head() and str() of R in python?

2017-11-20 Thread Mario R. Osorio
On Sunday, November 19, 2017 at 2:05:12 PM UTC-5, Peng Yu wrote: > Hi, R has the functions head() and str() to show the brief content of > an object. Is there something similar in python for this purpose? > > For example, I want to inspect the content of the variable "train&quo

Is there something like head() and str() of R in python?

2017-11-19 Thread Peng Yu
Hi, R has the functions head() and str() to show the brief content of an object. Is there something similar in python for this purpose? For example, I want to inspect the content of the variable "train". What is the best way to do so? Thanks. $ cat demo.py from __future__ impor

Re: Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

2017-05-28 Thread Steve D'Aprano
On Mon, 29 May 2017 12:15 am, Jon Ribbens wrote: > On 2017-05-28, Steve D'Aprano wrote: >> What exactly did you think I got wrong? > > 3.6 does preserve the dict order. It isn't a guarantee so may change > in future versions, but it is what 3.6 actually does. Did I say it didn't? I said you ca

Re: Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

2017-05-28 Thread Ian Kelly
On May 28, 2017 8:23 AM, "Jon Ribbens" wrote: > On 2017-05-28, Steve D'Aprano wrote: >> What exactly did you think I got wrong? > > 3.6 does preserve the dict order. It isn't a guarantee so may change > in future versions, but it is what 3.6 actually does. No, it's what CPython 3.6 actually does

Re: Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

2017-05-28 Thread Jon Ribbens
On 2017-05-28, Steve D'Aprano wrote: > What exactly did you think I got wrong? 3.6 does preserve the dict order. It isn't a guarantee so may change in future versions, but it is what 3.6 actually does. >> If you're asking "given a fixed Python version, and where appropriate >> PYTHONHASHSEED=0,

Re: Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

2017-05-28 Thread Steve D'Aprano
On Sun, 28 May 2017 11:12 pm, Jon Ribbens wrote: > On 2017-05-28, Bill Deegan wrote: >> As a follow up to a discussion on IRC #python channel today. >> >> Assuming the same order of insertions of the same items to a dictionary >> would the iteration of a dictionary be the same (not as the order o

Re: Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

2017-05-28 Thread Jon Ribbens
On 2017-05-28, Bill Deegan wrote: > As a follow up to a discussion on IRC #python channel today. > > Assuming the same order of insertions of the same items to a dictionary > would the iteration of a dictionary be the same (not as the order of > insertion, just from run to run) for Python 2.7 up t

Re: Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

2017-05-27 Thread Steve D'Aprano
On Sun, 28 May 2017 10:51 am, Bill Deegan wrote: > Greetings, > > As a follow up to a discussion on IRC #python channel today. > > Assuming the same order of insertions of the same items to a dictionary > would the iteration of a dictionary be the same (not as the order of > insertion, just from

Dictionary order (Is it consistent up to py3.3 unless using -R or PYTHONHASHSEED is set)

2017-05-27 Thread Bill Deegan
Greetings, As a follow up to a discussion on IRC #python channel today. Assuming the same order of insertions of the same items to a dictionary would the iteration of a dictionary be the same (not as the order of insertion, just from run to run) for Python 2.7 up to python 3.3? And again at Pytho

Re: pip install -r requirements.txt fails with Python 3.6 on Windows 10

2017-01-06 Thread breamoreboy
On Tuesday, January 3, 2017 at 8:08:37 PM UTC, Uri Even-Chen wrote: > Thank you, I'll consider to update our requirements to latest versions of > all packages. Last time I checked in 22th December 2016 and all our > requirements were the latest versions. In the meantime we can keep using > Python 3

Re: pip install -r requirements.txt fails with Python 3.6 on Windows

2017-01-05 Thread Terry Reedy
On 1/3/2017 3:07 PM, Uri Even-Chen wrote: > What are the reasons to upgrade Python to 3.6? The same as for any new version: New features -- see What's New in 3.6. New bug fixes. New performance improvements. Reasons against: The effort to make sure all dependencies are available for 3.6* Possibl

Re: pip install -r requirements.txt fails with Python 3.6 on Windows

2017-01-05 Thread Uri Even-Chen
Thank you, I'll consider to update our requirements to latest versions of all packages. Last time I checked in 22th December 2016 and all our requirements were the latest versions. In the meantime we can keep using Python 3.5. By the way, Travis CI tests passed with the same requirements and Pyt

Re: pip install -r requirements.txt fails with Python 3.6 on Windows 10

2017-01-03 Thread Terry Reedy
On 1/3/2017 3:07 PM, Uri Even-Chen wrote: What are the reasons to upgrade Python to 3.6? The same as for any new version: New features -- see What's New in 3.6. New bug fixes. New performance improvements. Reasons against: The effort to make sure all dependencies are available for 3.6* Possib

Re: pip install -r requirements.txt fails with Python 3.6 on Windows 10

2017-01-03 Thread breamoreboy
On Tuesday, January 3, 2017 at 8:08:37 PM UTC, Uri Even-Chen wrote: > Thank you, I'll consider to update our requirements to latest versions of > all packages. Last time I checked in 22th December 2016 and all our > requirements were the latest versions. In the meantime we can keep using > Python 3

Re: pip install -r requirements.txt fails with Python 3.6 on Windows 10

2017-01-03 Thread Uri Even-Chen
Thank you, I'll consider to update our requirements to latest versions of all packages. Last time I checked in 22th December 2016 and all our requirements were the latest versions. In the meantime we can keep using Python 3.5. By the way, Travis CI tests passed with the same requirements and Python

Re: pip install -r requirements.txt fails with Python 3.6 on Windows 10

2017-01-03 Thread INADA Naoki
illow==4.0.0. Pillow 4.0.0 provides binary wheel for Python 3.6, from 2017-01-02. https://pypi.python.org/pypi/Pillow/4.0.0 On Tue, Jan 3, 2017 at 10:19 PM, Uri Even-Chen wrote: > (.venv) C:\Uri\Speedy Net\Git\speedy-net [public]>pip install -r > requirements.txt > Requirement already

pip install -r requirements.txt fails with Python 3.6 on Windows 10

2017-01-03 Thread Uri Even-Chen
(.venv) C:\Uri\Speedy Net\Git\speedy-net [public]>pip install -r requirements.txt Requirement already satisfied: Django==1.10.4 in c:\uri\speedy net\git\speedy-net [public]\.venv\lib\site-packages (from -r requirements.txt (line 2)) Requirement already satisfied: django-crispy-forms==1.6.1 i

A bioinformatics module similar to DEseq in R

2016-08-08 Thread nir . yakovi1
Hi! is there a Python module equivalent\as similar as possible to 'DEseq' in R? It's just that my team's (many) scripts use it, and to start modifying them all to support some different bioinformatics module would be a nightmare. Thanks! -- https://mail.python.org/mailman/listinfo/python-list

Re: r"\"" ??? (was A simple single line, triple-quoted comment)

2015-04-03 Thread Rustom Mody
On Friday, April 3, 2015 at 8:10:54 PM UTC+5:30, Chris Angelico wrote: > On Fri, Apr 3, 2015 at 11:52 PM, Rustom Mody wrote: > > Speaking about silliness of definitions, I was knocked out in class by this > > today: > > > >>>> r"\"" > >

Re: r"\"" ??? (was A simple single line, triple-quoted comment)

2015-04-03 Thread Chris Angelico
On Fri, Apr 3, 2015 at 11:52 PM, Rustom Mody wrote: > Speaking about silliness of definitions, I was knocked out in class by this > today: > >>>> r"\"" > '\\"' > > Seeing the docs > https://docs.python.org/3.4/reference/lex

r"\"" ??? (was A simple single line, triple-quoted comment)

2015-04-03 Thread Rustom Mody
On Friday, April 3, 2015 at 12:43:32 PM UTC+5:30, Marko Rauhamaa wrote: > 3. Arguing about definitions is silly. Is 0 a natural number? Is 1 a > prime number? Speaking about silliness of definitions, I was knocked out in class by this today: >>> r"\""

  1   2   3   4   5   >