Posts: 3,458
Threads: 101
Joined: Sep 2016
Apr-29-2017, 01:42 PM
(This post was last modified: Apr-29-2017, 01:42 PM by nilamo.)
(Apr-29-2017, 11:14 AM)RandoomDude Wrote: You know what,i am quiting python.on windows python uses the batch script to open an application.
Python doesn't use batch scripts, it uses python.
Quote:I am moving on to vb.net.v
VB.net is fine for learning how to program. Once you use it for a little bit, hopefully you'll see how awful it is.
Posts: 566
Threads: 10
Joined: Apr 2017
(Apr-29-2017, 01:42 PM)nilamo Wrote: (Apr-29-2017, 11:14 AM)RandoomDude Wrote: You know what,i am quiting python.on windows python uses the batch script to open an application. Python doesn't use batch scripts, it uses python. I think the guy confuses shell-level script with scripting language ( which is sort of unfortunate name)
Test everything in a Python shell (iPython, Azure Notebook, etc.) - Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.
Posts: 12,032
Threads: 486
Joined: Sep 2016
But is is a script, what else are you going to call it?
Posts: 566
Threads: 10
Joined: Apr 2017
(Apr-29-2017, 04:29 PM)Larz60+ Wrote: But is is a script, what else are you going to call it? Interpreted language sounds like a better name. One of the best helpers on Linux shell programming I've seen states
Quote:A shell script is a quick-and-dirty method of prototyping a complex application. Getting even a limited subset of the functionality to work in a script is often a useful first stage in project development. In this way, the structure of the application can be tested and tinkered with, and the major pitfalls found before proceeding to the final coding in C, C++, Java, Perl, or Python.
Several years ago someone asked my help to port a small script from bash to Python. They guy was amazed by the performance improvement - Python program execution was 20 times faster
Test everything in a Python shell (iPython, Azure Notebook, etc.) - Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.
Posts: 5,151
Threads: 396
Joined: Sep 2016
(Apr-29-2017, 11:14 AM)RandoomDude Wrote: I am moving on to vb.net
Recommended Tutorials:
Posts: 27
Threads: 6
Joined: Apr 2017
Apr-30-2017, 09:02 AM
(This post was last modified: Apr-30-2017, 10:42 AM by metulburr.)
(Apr-29-2017, 04:26 PM)volcano63 Wrote: (Apr-29-2017, 01:42 PM)nilamo Wrote: (Apr-29-2017, 11:14 AM)RandoomDude Wrote: You know what,i am quiting python.on windows python uses the batch script to open an application. Python doesn't use batch scripts, it uses python. I think the guy confuses shell-level script with scripting language ( which is sort of unfortunate name) Doesnt python uses "cmd.start x.exe" to run programs on windows?
Posts: 687
Threads: 37
Joined: Sep 2016
(Apr-30-2017, 09:02 AM)RandoomDude Wrote: Doesnt python uses "cmd.start x.exe" to run programs on windows?
Not mandatorily. AFAIK(*) you can run python program that don't show a command prompt window when they run by using pythonw instead of python and setting up the proper shortcut.
(*) Linux user, where this problem doesn't exist, since executables have no "windows mode" flag.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Posts: 687
Threads: 37
Joined: Sep 2016
(Apr-29-2017, 04:39 PM)volcano63 Wrote: (Apr-29-2017, 04:29 PM)Larz60+ Wrote: But is is a script, what else are you going to call it? Interpreted language sounds like a better name. One of the best helpers on Linux shell programming I've seen states
Quote:A shell script is a quick-and-dirty method of prototyping a complex application. Getting even a limited subset of the functionality to work in a script is often a useful first stage in project development. In this way, the structure of the application can be tested and tinkered with, and the major pitfalls found before proceeding to the final coding in C, C++, Java, Perl, or Python.
Several years ago someone asked my help to port a small script from bash to Python. They guy was amazed by the performance improvement - Python program execution was 20 times faster
Depends a lot on the script. A true script does little by itself, it mostly calls existing utilities which have been usually written by people who know their stuff and will be much faster than equivalent Python code.
IMHO the quote above is wrong, you don't rewrite the code later, if I have a script working using rsync, I'm not going to reinvent that wheel, achieving sufficient trust in the new code would require years of testing.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Posts: 3
Threads: 1
Joined: May 2017
(Apr-27-2017, 03:14 PM)volcano63 Wrote: (Apr-27-2017, 03:11 PM)micseydel Wrote: When I originally wrote Scala, I did not really use FP. I wouldn't count that against it at all. (I like Scala, though I still write Python by default.) Actually, FP is the fun part - at least in the learning process. Java components suck 
You know, Java now has FP and most languages now support FP in some form or other.
If done right, FP can be more natural, compact and less bug-prone to modifications than the imperative style.
Posts: 566
Threads: 10
Joined: Apr 2017
May-02-2017, 11:40 AM
(This post was last modified: May-02-2017, 11:40 AM by volcano63.)
(Apr-30-2017, 10:29 AM)Ofnuts Wrote: Depends a lot on the script. A true script does little by itself, it mostly calls existing utilities which have been usually written by people who know their stuff and will be much faster than equivalent Python code.
While e.g., grep on itself will most probably be much faster than equivalent implemented in Python, each of those utilities must be loaded into memory, in many cases - more than one - when you pipe output of one into another. Multiple pipe buffer management is - intuitively - resource-consuming too.
And - speaking of memory - python 2.7.6 interpreter "weighed" just 20K, echo of Ubuntu - ab. 4 years ago, not sure about version - 50K.
Nevertheless, my evaluation is that the worst performance-affecting perp was output redirection. Appending to output file on each step meant re-opening and seeking its end on every loop iteration - in Python implementation, the output file was opened once.
(May-02-2017, 11:05 AM)caxis Wrote: You know, Java now has FP and most languages now support FP in some form or other.
If done right, FP can be more natural, compact and less bug-prone to modifications than the imperative style.
- Who wants to learn Java
(just kidding, but seriously - I don't)
- Python supports quite a few FP element constructs - like
map , filter , lambda , comprehensions , generators , reduce
- Pure FP is not always the best tool for the task - and the creator of Scala, Martin Odersky,
also the author of this excellent course, is smart and humble enough to state just that
Actually, previous knowledge of Python helped me in the mentioned-above Scala course...
Test everything in a Python shell (iPython, Azure Notebook, etc.) - Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.
|