Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread a a
ular network to work and be operational in remote, mountain regions of Turkey after the strong 7,8 earthquake, so SDR should work as backup for cellular 3G/LTE network in the region. In case of Android smartphones I need to switch to Python for Android to get flexibility offered by scripting to su

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread a a
On Monday, 13 March 2023 at 16:16:28 UTC+1, Thomas Passin wrote: > On 3/13/2023 12:39 AM, a a wrote: > > But what I need is analysis of seismograms from 4,000 seismographs world > > wide to detect P-wave energy distribution underground around the earthquake > > to verify EQ Domino Effect > In tha

RE: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread avi.e.gross
13, 2023 2:10 PM To: python-list@python.org Subject: Re: Can you process seismographic signals in Python or should I switch to Matlab ? On 3/13/2023 11:54 AM, Rich Shepard wrote:> On Mon, 13 Mar 2023, Thomas Passin wrote: > >> No doubt, depending on the data formats used. But it&#

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:54 AM, Rich Shepard wrote:> On Mon, 13 Mar 2023, Thomas Passin wrote: > >> No doubt, depending on the data formats used. But it's still going >> to be a big task. > > Thomas, > > True, but once you have a dataframe with all the information about > all the earthquakes you can extra

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Rich Shepard
On Mon, 13 Mar 2023, Thomas Passin wrote: No doubt, depending on the data formats used. But it's still going to be a big task. Thomas, True, but once you have a dataframe with all the information about all the earthquakes you can extract data for every analysis you want to do. If you've not

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:23 AM, Rich Shepard wrote: On Mon, 13 Mar 2023, Thomas Passin wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Rich Shepard
On Mon, 13 Mar 2023, Thomas Passin wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to do a great deal of work to get all that dat

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 12:39 AM, a a wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to do a great deal of work to get all that data into a

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 12:39 AM, a a wrote: But some unknown reasons Matplotlib and numpy crash my Python 3.8 for Windows , 32-bit and no support is offered It is possible, using pip, to downgrade versions (e.g., of Matplotlob and numpy) to see if you can find versions that work. Of course moving to

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread a a
s seismographic signals in Python or should I > switch to Matlab ? > On 3/11/2023 6:54 PM, a a wrote: > > My project > > > https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake.htm > l > > If your goal is to step through this Matlab example, t

RE: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread avi.e.gross
, ... -Original Message- From: Python-list On Behalf Of Thomas Passin Sent: Sunday, March 12, 2023 12:02 AM To: python-list@python.org Subject: Re: Can you process seismographic signals in Python or should I switch to Matlab ? On 3/11/2023 6:54 PM, a a wrote: > My project >

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread Thomas Passin
On 3/11/2023 6:54 PM, a a wrote: My project https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake.html If your goal is to step through this Matlab example, then clearly you should use Matlab. If you do not have access to Matlab or cannot afford it, then you would have to us

RE: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread avi.e.gross
Original Message- From: Python-list On Behalf Of a a Sent: Saturday, March 11, 2023 6:54 PM To: python-list@python.org Subject: Can you process seismographic signals in Python or should I switch to Matlab ? My project https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake

Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread a a
My project https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake.html -- https://mail.python.org/mailman/listinfo/python-list

Re: argparse presence of switch

2021-01-12 Thread Greg Ewing
On 13/01/21 7:13 am, Chris Angelico wrote: This is what different actions are for. I'd probably use action="store_true" here; that should mean that args.register will be set to True if "-r" was passed, or False if it wasn't. Yes, otherwise it expects another argument following -r containing a

Re: argparse presence of switch

2021-01-12 Thread David Lowry-Duda
> I want to have an argument's presence only - value is not required. > For example, my program main.py needs to know if "-r" is present when program > is invoked. > So the value command line would be: > (1) python3 main.py -r > or... > (1) python3 main.py > > I tried following: > parser.add_ar

Re: argparse presence of switch

2021-01-12 Thread Chris Angelico
On Wed, Jan 13, 2021 at 5:01 AM Dhimant Patel wrote: > > Its what I searched for on this group. > > I want to have an argument's presence only - value is not required. > For example, my program main.py needs to know if "-r" is present when program > is invoked. > So the value command line would b

argparse presence of switch

