Re: python script for .dat file

2016-04-05 Thread Mark Lawrence via Python-list
/mailman/listinfo/python-list

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
On 06/04/2016 12:06, BartC wrote: On 05/04/2016 06:48, Gordon( Hotmail ) wrote: I am struggling to understand the basic principles of Python having spent many years as a pure Amateur tinkering with a variety of BASIC Last time I looked, there seemed to be around 250 dialects of Basic, and

Re: Checking function's parameters (type, value) or not ?

2016-04-06 Thread Mark Lawrence via Python-list
) and nber >= 0 assert isinstance(base, int) and base >= 2 assert isinstance(use_af, bool) assert isinstance(sep, str) and len(sep) == 1 tbc With these tests, you are sure that the function to_base is well used. But it slows down the program. Without, python interpreter may crash lat

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
On 06/04/2016 14:54, BartC wrote: On 06/04/2016 12:46, Marko Rauhamaa wrote: BartC : It'll cope with ordinary coding as well, although such programs seem to be frowned upon here; they are not 'Pythonic'. I wonder what is left of Python after your list of exclusions. Ther

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
upon here; they are not 'Pythonic'. I wonder what is left of Python after your list of exclusions. There are plenty of features that /I/ consider must-have, which Python doesn't have. It has to emulate them, unsatisfactorily, with variables or classes or functions, or do without. P

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
he knows squat. About Python. On the main Python list. Perhaps he should hence forward be known as RUE2? Actually that is unfair, the original RUE only complains about PEP393 unicode, BartC complains about everything. I still do not believe that he could organise a piss up in a brewery,

Re: deque is not a subclass of Sequence.

2016-04-07 Thread Mark Lawrence via Python-list
ssubclass(deque, Sequence) True -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: how to convert code that uses cmp to python3

2016-04-07 Thread Mark Lawrence via Python-list
low Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: how to convert code that uses cmp to python3

2016-04-07 Thread Mark Lawrence via Python-list
se the two tuples almost always twice. Once to find out if they are equal and if not a second time to find out which is greater. Have you read this https://wiki.python.org/moin/HowTo/Sorting ? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [beginner] What's wrong?