2021-01-12 Thread Dhimant Patel
Its what I searched for on this group. I want to have an argument's presence only - value is not required. For example, my program main.py needs to know if "-r" is present when program is invoked. So the value command line would be: (1) python3 main.py -r or... (1) python3 main.py I tried foll

Re: Implement C's Switch in Python 3

2019-03-15 Thread jfong
Sayth Renshaw at 2019/2/3 UTC+8 AM9:52:50 wrote: > Or perhaps use a 3rd party library like > https://github.com/mikeckennedy/python-switch Thank you for this link. It's a good general implementation. --Jach -- https://mail.python.org/mailman/listinfo/python-list

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-07 Thread Christian Gollwitzer
Am 05.02.19 um 02:20 schrieb DL Neil: So, even with the French making their dates into sentences, not a single one uses ordinals! - did the computer people in all these languages/cultures decide that the more numeric approach was better/easier/... (ie simpler/less-complex) :) For the two lan

Re: Implement C's Switch in Python 3

2019-02-05 Thread MRAB
On 2019-02-06 00:25, John Sanders wrote: On Saturday, February 2, 2019 at 6:47:49 PM UTC-6, Sayth Renshaw wrote: Hi I am trying to convert a switch statement from C into Python. (why? practising). This is the C code. printf("Dated this %d", day); switch (day) { case 1: cas

Re: Implement C's Switch in Python 3

2019-02-05 Thread John Sanders
On Saturday, February 2, 2019 at 6:47:49 PM UTC-6, Sayth Renshaw wrote: > Hi > > I am trying to convert a switch statement from C into Python. (why? > practising). > > This is the C code. > > printf("Dated this %d", day); > switch (day) { > case 1

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread DL Neil
On 4/02/19 9:25 PM, Christian Gollwitzer wrote: Am 04.02.19 um 09:18 schrieb Christian Gollwitzer: I think English is quite "unique" with writing out the ending of the ordinals attached to arabic numerals. Of course, there is a Wikipedia page about it: https://en.wikipedia.org/wiki/Ord

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread Christian Gollwitzer
Am 04.02.19 um 09:18 schrieb Christian Gollwitzer: I think English is quite "unique" with writing out the ending of the ordinals attached to arabic numerals. Of course, there is a Wikipedia page about it: https://en.wikipedia.org/wiki/Ordinal_indicator So I was wrong and the abbrevi

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread Christian Gollwitzer
Am 04.02.19 um 04:11 schrieb DL Neil: > On 4/02/19 10:00 AM, Christian Gollwitzer wrote: Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third, ..

Re: Switch function

2019-02-03 Thread Dan Sommers
27;A' then > A maps to 0 and B maps to 1 and ... Z maps to 26. So, you could make > a list of 26 functions (some may be absent) and your entire switch > statement looks like: > >funcs=[zeroeth,first,other,...,last] # list of function handles >var=input("Ent

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
Christian, On 4/02/19 10:00 AM, Christian Gollwitzer wrote: Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third, ... language! Only for some

RE: Switch function

2019-02-03 Thread Avi Gross
Dan, I agree and have felt no need to do a method like this. Most of the time a switch is easy to avoid or even forget that it exists. I rarely needed to use these years ago when they were available in C and C++ , JAVA, JavaScript, PERL or R or under other *names* but similar functionality

Re: Switch function

2019-02-03 Thread Dan Sommers
On 2/3/19 5:40 PM, Avi Gross wrote: Bottom line, does anyone bother using anything like this? It is actually a bunch of hidden IF statements matched in order but may meet many needs. I sure don't. In the rare case that I might use a switch statement in another language, I just use a s

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 10:53 AM Avi Gross wrote: > It is very bad form to have ambiguous compressed formats. Even if you include > a slash or minus sign or period or the delimiter of your choice, I sometimes > see this: > > 01/02/2020 > > And I wonder if it is meant to be January 2nd or February

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 11:08 AM Chris Angelico wrote: > If you need to attach some *other* time zone (which should be rare - > ONLY do this if you absolutely cannot translate to UTC) BTW, there are some legit reasons for keeping something in a different timezone. If you're representing an instant

RE: Implement C's Switch in Python 3

2019-02-03 Thread Avi Gross
Comment at end: -Original Message- From: Python-list On Behalf Of Bob van der Poel Sent: Sunday, February 3, 2019 4:01 PM To: DL Neil Cc: Python Subject: Re: Implement C's Switch in Python 3 I'm surprised that no one has yet addressed the year 1 problem. Hopefully w

Switch function

2019-02-03 Thread Avi Gross
Message asking about a fairly simple way to implement a switch in python as per the ongoing discussion. I wrote a function that might emulate a fairly simple general use of switch. A function would take N+2 arguments of the form: 1: something to switch based on 2,3: something to match to

Re: Implement C's Switch in Python 3

2019-02-03 Thread Bob van der Poel
On Sun, Feb 3, 2019 at 2:15 PM Chris Angelico wrote: > On Mon, Feb 4, 2019 at 8:02 AM Bob van der Poel wrote: > > > > I'm surprised that no one has yet addressed the year 1 problem. > Hopefully we're doing numeric, not alpha sorts on the stuff before the 1st > '-'. And, the compact versions

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 8:02 AM Bob van der Poel wrote: > > I'm surprised that no one has yet addressed the year 1 problem. Hopefully > we're doing numeric, not alpha sorts on the stuff before the 1st '-'. And, > the compact versions will really screw up :). > Compact versions? You mean non-

Re: Implement C's Switch in Python 3

2019-02-03 Thread Christian Gollwitzer
Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third, ... language! Only for some languages. In other languages there can be, for example, case

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 7:35 AM DL Neil wrote: > > On 3/02/19 10:16 PM, Chris Angelico wrote: > >> There's normal and there's normal - like it's tomato or tomato? > > I dunno. I'm the kind of normal that likes tomatoes (not to be > > confused with tomatoes). Does that help? > > If you like tomatoes

Re: Implement C's Switch in Python 3

2019-02-03 Thread Bob van der Poel
On Sun, Feb 3, 2019 at 1:35 PM DL Neil wrote: > On 3/02/19 10:16 PM, Chris Angelico wrote: > > On Sun, Feb 3, 2019 at 8:09 PM DL Neil > wrote: > >> On 3/02/19 9:45 PM, Chris Angelico wrote: > >>> Which is why I always write dates in sorted format, usually eschewing > >>> delimiters: > >>> //CJA

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
On 3/02/19 10:16 PM, Chris Angelico wrote: On Sun, Feb 3, 2019 at 8:09 PM DL Neil wrote: On 3/02/19 9:45 PM, Chris Angelico wrote: Which is why I always write dates in sorted format, usually eschewing delimiters: //CJA 20160511: Is this still happening? I don't remember seeing it in three part

RE: Implement C's Switch in Python 3

2019-02-03 Thread Avi Gross
The discussion strictly sets a limit of 31 for the largest number of days in a month and asks for suffixes used to make ordinal numbers like 31st. But in reality, you can go to 99th and beyond for other purposes albeit the pattern for making 101 and on seems to repeat. The last algorithm I wrote

Re: Implement C's Switch in Python 3

2019-02-03 Thread Frank Millman
th', 21: '21st', 22: '22nd', 23: '23rd', 24: '24th', 25: '25th', 26: '26th', 27: '27th', 28: '28th', 29: '29th', 30: '30th', 31: '31st'} chooseFrom[1] '1st' chooseFrom[11]

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Sun, Feb 3, 2019 at 8:09 PM DL Neil wrote: > > On 3/02/19 9:45 PM, Chris Angelico wrote: > > Which is why I always write dates in sorted format, usually eschewing > > delimiters: > > > > //CJA 20160511: Is this still happening? I don't remember seeing it in > > three parts of forever. > > Sure

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
Chris, On 3/02/19 9:45 PM, Chris Angelico wrote: On Sun, Feb 3, 2019 at 7:40 PM DL Neil wrote: This would normally see us coding "2019-02-03". The arrangement of larger to ever more precise time-units is very useful in databases and applications such as file-names, because it sequences logical

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Sun, Feb 3, 2019 at 7:40 PM DL Neil wrote: > This would normally see us coding "2019-02-03". The arrangement of > larger to ever more precise time-units is very useful in databases and > applications such as file-names, because it sequences logically. > > However, that is not the way 'normal pe

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
#x27;23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st'] I'm not sure if employing a dict with hashed retrieval would be any more efficient than indexing into a list. Not having a defa

Re: Implement C's Switch in Python 3

2019-02-03 Thread Stefan Behnel
Chris Angelico schrieb am 03.02.19 um 02:23: > Of course, you can also precompute this: > > day_ordinal = mapper( > [1, 21, 31], "st", > [2, 22], "nd", > [3, 23], "rd", > ) > def f(x): return day_ordinal.get(x, "th") … in which case I would also 'precompute' the ".get" and

Re: Implement C's Switch in Python 3

2019-02-02 Thread Sayth Renshaw
fix(day) for day in range(1,32)} > >>> chooseFrom > {1: '1st', 2: '2nd', 3: '3rd', 4: '4th', 5: '5th', 6: '6th', 7: '7th', 8: > '8th', 9: '9th', 10: '10th', 11: '11th', 12:

RE: Implement C's Switch in Python 3

2019-02-02 Thread Avi Gross
7;, 8: '8th', 9: '9th', 10: '10th', 11: '11th', 12: '12th', 13: '13th', 14: '14th', 15: '15th', 16: '16th', 17: '17th', 18: '18th', 19: '19th', 20: '20th', 21: '21st

Re: Implement C's Switch in Python 3

2019-02-02 Thread Igor Korot
t; 13rd > 14th > 15th > 16th > 17th > 18th > 19th > 20th > 21st > 22nd > 23rd > 24th > 25th > 26th > 27th > 28th > 29th > 30th > 31st > > -Original Message- > From: Python-list On > Behalf Of Sayth Renshaw > Sent: Saturday

Re: Implement C's Switch in Python 3

2019-02-02 Thread MRAB
On 2019-02-03 02:51, Avi Gross wrote: I may be missing something, but the focus seems to be only on the rightmost digit. You can get that with I had the same thought, but came across a problem. "11st", "12nd", "13rd"? [snip] Output: for day in range(1, 32): print( nthSuffix(day))

RE: Implement C's Switch in Python 3

2019-02-02 Thread Avi Gross
7th 18th 19th 20th 21st 22nd 23rd 24th 25th 26th 27th 28th 29th 30th 31st -Original Message- From: Python-list On Behalf Of Sayth Renshaw Sent: Saturday, February 2, 2019 8:53 PM To: python-list@python.org Subject: Re: Implement C's Switch in Python 3 > >I am trying to conver

Re: Implement C's Switch in Python 3

2019-02-02 Thread Skip Montanaro
kill your attention span. I had to get back to the cat videos. :-) Sayth wrote: > It seems odd with C having switch that its cleaner and more efficient than > python where we are having to implement our own functions to recreate switch > everytime. Python's development team has co

Re: Implement C's Switch in Python 3

2019-02-02 Thread Sayth Renshaw
> >I am trying to convert a switch statement from C into Python. (why? > >practising). > > > >This is the C code. > > > >printf("Dated this %d", day); > > switch (day) { > >case 1: case 21: case 31: > >printf(&quo

Re: Implement C's Switch in Python 3

2019-02-02 Thread Cameron Simpson
On 02Feb2019 16:47, Sayth Renshaw wrote: I am trying to convert a switch statement from C into Python. (why? practising). This is the C code. printf("Dated this %d", day); switch (day) { case 1: case 21: case 31: printf("st"); break; case 2: case 22:

Re: Implement C's Switch in Python 3

2019-02-02 Thread Chris Angelico
On Sun, Feb 3, 2019 at 11:51 AM Sayth Renshaw wrote: > > Hi > > I am trying to convert a switch statement from C into Python. (why? > practising). > > This is the C code. > > printf("Dated this %d", day); > switch (day) { > case 1: case

Re: Implement C's Switch in Python 3

2019-02-02 Thread Skip Montanaro
> > I have an unhashable type list. > Try replacing the list with a tuple. Also, read up on immutable v mutable types and dictionary keys for a bit of background on why a list won't work. Skip > -- https://mail.python.org/mailman/listinfo/python-list

Implement C's Switch in Python 3

2019-02-02 Thread Sayth Renshaw
Hi I am trying to convert a switch statement from C into Python. (why? practising). This is the C code. printf("Dated this %d", day); switch (day) { case 1: case 21: case 31: printf("st"); break; case 2: case 22: printf("nd"

EuroPython 2018: Delaying switch to Late Bird Tickets by one day - please use your coupons today !

2018-07-15 Thread M.-A. Lemburg
Since we still have quite a few people with discount coupons who haven’t bought their tickets yet, we are extending the regular ticket sales by one day. * EuroPython 2018 Tickets * https://ep2018.europython.eu/en/registration/buy-tickets/ Switch to Late Bird Tickets

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Mark via Python-list
On Friday, July 6, 2018 at 1:22:46 PM UTC+1, Bev in TX wrote: > > On Jul 6, 2018, at 3:14 AM, Mark via Python-list > > wrote: > > > > In the end I changed to a completely different approach. > > > > I now have two parallel directories, one with PySide-based code and the > > other with auto-gen

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Bev in TX
> On Jul 6, 2018, at 3:14 AM, Mark via Python-list > wrote: > > In the end I changed to a completely different approach. > > I now have two parallel directories, one with PySide-based code and the other > with auto-generated PyQt-based code. And I created a tiny script to copy the > PySide

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Mark via Python-list
In the end I changed to a completely different approach. I now have two parallel directories, one with PySide-based code and the other with auto-generated PyQt-based code. And I created a tiny script to copy the PySide code to the PyQt directory & do the necessary changes. (I can post the scrip

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Antoon Pardon
On 05-07-18 14:57, Mark Summerfield via Python-list wrote: > For GUI programming I often use Python bindings for Qt. > > There are two competing bindings, PySide and PyQt. > > Ideally I like to have applications that can use either. This way, if I get a > problem I can try with the other bindings:

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-05 Thread Mark via Python-list
> > run an entire application with PySide2 or with PyQt5. > > > > But I'd really rather just have one lot of imports per file. > > > > One obvious solution is to create a 'Qt.py' module that imports everything > > depending on the PYSIDE switch and t

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-05 Thread Cameron Simpson
ile. One obvious solution is to create a 'Qt.py' module that imports everything depending on the PYSIDE switch and that I then use in all the other .py files, something like this: from Qt.QtCore import Qt from Qt.QtGui import QIcon ... etc. But I'm just wondering if there's

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-05 Thread Tim Williams
files in a given project so that just by changing PYSIDE's value I can > run an entire application with PySide2 or with PyQt5. > > But I'd really rather just have one lot of imports per file. > > One obvious solution is to create a 'Qt.py' module that imports every

Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-05 Thread Mark Summerfield via Python-list
eate a 'Qt.py' module that imports everything depending on the PYSIDE switch and that I then use in all the other .py files, something like this: from Qt.QtCore import Qt from Qt.QtGui import QIcon ... etc. But I'm just wondering if there's a nicer way to do all this? -- h

Re: Windows switch between python 2 and 3

2016-10-27 Thread eryk sun
n set in environment variable Path. >> >> When I type python in cmd, it only gives me python 2.7, I am wondering how >> to switch between 2 and 3 in command prompt. > > I don't use Windows, so I am guessing, but you could try: > > python2 > python27 > > p

Re: Windows switch between python 2 and 3

2016-10-27 Thread Daiyue Weng
ython35 > > > > C:\Python27 > > > > Both have been set in environment variable Path. > > > > When I type python in cmd, it only gives me python 2.7, I am wondering > how > > to switch between 2 and 3 in command prompt. > > Along with Python 3.5, the

Re: Windows switch between python 2 and 3

2016-10-27 Thread Zachary Ware
hon 2.7, I am wondering how > to switch between 2 and 3 in command prompt. Along with Python 3.5, the Python Launcher for Windows (py.exe) was installed in C:\Windows, unless you unchecked it. You can choose which interpreter you want to run by an argument to py.exe; for Python 2.7, use `py -2.7`

Re: Windows switch between python 2 and 3

2016-10-27 Thread Steve D'Aprano
hon 2.7, I am wondering how > to switch between 2 and 3 in command prompt. I don't use Windows, so I am guessing, but you could try: python2 python27 python3 python35 -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https

Re: Windows switch between python 2 and 3

2016-10-27 Thread Veek M
Daiyue Weng wrote: > Hi, I installed Python 2.7 and Python 3.5 64 bit versions on Win 10. > Under > > C:\Python35 > > C:\Python27 > > Both have been set in environment variable Path. > > When I type python in cmd, it only gives me python 2.7, I am wondering >

Re: Windows switch between python 2 and 3

2016-10-27 Thread Peter Otten
Daiyue Weng wrote: > Hi, I installed Python 2.7 and Python 3.5 64 bit versions on Win 10. Under > > C:\Python35 > > C:\Python27 > > Both have been set in environment variable Path. > > When I type python in cmd, it only gives me python 2.7, I am wondering how >

Windows switch between python 2 and 3

2016-10-27 Thread Daiyue Weng
Hi, I installed Python 2.7 and Python 3.5 64 bit versions on Win 10. Under C:\Python35 C:\Python27 Both have been set in environment variable Path. When I type python in cmd, it only gives me python 2.7, I am wondering how to switch between 2 and 3 in command prompt. cheers -- https

Re: tkinter: Switch between two grids

2015-12-12 Thread Terry Reedy
On 12/12/2015 1:24 PM, sms wrote: What I need: 1. Fullscreen application Not directly relevant to the below. 2. On the home screen: Three row 3. When I click on the main screen, it switches to one row only. Create homescreen Frame(master=root) or subclasses thereof. Pack the homescreen.

tkinter: Switch between two grids

2015-12-12 Thread sms
Hello all, I'm sorry to ask this question, but I am a very beginer. What I need: 1. Fullscreen application 2. On the home screen: Three row 3. When I click on the main screen, it switches to one row only. Actually, I am not able to switch from Window1 to Window2, Window2 comes under Wi

Re: [argparse] optional parameter without --switch

2015-11-24 Thread Peter Otten
ptional paramters > when they have a switch (like `--name`). $ cat tmp.py #!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser() parser.add_argument("name", nargs="?") print("name =", parser.parse_args().name) $ ./tmp.py name = None $ .

[argparse] optional parameter without --switch

2015-11-23 Thread c.buhtz
I want to call (on bash) a Python script in this two ways without any error. ./arg.py ./arg.py TEST It means that the parameter (here with the value `TEST`) should be optional. With argparse I only know a way to create optional paramters when they have a switch (like `--name`). Is there

Re: Yet Another Switch-Case Syntax Proposal

2014-04-10 Thread Lucas Malor
one iterable), case suite is executed if the switched expression is an element of the tuple. If you want to match exactly a tuple, you have simply to put it into another tuple of length 1. Tricky but too much rare to care about. To recap: switch_stmt ::= "switch" expression "case"

Re: Yet Another Switch-Case Syntax Proposal

2014-04-06 Thread Chris Angelico
On Mon, Apr 7, 2014 at 6:13 AM, Michael Torrie wrote: > On 04/06/2014 12:07 PM, Chris Angelico wrote: >> This has a slight oddity of parsing (in that an expression can >> normally have a comparison in it); if you really want to use the >> result of a comparison inside a case block, you'd have to p

Re: Yet Another Switch-Case Syntax Proposal

2014-04-06 Thread Ian Kelly
On Sun, Apr 6, 2014 at 11:49 AM, Lucas Malor <3kywjyd...@snkmail.com> wrote: > On 3 April 2014 20:12, Ian Kelly ian.g.kelly-at-gmail.com > |python-list@python.org| wrote: >> Use this instead [of continue]: > >> >> switch day case in ("Mon", "Tue&

Re: Yet Another Switch-Case Syntax Proposal

2014-04-06 Thread Michael Torrie
the value > from the previous case (without re-evaluating it); a case statement > that lacks a comparison altogether assumes == and does the above. In > either case (pardon the pun), the check will be done only if the > preceding case was false. An 'else' clause is effectiv

Re: Yet Another Switch-Case Syntax Proposal

2014-04-06 Thread Chris Angelico
On Mon, Apr 7, 2014 at 3:49 AM, Marco S. wrote: > switch day case in briefing_days: > > lunch_time = datetime.time(11, 30) > meeting_time = datetime.time(12, 30) > case not in briefing_days + festive_days: > > lunch_time = datetime.time(12) > meeting

Re: Yet Another Switch-Case Syntax Proposal

2014-04-06 Thread Marco S.
On 3 April 2014 20:12, Ian Kelly ian.g.kelly-at-gmail.com | python-list@python.org| wrote: > Use this instead [of continue]: > > switch day case in ("Mon", "Tue", "Wed", "Thu", "Fri"): > go_to_work = True > day_typ

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 10:44 AM, Marko Rauhamaa wrote: > Consider: > > switch local_sabbath():# bad > case (1, 2, 3) as sabbath: > ... I'm not overly fond of that either. That's why I liked the OP's choice to put the first case in the s

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Marko Rauhamaa
Ian Kelly : > On Apr 4, 2014 3:51 AM, "Marko Rauhamaa" wrote: >>switch: local_sabbath() >>case (1, 2, 3) as sabbath: >>... >>case 6: >>... >>else: >>... > [...] > > What's wrong with th

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Devin Jeanpierre
If one were to add switch into Python, wouldn't it be desirable to make a pattern matching switch (think the "match" or "case" construct from Haskell or ML)? Python currently has poor support for union/sum types in general, not just enumerations. It feels weird

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Ian Kelly
On Apr 4, 2014 3:51 AM, "Marko Rauhamaa" wrote: > > >>> switch day casein ("Monday", "Thursday", "Wednesday", "Tuesday", > >>> "Friday"): > >>> gotowork = True > >>>

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Marko Rauhamaa
>>>> Instead of disabling fallthrough by default, why not disable it all >>>> together? >>> >>> I was tempted but there are cases in which it's useful. An example No, it is never useful, it never was. It came into being by accident, a design bug tur

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Steven D'Aprano
d but there are cases in which it's useful. An example >> >> switch day casein ("Monday", "Thursday", "Wednesday", "Tuesday", >> "Friday"): >> gotowork = True >> continue >> casein ("Monday", &q

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Steven D'Aprano
On Thu, 03 Apr 2014 15:11:38 -0400, Terry Reedy wrote: > On 4/3/2014 12:02 PM, Lucas Malor wrote: > >>> A more suitable place to propose this would be the python-ideas >>> mailing list. >> >> You're right. I posted here because this list was linked by PEP 1. But >> now that I read more there's al

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 2:13 PM, Ethan Furman wrote: > On 04/03/2014 08:09 PM, Chris Angelico wrote: >> >> On Fri, Apr 4, 2014 at 1:04 PM, MRAB wrote: >>> >>> I thought [continue] went to the end of the loop, but because it's a >>> loop, it >>> just wraps around back to the top... >> >> >> It goes

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Ethan Furman
On 04/03/2014 08:09 PM, Chris Angelico wrote: On Fri, Apr 4, 2014 at 1:04 PM, MRAB wrote: I thought [continue] went to the end of the loop, but because it's a loop, it just wraps around back to the top... It goes to the bottom of the loop, and then the loop condition may or may not send it to

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 1:04 PM, MRAB wrote: > I thought [continue] went to the end of the loop, but because it's a loop, it > just wraps around back to the top... It goes to the bottom of the loop, and then the loop condition may or may not send it to the top of the loop. ChrisA -- https://mail

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Ethan Furman
ample switch day casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"): gotowork = True continue casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"): daytype = &qu

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread MRAB
On 2014-04-03 19:23, Ethan Furman wrote: On 04/03/2014 09:02 AM, Lucas Malor wrote: In reply to Ian Kelly: Instead of disabling fallthrough by default, why not disable it all together? I was tempted but there are cases in which it's useful. An example switch day casein (&q

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 10:03 AM, Mark Lawrence wrote: > Please don't take this personally, but there's more chance of me being the > first ever World President than of anybody getting a switch/case statement > past the BDFL. The language in PEP 3103 (written by Guido) doesn&#

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Mark Lawrence
On 02/04/2014 15:53, Lucas Malor wrote: Hi all. I would proposeto you all a switch-case syntax for Python. I already read PEP 3103 and I'm not completely satisfied by any of the proposed solutions. This is my proposal: switch_stmt ::= "switch" identifier "case"

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 5:12 AM, Ian Kelly wrote: > Use this instead: > > switch day case in ("Mon", "Tue", "Wed", "Thu", "Fri"): > go_to_work = True > day_type = "ferial" > if day in ("Tue", "

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Terry Reedy
On 4/3/2014 12:02 PM, Lucas Malor wrote: A more suitable place to propose this would be the python-ideas mailing list. You're right. I posted here because this list was linked by PEP 1. But now that I read more there's also python-ideas listed. Let me know if I have to continue there instead

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Ethan Furman
On 04/03/2014 09:02 AM, Lucas Malor wrote: In reply to Ian Kelly: Instead of disabling fallthrough by default, why not disable it all together? I was tempted but there are cases in which it's useful. An example switch day casein ("Monday", "Thursday", "

  1   2   3   4   >