2016-04-08 Thread Mark Lawrence via Python-list
in range(10)`. But if I want to loop from 10 to 20, my first instinct is to write `for i in range(10, 20)`, and then I'm left figuring out why my loop isn't executing the last step. "First instinct"? "I expected"? The Python docs might not be perfect, but they

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list, why don't the moderators put a stop to such tripe? -- My fellow Pythonistas, ask not

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Mark Lawrence via Python-list
rence -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Mark Lawrence via Python-list
order) are the 15th and 22nd most common and they are separated by only one hammer position. On the other hand, the QWERTY layout puts jk together, but they almost never appear together in English text. Where do you get this (kind of) statistical data? Again, where is the relevance to Pyth

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 20:25, Tim Golden wrote: On 09/04/2016 20:13, Mark Lawrence via Python-list wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 20:41, Joe wrote: Sorry, I was desperate I deleted the post You didn't. This will be showing in the archives in several places, e.g https://mail.python.org/pipermail/python-list/2016-April/707160.html -- My fellow Pythonistas, ask not what our language can do for you

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 21:22, alister wrote: On Sat, 09 Apr 2016 20:13:15 +0100, Mark Lawrence wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list

Re: one-element tuples

2016-04-11 Thread Larry Hudson via Python-list
n use a for loop for the remaining strings. Note that this also works correctly for an empty list -- where it will do nothing. I hope this gets you started reworking (or re-thinking) your program. -- https://mail.python.org/mailman/listinfo/python-list

RE: how to setup for localhost:8000

2016-04-14 Thread Dan Strohl via Python-list
"well, just do this, and poof, all will be good". Sorry it's not more. Dan > -Original Message- > From: Python-list [mailto:[email protected]] > On Behalf Of [email protected] > Sent: Thursday, April 14, 2016 1:50 PM > To:

Re: How to XOR a byte output?

2016-04-14 Thread Chris Juried via Python-list
Hello list, I am new to the list and was wondering if anyone is using Python for MCU programing? In particular the AVR and ARM based controllers. Is Python a plausible language for MCU programming or is C/C++ or Assembly the only way to go? Thanks in advance for your insight.  Sincerely

RE: How to print a part of a string?

2016-04-15 Thread Dan Strohl via Python-list
As with lots of things in python, there are lots of ways of approaching this, here are some hints for you to think about (in no particular order): - REGEX - replace() - string[:y] - split() And of course, you could consider creating a table with every possible string that could start with

Fraud

2016-04-16 Thread Mel Drosis via Python-list
My phone my accounts my home network have all been affected because of someone using coding from Python and Linux and GitHub and json. I don't even know what this stuff is but how do I get rid of it all. It's ruined my life. Sent from my iPhone -- https://mail.python.org/mailma

Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

2016-04-27 Thread Christopher Reimer via Python-list
@property def notation(self): return self._state['notation'] @property def position(self): return self._state['position'] @position.setter def position(self, position): self._state['position'] = position if self._state['first_move']: self._state['first_move'] = False self._state['move_count'] += 1 -- https://mail.python.org/mailman/listinfo/python-list

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
ore (and more useful) help you are likely to receive. To this lists credit, even if you are completely unclear in your question, you will likely get *something* back, (as you saw with Peters response), but what you get back is more likely to be a general suggestion rather than a specific fix fo

RE: online python courses

2016-04-28 Thread Dan Strohl via Python-list
> -Original Message----- > From: Python-list [mailto:[email protected]] > On Behalf Of [email protected] > Sent: Thursday, April 28, 2016 7:15 AM > To: [email protected] > Subject: online python courses > > I am follows on th

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
meeting_list.append((id, meeting)) > -Original Message- > From: Python-list [mailto:[email protected]] > On Behalf Of Sayth Renshaw > Sent: Thursday, April 28, 2016 7:00 AM > To: [email protected] > Subject: Re: Controlling the passin

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
formation about that specific argument. > -Original Message- > From: Python-list [mailto:[email protected]] > On Behalf Of alister > Sent: Thursday, April 28, 2016 9:45 AM > To: [email protected] > Subject: Re: What should Python apps do when a

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
From: John Wong [mailto:[email protected]] Sent: Thursday, April 28, 2016 10:06 AM To: Dan Strohl Cc: alister ; [email protected] Subject: Re: What should Python apps do when asked to show help? On Thu, Apr 28, 2016 at 1:02 PM, Dan Strohl via Python-list mailto:[email protected]

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
I would hesitate to take this approach unless the tool was one that only I was going to be using, and I knew exactly what environments it was going to be in. I know that many of the system items in python work differently in different operating systems, and different os's report t

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
to a common library. > -Original Message- > From: Python-list [mailto:[email protected]] > On Behalf Of Random832 > Sent: Thursday, April 28, 2016 10:30 AM > To: [email protected] > Subject: Re: What should Python apps do when asked to show help? >

Simplest way to locate a string in a column and get the value on the same row in another column

2016-04-28 Thread David Shi via Python-list
What is the simplest way to locate a string in a column and get the value on the same row in another column ? 1  a2  b3  c Locate b and obtain 2 in a table. Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Pivot table of Pandas

2016-04-28 Thread David Shi via Python-list
python.org/mailman/listinfo/python-list

Not x.islower() Versus x.isupper Output Results

2016-04-29 Thread Christopher Reimer via Python-list
.islower()' and 'x.isupper()' be identical? The final form of this code is this: list(filter(str.isupper, string)) ['W', 'T', 'F'] Thank you, Chris R. -- https://mail.python.org/mailman/listinfo/python-list

How to fill in abbreviation in one column based on state name in another column?

2016-04-30 Thread David Shi via Python-list
S": "VI", "MARSHALL ISLANDS": "MH",                 "WYOMING": "WY", "OHIO": "OH", "SOUTH CAROLINA": "SC", "INDIANA": "IN", "NEVADA": "NV", "LOUISIANA": "LA",                 "NORTHERN MARIANA ISLANDS": "MP", "NEBRASKA": "NE", "ARIZONA": "AZ", "WISCONSIN": "WI", "NORTH DAKOTA": "ND",                 "Armed Forces Europe": "AE", "PENNSYLVANIA": "PA", "OKLAHOMA": "OK", "KENTUCKY": "KY", "RHODE ISLAND": "RI",                  "DISTRICT OF COLUMBIA": "DC", "ARKANSAS": "AR", "MISSOURI": "MO", "TEXAS": "TX", "MAINE": "ME"} #table['moa_state_name'] = map(lambda x: x.upper(), table['moa_state_name'])def convert_state(row):    abbrev1 =  state_to_code(table['moa_state_name']) #'aatest'    if abbrev1:         return abbrev1 ##state_to_code[abbrev[0]]    return np.nan#print convert_state(table['moa_state_name']) table.insert(0, "abbrev", np.nan)table['abbrev'] = table.apply(convert_state, axis=1) print state_to_code['ARKANSAS'] -- https://mail.python.org/mailman/listinfo/python-list

How to fill in abbreviation in one column based on state name in another column?

2016-05-01 Thread David Shi via Python-list
ate_name']) #'aatest'    if abbrev1:         return abbrev1 ##state_to_code[abbrev[0]]    return np.nan#print convert_state(table['moa_state_name']) table.insert(0, "abbrev", np.nan) table['abbrev'] = table.apply(convert_state, axis=1)print state_to_code['ARKANSAS'] -- https://mail.python.org/mailman/listinfo/python-list

RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list
Take a look at the docs for print() https://docs.python.org/3.5/library/functions.html#print str() https://docs.python.org/3.5/library/stdtypes.html#str repr() https://docs.python.org/3.5/library/functions.html#repr When you do "print(object)", python will run everything through

RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list
h(self):" pattern, sometimes I overlook these in the code (even when I put them there). This however is the shortest since it really just tells the object to return object.__str__() if either object.__repr__() OR object.__str__() is called. __repr__ = __str__ This probably doesn't mat

RE: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Dan Strohl via Python-list
> > Alternatively, consider: the ‘__repr__’ method is intended to return a > *programmer's* representation of the object. Commonly, this is text which > looks like the Python expression which would create an equal > instance:: Definitely true per what _repr__ is supposed to do per p

How to call a Python Class?

2016-05-03 Thread David Shi via Python-list
I found a Python class within an Open Source software. I would like to use it in my own Python script. I tried to import it, but I got following message. from intersection import *Traceback (most recent call last):  File "", line 1, in     from intersection import *ImportError: bad ma

Re: How to become more motivated to learn Python

2016-05-03 Thread Larry Hudson via Python-list
and games. ( I have been addicted to computer games for a long time lol --- To be able to design a blockbuster like Starcraft 2, Diablo 3 or Final Fantasy 7 would be an incredible feat !) For an introduction to Python via games you might want to check out the book "Invent Your Own Com

Re: pylint woes

2016-05-08 Thread Larry Hudson via Python-list
to stick that "-->" as a prompt at the end, but obviously this (or a similar marker) is optional. -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-08 Thread Larry Hudson via Python-list
On 05/08/2016 03:07 PM, Chris Angelico wrote: On Mon, May 9, 2016 at 6:45 AM, Larry Hudson via Python-list wrote: On 05/08/2016 06:01 AM, Chris Angelico wrote: [snip...] ... I like to recommend a little thing called "IIDPIO debugging" - I

Re: Python 3.5.1 Not Working

2016-05-13 Thread Aidan Silcock via Python-list
Sent from Yahoo Mail on Android On Fri, 13 May, 2016 at 16:59, Aidan Silcock wrote: HelloI have tried to download python 3.5.1 today and it has downloaded but each time I try to open it it says I need to Modify, Repair or Uninstall the program.I have tried repairing it neumerous times

How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
I lost my indexes after grouping in Pandas. I managed to rest_index and got back the index column. But How can I get back a index row? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
Hello, Michael,Thank you.  Yes, aster grouping I lost my indexing in both x, y directions. How to convert a row, and a column into indexes or labels? On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote: I lost my

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
Hello, Michael, Why reset_index before grouping? Regards. David On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote: I lost my indexes after grouping in Pandas. I managed to rest_index and got back the index column

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
choose how your aggregation will operate on that column. On Fri, May 13, 2016 at 3:29 PM David Shi wrote: Hello, Michael, Why reset_index before grouping? Regards. David On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
eset_index before grouping? Regards. David On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote: I lost my indexes after grouping in Pandas. I managed to rest_index and got back the index column. But How can I get back a index

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
hy don't you make a little example of before and after the grouping? This mailing list does not accept attachments, so you'll have to make do with pasting a few rows of comma-separated or tab-separated values. On Fri, May 13, 2016 at 3:56 PM Michael Selik wrote: In order to preserve yo

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
d Shi wrote: Dear Michael, I have done a number of operation in between. Providing that information does not help you How to reset index after grouping and various operations is of interest. How to type in a command to find out its current dataframe? Regards. David On Friday, 13

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]], names=[u'StateFIPS', 0])Re

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]], names=[u'StateFIPS', 0])Regards. David On Friday, 13 M

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36,

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]], names=[u'StateFIPS

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
2, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]

Re: How to put back a number-based index

2016-05-14 Thread David Shi via Python-list
y? Some object types only get shown as an object.  Are there anything to be typed in Python, to reveal objects. Regards. David On Saturday, 14 May 2016, 4:30, Michael Selik wrote: What were you hoping to get from ``df[0]``?When you say it "yields nothing" do you mean it raise

Pandas GroupBy does not behave consistently

2016-05-15 Thread David Shi via Python-list
idea? Regards. David On Saturday, 14 May 2016, 17:00, Michael Selik wrote: This StackOverflow question was the first search result when I Googled for "Python why is there a little u"http://stackoverflow.com/questions/11279331/what-does-the-u-symbol-mean-in-front-of-string-val

RE: Wanted Python programmer to join team

2016-05-16 Thread Dan Strohl via Python-list
> My team is getting more projects that it can handle so we are looking for > Python programers to join. You will be given tasks to complete full or part of > the project. > > Skype: piefektas > > Contact me now with short description about yourself, your skills and > pro

Re: Summing/combining tuples

2016-05-18 Thread Larry Hudson via Python-list
mmation? Thanks Why two loops? Put both summations in a single loop. Then you're only scanning the alist once instead of twice. groups1 = defaultdict(int) groups2 = defaultdict(int) for nm, matches, words in alist: groups1[nm] += matches groups2[nm] += words -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Larry Hudson via Python-list
here is called "infinite recursion": displayInfo() calls displayInfo() which calls displayInfo() which calls displayInfo() which calls ... and so on forever. Another comment: Your getHigh() and getLow() functions are not necessary. Python already has max() and min() functions built

Re: Summing/combining tuples

2016-05-19 Thread Larry Hudson via Python-list
: tdic[dat[1]] = addtpl(tdic.get(dat[1], (0,0)), dat[2:]) return sorted([(str(n), tdic[n][0], tdic[n][1]) for n in tdic]) -=-Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

RE: reduction

2016-05-31 Thread Dan Strohl via Python-list
ch object itself. (good for more complex issues, but probably increases the size of each object) - create an index or caching structure of some sort as you find the objects, (good for saving computation time if the determination is "hard" and you hit the same ones again and again) - create a dictionary structure instead of a list. (good for fast lookups with known data) - using something like pandas or another data analysis library (SciPy, NumPy, iPython Notebook). (especially good if your data is more numbers based than you seem to be indicating) - writing the data to a database and using that for matching. (good If you have LOTS of data to compare). Some of these are probably overkill, some probably won't work at all for what you are trying to achieve. Dan -- https://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for GUI lib?

2016-06-07 Thread Roland Koebler via Python-list
Hi, the two "big" GUI toolkits on Linux are GTK+ and Qt. Both are free, have Python bindings and a graphical GUI designer, and both have ports for Windows and Mac OS X. Qt does have a better cross-platform- support and supports more platforms, but GTK+3 also works for Linux, Mac OS X a

Re: i'm a python newbie & wrote my first script, can someone critique it?

2016-06-10 Thread Larry Hudson via Python-list
On 06/10/2016 03:52 PM, mad scientist jr wrote: Is this group appropriate for that kind of thing? (If not sorry for posting this here.) So I wanted to start learning Python, and there is s much information online, which is a little overwhelming. I really learn best from doing, especially

Re: how to search item in list of list

2016-06-13 Thread Larry Hudson via Python-list
7;01': 1}, ['000', '0 01', '010', '011', '100', '101', '110', '111'], 'yz', 'start')], [(2, {'11': 1, '10': 0, '00': 1, '01': 1}, ['000', '001', '010', '011', '100', '101', '110', '1 11'], 'xz', 'start')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '01', ' 11', '11', '10', '11', '11', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00' : 0, '01': 1}, ['00', '01', '10', '11', '11', '11', '11', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '00', '10', '10', '10', '10', '11', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '00', '10', '11', '10', '10', '10', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '00', '10', '10', '10', '11', '10', '11'], 'xy', 'n ode')]] I (manually) reformatted your list and found you have a missing left square bracket in the middle. But the way your list is formatted here I really can't tell you where it is -- you'll have to reformat it and/or use an editor that highlights matching brackets to find it yourself. Most programming editors have that bracket matching capability. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread Ari Freund via Python-list
**RunShellCmd("ls .") # Here we don't care about order. -- https://mail.python.org/mailman/listinfo/python-list

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Larry Hudson via Python-list
Mint Linux (and I think Ubuntu is the same. I don't know about other distros.): From the menu, select Preferences->Keyboard->Layouts->Options->Position of Compose Key This opens a list of checkboxes with about a dozen choices -- select whatever you want (I use the Menu key). -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Larry Hudson via Python-list
in the design of Python... Wart?? I *strongly* disagree. I find it one of the strengths of Python, it enhances Python's expressiveness. Of course, everyone is entitled to their own opinion...and this is mine. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Pandas to CSV and .dbf

2016-06-23 Thread David Shi via Python-list
Has anyone tested on Pandas to CSV and .dbf lately? I am looking for proven, tested examples to output Panda Data Frame to CSV and dbf files. Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Which one is the best XML-parser?

2016-06-23 Thread David Shi via Python-list
Which one is the best XML-parser? Can any one tell me? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Which one is the best JSON parser?

2016-06-23 Thread David Shi via Python-list
Can any one tell me? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

How to reset IPython notebook file association

2016-06-25 Thread David Shi via Python-list
I use IPython Notebook to do Python programming. I used "Open with" and set it with Google Chrome.  Then, my IPython notebook does not load properly. How can I reset IPython notebook file association, so that I can use it again? Looking forward to hearing from you. Regards. David

JSON to Pandas data frame

2016-06-25 Thread David Shi via Python-list
How to convert a JSON object into a Pandas data frame? I know that for XML, there are XML parsers. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: named return values through dict initialization and unpacking

2016-06-26 Thread Ari Freund via Python-list
Thanks everybody. There seems to be a lot of resistance to dict unpacking, in addition to the problem with my proposed shorthand dict() initialization syntax pointed out by Steven D'Aprano, so I won't be pursuing this. -- https://mail.python.org/mailman/listinfo/python-list

Live installation of Pandas for Windows 64

2016-06-27 Thread David Shi via Python-list
Is there a live installation of Pandas for Windows 64? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Appending an asterisk to the end of each line

2016-07-05 Thread Larry Hudson via Python-list
's empty. Not your problem, but you can simplify your read/write loop to: for line in f_in: f_out.write(line[:-1] + ' *\n') The 'line[:-1]' expression gives you the line up to but not including the trailing newline. Alternately, use: f_out.write(line.rstrip() + ' *\n') -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

How asyncio works? and event loop vs exceptions

2016-07-22 Thread Marco S. via Python-list
non-blocking, but in this case exceptions can't be caught in a try statement. Is this correct? If so, asyncio programming style can't be a little divergent from what was the philosophy of Python until now? -- https://mail.python.org/mailman/listinfo/python-list

Re: Why not allow empty code blocks?

2016-07-24 Thread Marco Sulla via Python-list
I find the "pass" statement very clear and simple. There's more misleading problems in Python syntax, like this: someFunction( "param1" "param2" # comma missed, there will be only one parameter "param1param2" ) and this one too: class Parent(Bas

Re: How asyncio works? and event loop vs exceptions

2016-07-25 Thread Marco Sulla via Python-list
On 23 July 2016 at 16:06, Ian Kelly wrote: > On Fri, Jul 22, 2016 at 6:27 PM, Marco S. via Python-list > wrote: >> Furthermore I have a question about exceptions in asyncio. If I >> understand well how it works, tasks exceptions can be caught only if >> you wait for tas

Two constructive reviewers sought

2016-07-27 Thread David Shi via Python-list
To promote the use of Python and formalise Python approach, I decided to publish a paper. I used geodata as a showcase. Geodata lies in the heart of geographical information science.  The management and processing of such data is of great importance. I got an email from International Journal of

Python slang

2016-08-05 Thread Marco Sulla via Python-list
I have a simple curiosity: why Python has much keywords, and some builtin types and methods, that are different from the other languages? What is the rationale? I'm referring to: * `except` instead of `catch` * `raise` instead of `throw` * `self` instead of `this` (I know, it's not enf

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 00:31, Chris Angelico wrote: > On Sat, Aug 6, 2016 at 8:00 AM, Marco Sulla via Python-list > wrote: > This isn't slang; it's jargon Right. >> * `raise` instead of `throw` > > Quite a few other languages talk about raising exceptions rather th

Re: Python slang

2016-08-06 Thread Michael Selik via Python-list
On Sat, Aug 6, 2016, 10:10 AM Marco Sulla via Python-list < [email protected]> wrote: > On 6 August 2016 at 00:31, Chris Angelico wrote: > > On Sat, Aug 6, 2016 at 8:00 AM, Marco Sulla via Python-list > > wrote: > >> * `dict` instead of `map` > > >

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
On 6 August 2016 at 20:03, Michael Selik wrote: > On Sat, Aug 6, 2016, 10:10 AM Marco Sulla via Python-list > wrote: >> >> On 6 August 2016 at 00:31, Chris Angelico wrote: >> > "map" has many other meanings (most notably the action wherein you >

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
nguages. I think about the 80% of programmers knows at least one of that languages. It's more simple to learn a new language if it's similar to the others. >> I agree it's not hard to understand that `str` is the string type and >> `len()` is the function that gives you t

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
stead of `true`, `false` and `none` (they >> seems classes) > > You'd have to ask other languages why they use 'true', 'false' and 'none' > (they seem like ordinary variables). I think you find the reason. Not sure it was a good idea (also vim ha

Re: Python slang

2016-08-06 Thread Marco Sulla via Python-list
> ?column? > -- > NULL > (1 row) > > But SQL's NULL is a cross between C's NULL, IEEE's NaN, Cthulhu, and Emrakul. Yes, I was thinking manly to SQL. That furthermore is NOT a programming language. So I suppose I have also to ask why "None" instead of "Null" -- https://mail.python.org/mailman/listinfo/python-list

Network protocols, sans I/O,(Hopefully) the future of network protocols in Python

2016-08-08 Thread Mark Lawrence via Python-list
This may be of interest to some of you http://www.snarky.ca/network-protocols-sans-i-o -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Issue in parsing the strings in python code

2018-11-12 Thread Brian Oney via Python-list
t; > That looks conveniently aligned. Can't you just slice each line to get > the entries you are after? > I believe the idea is to allow the help seeker to piece the following puzzle together. $ nmcli -t NAME,SOMETHINGELSE c show >>> help(subprocess.Popen) >>>

Re: IDLE Default Working Directory

2018-11-12 Thread Brian Oney via Python-list
UserProfile%\Documents". > > I am not the OP and I’m on macOS — no shortcuts. How would one do the same > thing on other platforms? > Bev in TX > > > > Hello there, I am not an IDLE user. You may try a startup script from python, as per the following.

Re: IDLE Default Working Directory

2018-11-14 Thread Brian Oney via Python-list
on other platforms? > > > Bev in TX > > Hello there, > > I am not an IDLE user. You may try a startup script from python, as per the > > following. > > oney@oney:~$ cat pyhelp/change_to_current_dir.py #!/usr/bin/env python3 > > import osimport sys > > os

Re: All of a sudden code started throwing errors

2018-11-14 Thread Brian Oney via Python-list
On Wed, 2018-11-14 at 09:47 +0100, srinivasan wrote: > -68 >= -60 It's a problem with your test of wifi strength. Good job of making informative output and running tests! -- https://mail.python.org/mailman/listinfo/python-list

Re: how to match list members in py3.x

2018-11-25 Thread Brian Oney via Python-list
On Sun, 2018-11-25 at 07:43 -0800, Muhammad Rizwan wrote: > for each word in each line how can we check to see if a word is already > present in a list and if it is not how to append that word to a new list For your problem consider a set. https://en.wikipedia.org/wiki/Set_theory For the

Python2.7 unicode conundrum

2018-11-25 Thread Robert Latest via Python-list
Hi folks, what semmingly started out as a weird database character encoding mix-up could be boiled down to a few lines of pure Python. The source-code below is real utf8 (as evidenced by the UTF code point 'c3 a4' in the third line of the hexdump). When just printed, the string "

Re: Python2.7 unicode conundrum

2018-11-26 Thread Robert Latest via Python-list
Richard Damon wrote: > Why do you say it has been convert to 'Latin'. The string prints as > being Unicode. Internally Python doesn't store strings as UTF-8, but as > plain Unicode (UCS-2 or UCS-4 as needed), and code-point E4 is the > character you want. You'r

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Brian Oney via Python-list
xception HTW -- https://mail.python.org/mailman/listinfo/python-list

Re: What Python books to you recommend to beginners?

2018-11-28 Thread Brian Oney via Python-list
On Wed, 2018-11-28 at 08:44 -0600, Skip Montanaro wrote: > What do people recommend? The target is Python 3.6 and 3.7. The > audience at work is a mostly financial/statistical crowd, so exposure > to things like Pandas would be nice, though I'm sure there are > dedicated bo

Side by side comparison - CPython, nuitka, PyPy

2018-12-21 Thread Anthony Flury via Python-list
I thought I would look at a side by side comparison of CPython, nuitka and PyPy *The functionality under test** * I have a library (called primelib) which implements a Sieve of Erathoneses in pure Python - it was orginally written as part of my project Euler attempts Not only does it build

Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-27 Thread Daniel Ojalvo via Python-list
dbox# ls -l this_is_a_pipe prw-r--r-- 1 root root 0 Dec 27 14:28 this_is_a_pipe root@beefy:~/sandbox# python3 --version Python 3.6.7 root@beefy:~/sandbox# python3 Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or

RE: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-28 Thread Daniel Ojalvo via Python-list
diagnose. That all being said, I think I would like to put in a feature request for a non-blocking option. How should I go about doing so? Thanks again, Dan -Original Message- From: Chris Angelico Sent: Thursday, December 27, 2018 7:10 PM To: [email protected] Subject: Re: Undocume

Re: mouse click automation

2019-01-01 Thread Brian Oney via Python-list
I am unfamiliar with pynput. I have had good experience with pyautogui. As your script isn't yet advanced, you may consider it. https://pyautogui.readthedocs.io/en/latest/introduction.html -- https://mail.python.org/mailman/listinfo/python-list

<    38   39   40   41   42   43   44   45   46   47   >