Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 11/07/2018 01:31 PM, MRAB wrote: > On 2018-11-07 09:20, Thomas Jollans wrote: >> I'll just take this opportunity to point out (for those that don't know) >> that Visual Studio Code (an open source cross-platform programmer's text >> editor of the same calibre as Sublime or Atom, not an IDE) has great >> support for (graphical) debugging of Python code. Not tedious to set up, >> particularly. Obviously there are plugins for other editors, but they're >> usually not this well-integrated. >> > I find that the code does run more slowly, though. Why? Python is python, isn't it? Usually code runs slower in a debugger. Isn't VS code using pdb under the hood? -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 07/11/2018 21:31, MRAB wrote: > On 2018-11-07 09:20, Thomas Jollans wrote: >> On 06/11/2018 22:51, Lie Ryan wrote: I like to step through my code line by line, it's impossible to do it with object-oriented programming language. >>> >>> I suggest pudb, it's a curses based debugger, which is nicer than >>> pdb, but doesn't require tedious IDE setup. >> >> I'll just take this opportunity to point out (for those that don't know) >> that Visual Studio Code (an open source cross-platform programmer's text >> editor of the same calibre as Sublime or Atom, not an IDE) has great >> support for (graphical) debugging of Python code. Not tedious to set up, >> particularly. Obviously there are plugins for other editors, but they're >> usually not this well-integrated. >> > I find that the code does run more slowly, though. Can't argue with that. I'm not totally sold on vscode, either. But I enjoy the debugger! > >>> Also, there's no good REPL IDE. >>> >>> Not quite sure what you meant by REPL IDE, but did you try IPython >>> >> >> If you find yourself wanting a debugger in an IPython/Jupyter notebook, >> ipdb is pretty nice. >> -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 2018-11-07 09:20, Thomas Jollans wrote: On 06/11/2018 22:51, Lie Ryan wrote: I like to step through my code line by line, it's impossible to do it with object-oriented programming language. I suggest pudb, it's a curses based debugger, which is nicer than pdb, but doesn't require tedious IDE setup. I'll just take this opportunity to point out (for those that don't know) that Visual Studio Code (an open source cross-platform programmer's text editor of the same calibre as Sublime or Atom, not an IDE) has great support for (graphical) debugging of Python code. Not tedious to set up, particularly. Obviously there are plugins for other editors, but they're usually not this well-integrated. I find that the code does run more slowly, though. Also, there's no good REPL IDE. Not quite sure what you meant by REPL IDE, but did you try IPython If you find yourself wanting a debugger in an IPython/Jupyter notebook, ipdb is pretty nice. -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 06/11/2018 22:51, Lie Ryan wrote: >> I like to step through my code line by line, >> it's impossible to do it with >> object-oriented programming language. > > I suggest pudb, it's a curses based debugger, which is nicer than pdb, but > doesn't require tedious IDE setup. I'll just take this opportunity to point out (for those that don't know) that Visual Studio Code (an open source cross-platform programmer's text editor of the same calibre as Sublime or Atom, not an IDE) has great support for (graphical) debugging of Python code. Not tedious to set up, particularly. Obviously there are plugins for other editors, but they're usually not this well-integrated. > >> Also, there's no good REPL IDE. > > Not quite sure what you meant by REPL IDE, but did you try IPython > If you find yourself wanting a debugger in an IPython/Jupyter notebook, ipdb is pretty nice. -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
> I like to step through my code line by line, > it's impossible to do it with > object-oriented programming language. I suggest pudb, it's a curses based debugger, which is nicer than pdb, but doesn't require tedious IDE setup. > Also, there's no good REPL IDE. Not quite sure what you meant by REPL IDE, but did you try IPython -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 11/4/18 8:55 AM, Mike C wrote: Same here. Debugging in Python is annoying, I like to step through my code line by line, it's impossible to do it with object-oriented programming language. Also, there's no good REPL IDE. Spyder barely works with some basic features. PyCharm, the most popular, takes too long to start, and you have to setup folders and directories EVERY SINGLE TIME at startup. I've never been a fan of IDEs, but a code editor window on the left and the IPython QtConsole on the right is a pretty efficient way to blaze through code. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On Sun, Nov 4, 2018 at 11:56 AM Mike C wrote: > > Same here. Debugging in Python is annoying, I like to step through my code > line by line, it's impossible to do it with object-oriented programming > language. > > Also, there's no good REPL IDE. > > Spyder barely works with some basic features. PyCharm, the most popular, > takes too long to start, and you have to setup folders and directories EVERY > SINGLE TIME at startup. I use pdb and I have no issues debugging nor stepping through my code line-by-line when needed. What does it being OO have to do with it? But then again, I also know better then to top post. > Rhodri James wrote: > ... > > I completely agree. I too have come from a background in C, and still > > do most of my day job in C or assembler. It took a while before I was > > writing idiomatic Python, never mind efficient Python (arguably I still > > don't, but as Rob says, who cares?). Don't worry about it; at some > > point you will discover that the "obvious" Python you are writing looks > > a lot like the code you are looking at now and thinking "that's really > > clever, I'll never be able to to that." > > at this stage of my own process in learning, i'm > trying to read the FAQs i can find, any tutorials, > answers to specific questions on stackoverflow on > particular topics to see if i can understand the > issues, etc. > > as for my own code, yes, it's horrible at the > moment, but to me working code is always the > final arbitor. i much prefer simple and stepwise > refinement if speed isn't the issue i think clarity > and simplicity is more important. > > speed is only more important for large projects > that process a ton of data. > > in 3-5yrs i expect to understand more of what > the theory and more conceptual things going on as > i read more of the history and how the language > has developed. > > i won't consider myself fluent until i start > "thinking" in it and can visualise the data > structures/objects in my head and such as i > currently do for C. -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
Same here. Debugging in Python is annoying, I like to step through my code line by line, it's impossible to do it with object-oriented programming language. Also, there's no good REPL IDE. Spyder barely works with some basic features. PyCharm, the most popular, takes too long to start, and you have to setup folders and directories EVERY SINGLE TIME at startup. From: Python-list on behalf of songbird Sent: Saturday, November 3, 2018 12:45:57 PM To: python-list@python.org Subject: Re: Overwhelmed by the Simplicity of Python. Any Recommendation? Rhodri James wrote: ... > I completely agree. I too have come from a background in C, and still > do most of my day job in C or assembler. It took a while before I was > writing idiomatic Python, never mind efficient Python (arguably I still > don't, but as Rob says, who cares?). Don't worry about it; at some > point you will discover that the "obvious" Python you are writing looks > a lot like the code you are looking at now and thinking "that's really > clever, I'll never be able to to that." at this stage of my own process in learning, i'm trying to read the FAQs i can find, any tutorials, answers to specific questions on stackoverflow on particular topics to see if i can understand the issues, etc. as for my own code, yes, it's horrible at the moment, but to me working code is always the final arbitor. i much prefer simple and stepwise refinement if speed isn't the issue i think clarity and simplicity is more important. speed is only more important for large projects that process a ton of data. in 3-5yrs i expect to understand more of what the theory and more conceptual things going on as i read more of the history and how the language has developed. i won't consider myself fluent until i start "thinking" in it and can visualise the data structures/objects in my head and such as i currently do for C. songbird -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
Rhodri James wrote: ... > I completely agree. I too have come from a background in C, and still > do most of my day job in C or assembler. It took a while before I was > writing idiomatic Python, never mind efficient Python (arguably I still > don't, but as Rob says, who cares?). Don't worry about it; at some > point you will discover that the "obvious" Python you are writing looks > a lot like the code you are looking at now and thinking "that's really > clever, I'll never be able to to that." at this stage of my own process in learning, i'm trying to read the FAQs i can find, any tutorials, answers to specific questions on stackoverflow on particular topics to see if i can understand the issues, etc. as for my own code, yes, it's horrible at the moment, but to me working code is always the final arbitor. i much prefer simple and stepwise refinement if speed isn't the issue i think clarity and simplicity is more important. speed is only more important for large projects that process a ton of data. in 3-5yrs i expect to understand more of what the theory and more conceptual things going on as i read more of the history and how the language has developed. i won't consider myself fluent until i start "thinking" in it and can visualise the data structures/objects in my head and such as i currently do for C. songbird -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
become wiser in python me i came from c/java and was doing for i in range(0, len(list)): # get list item by index instead of for item in list: XD well the more you are exposed to py, the better you knoe hoe things work. reading source of popular projects is really great, and ... read the docs, ask your doubts on the mailing list, not to be afraid to read technical stuffs about py etc oh and ... do some projects (500+ lines) in py Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On Fri, 12 Oct 2018 09:12:03 -0700, Rob Gaddi wrote: > On 10/11/2018 11:29 PM, Kaan Taze wrote: >> Hi everyone, >> >> Since this is my first post to mail-list I'm kind of hesitant to ask >> this question here but as many of you spend years working with Python >> maybe some of you can guide me. >> >> What I trouble with is not a logical error that exist on a program I >> wrote. >> It's the Python itself. Well, I'm 22 years old CS student -from Turkey- >> and what they showed us at university was C Language and Java but I >> mainly use C in school projects etc. So it's been few months that I >> started to use Python for my personal side-projects. There are lots of >> resources to learn language. I do what I need to do with Python too but >> I was kinda shocked when I solve Python questions at Hackerrank. Even >> with list comprehensions you can implement in very smart way to get >> things done and easy. Iterations, string operations. The codes I see on >> the Internet using basics in a very clever way which I couldn't come up >> with the same solution if I tried to for some time. I do understand >> this ways but coming from ANSI C makes it hard to see this flexibility. >> I probably do things in a both inefficient and hard way in my projects. >> >> How do I get used to this? Is this just another "practice, practice, >> practice" situation? Anything you can recommend? >> >> >> All the best. >> >> Kaan. >> >> > A) Yes, it's practice practice practice. > > B) Don't get hung up on finding the clever solution. Comprehensions and > generators and lots of other things are great under some circumstances > for making the code clearer and easier to read, but they too can become > the hammer that makes everything look like a nail. The most important > thing is that your code is logical, clean, and easy to understand. If > it doesn't take full advantage of the language features, or if the > performance isn't optimized to within an inch of its life, well so be > it. To re-enforce this someone much wiser than me wrote (& I a paraphrasing a bit) It takes more skill to debug code than to write it so if you write code at the limits of your ability yo do not have the skills needed to debug it. KISS - Keep It Simple Stupid -- Even if you do learn to speak correct English, whom are you going to speak it to? -- Clarence Darrow -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 10/12/2018 1:06 PM, Chris Angelico wrote: There are many many different ways to write code, and you can approach your coding challenges from all sorts of directions. My recommendation is: Pseudo-code first, then implement in actual Python. https://en.wikipedia.org/wiki/Pseudocode Note how, in the Wiki page, there are a number of different forms of pseudocode. You're free to develop your own particular style. In general, pseudocode is a bit more rigorous than plain English, but less than actually-executable code. Over two decades ago, I dubbed Python 'executable pseudocode'. I recommend using it as such. Here is a common program template that makes the basic logic clear def f() it = get_iterable() for item in it: process(item) return summary() f(some args) Once you have some pseudocode written, make as few changes as you can, getting it to be runnable. In other words, you want your final code to look as much like pseudocode as you possibly can. Either write the currently fake functions or replace the calls with inline code. Do the latter for items. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 2018-10-12, Kaan Taze wrote: > How do I get used to this? Is this just another "practice, > practice, practice" situation? Anything you can recommend? You will become comfortable with Python with time and practice. Be patient with yourself. I don't care for my early Python code, but it still works and I can still maintain it with little trouble. -- Neil Cerutti -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 2018-10-12 11:44, Rhodri James wrote: On 12/10/18 17:12, Rob Gaddi wrote: On 10/11/2018 11:29 PM, Kaan Taze wrote: Hi everyone, Since this is my first post to mail-list I'm kind of hesitant to ask this question here but as many of you spend years working with Python maybe some of you can guide me. What I trouble with is not a logical error that exist on a program I wrote. It's the Python itself. Well, I'm 22 years old CS student -from Turkey- and what they showed us at university was C Language and Java but I mainly use C in school projects etc. So it's been few months that I started to use Python for my personal side-projects. There are lots of resources to learn language. I do what I need to do with Python too but I was kinda shocked when I solve Python questions at Hackerrank. Even with list comprehensions you can implement in very smart way to get things done and easy. Iterations, string operations. The codes I see on the Internet using basics in a very clever way which I couldn't come up with the same solution if I tried to for some time. I do understand this ways but coming from ANSI C makes it hard to see this flexibility. I probably do things in a both inefficient and hard way in my projects. How do I get used to this? Is this just another "practice, practice, practice" situation? Anything you can recommend? All the best. Kaan. A) Yes, it's practice practice practice. B) Don't get hung up on finding the clever solution. Comprehensions and generators and lots of other things are great under some circumstances for making the code clearer and easier to read, but they too can become the hammer that makes everything look like a nail. The most important thing is that your code is logical, clean, and easy to understand. If it doesn't take full advantage of the language features, or if the performance isn't optimized to within an inch of its life, well so be it. I completely agree. I too have come from a background in C, and still do most of my day job in C or assembler. It took a while before I was writing idiomatic Python, never mind efficient Python (arguably I still don't, but as Rob says, who cares?). Don't worry about it; at some point you will discover that the "obvious" Python you are writing looks a lot like the code you are looking at now and thinking "that's really clever, I'll never be able to to that." I suggest two things: 1. Document your work as you do it in something like Jupyter Notebooks that were discussed in another recent thread. I use "R Markdown Documents" in RStudio. This allows me to mix Python code with text and code for other languages (including R, C, SQL, and others). I tried installing Jupyter using Ananconda Navigator and failed -- under both Windows 7 and macOS 10.14.[1] One consulting gig I had involved spending roughly a week creating an "R Markdown Document" mixing text with code and results analyzing a client's data, followed by months replying to questions by asking, "Did you look at p. ___ in the R Markdown Document I gave you" -- plus a few extensions to that document. An article in The Atlantic last April claimed, "The scientific research paper is obsolete" and is being replaced by Jupyter Notebooks.[2] I'd like to see a serious comparison of "R Markdown Documents" with "Jupyter Notebooks": The latter may be better, but I was unable to even started with them after two days of effort. 2. Find a reasonable "Introduction to Python" on the web. Others on this list should be able to suggest several. I just found "https://docs.python.org/2/tutorial/introduction.html". A web search for "an introduction to Python" identified several others. I'd also be interested in reference(s) others might suggest for "creating python packages". Hope this helps. Spencer Graves [1] RStudio offers a free "Desktop" version, which I have used routinely for the past three years. It's available at "www.rstudio.com/products/rstudio/download". Creating "R Markdown Documents" (File > "New File" > "R Markdown..." in RStudio) made a dramatic improvement in my productivity in many ways similar to those described by Paul Romer in "https://paulromer.net/jupyter-mathematica-and-the-future-of-the-research-paper;. (I also experimented with File > "New File" > "R Notebook" in RStudio and encountered bazaar errors I could not understand -- and no benefits that I could see that would push me to spend more time trying to get past the problems I encountered. I've used "R Markdown Documents" extensively for three years -- with R -- and I found it easy to use with Python once I learned I could do that. See "https://bookdown.org/yihui/rmarkdown;. [2] https://www.theatlantic.com/science/archive/2018/04/the-scientific-paper-is-obsolete/556676/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On Sat, Oct 13, 2018 at 3:07 AM Kaan Taze wrote: > > Hi everyone, > > Since this is my first post to mail-list I'm kind of hesitant to ask this > question here but as many of you spend years working with Python maybe some > of you can guide me. Hey there, welcome! :) > I do what I need to do with Python too but I was kinda shocked > when I solve Python questions at Hackerrank. Even with list comprehensions > you can implement in very smart way to get things done and easy. > Iterations, string operations. There are many many different ways to write code, and you can approach your coding challenges from all sorts of directions. My recommendation is: Pseudo-code first, then implement in actual Python. https://en.wikipedia.org/wiki/Pseudocode Note how, in the Wiki page, there are a number of different forms of pseudocode. You're free to develop your own particular style. In general, pseudocode is a bit more rigorous than plain English, but less than actually-executable code. Once you have some pseudocode written, make as few changes as you can, getting it to be runnable. In other words, you want your final code to look as much like pseudocode as you possibly can. Python is great at this; the syntax lends itself well to that style of writing. (In fact, when I'm teaching JavaScript, I often push students towards a pseudocode style that looks a lot like Python code.) Code should express an algorithm, not showcase your ability to wield language features :) Hope that helps! ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 12/10/18 17:12, Rob Gaddi wrote: On 10/11/2018 11:29 PM, Kaan Taze wrote: Hi everyone, Since this is my first post to mail-list I'm kind of hesitant to ask this question here but as many of you spend years working with Python maybe some of you can guide me. What I trouble with is not a logical error that exist on a program I wrote. It's the Python itself. Well, I'm 22 years old CS student -from Turkey- and what they showed us at university was C Language and Java but I mainly use C in school projects etc. So it's been few months that I started to use Python for my personal side-projects. There are lots of resources to learn language. I do what I need to do with Python too but I was kinda shocked when I solve Python questions at Hackerrank. Even with list comprehensions you can implement in very smart way to get things done and easy. Iterations, string operations. The codes I see on the Internet using basics in a very clever way which I couldn't come up with the same solution if I tried to for some time. I do understand this ways but coming from ANSI C makes it hard to see this flexibility. I probably do things in a both inefficient and hard way in my projects. How do I get used to this? Is this just another "practice, practice, practice" situation? Anything you can recommend? All the best. Kaan. A) Yes, it's practice practice practice. B) Don't get hung up on finding the clever solution. Comprehensions and generators and lots of other things are great under some circumstances for making the code clearer and easier to read, but they too can become the hammer that makes everything look like a nail. The most important thing is that your code is logical, clean, and easy to understand. If it doesn't take full advantage of the language features, or if the performance isn't optimized to within an inch of its life, well so be it. I completely agree. I too have come from a background in C, and still do most of my day job in C or assembler. It took a while before I was writing idiomatic Python, never mind efficient Python (arguably I still don't, but as Rob says, who cares?). Don't worry about it; at some point you will discover that the "obvious" Python you are writing looks a lot like the code you are looking at now and thinking "that's really clever, I'll never be able to to that." -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list
Re: Overwhelmed by the Simplicity of Python. Any Recommendation?
On 10/11/2018 11:29 PM, Kaan Taze wrote: Hi everyone, Since this is my first post to mail-list I'm kind of hesitant to ask this question here but as many of you spend years working with Python maybe some of you can guide me. What I trouble with is not a logical error that exist on a program I wrote. It's the Python itself. Well, I'm 22 years old CS student -from Turkey- and what they showed us at university was C Language and Java but I mainly use C in school projects etc. So it's been few months that I started to use Python for my personal side-projects. There are lots of resources to learn language. I do what I need to do with Python too but I was kinda shocked when I solve Python questions at Hackerrank. Even with list comprehensions you can implement in very smart way to get things done and easy. Iterations, string operations. The codes I see on the Internet using basics in a very clever way which I couldn't come up with the same solution if I tried to for some time. I do understand this ways but coming from ANSI C makes it hard to see this flexibility. I probably do things in a both inefficient and hard way in my projects. How do I get used to this? Is this just another "practice, practice, practice" situation? Anything you can recommend? All the best. Kaan. A) Yes, it's practice practice practice. B) Don't get hung up on finding the clever solution. Comprehensions and generators and lots of other things are great under some circumstances for making the code clearer and easier to read, but they too can become the hammer that makes everything look like a nail. The most important thing is that your code is logical, clean, and easy to understand. If it doesn't take full advantage of the language features, or if the performance isn't optimized to within an inch of its life, well so be it. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list
Overwhelmed by the Simplicity of Python. Any Recommendation?
Hi everyone, Since this is my first post to mail-list I'm kind of hesitant to ask this question here but as many of you spend years working with Python maybe some of you can guide me. What I trouble with is not a logical error that exist on a program I wrote. It's the Python itself. Well, I'm 22 years old CS student -from Turkey- and what they showed us at university was C Language and Java but I mainly use C in school projects etc. So it's been few months that I started to use Python for my personal side-projects. There are lots of resources to learn language. I do what I need to do with Python too but I was kinda shocked when I solve Python questions at Hackerrank. Even with list comprehensions you can implement in very smart way to get things done and easy. Iterations, string operations. The codes I see on the Internet using basics in a very clever way which I couldn't come up with the same solution if I tried to for some time. I do understand this ways but coming from ANSI C makes it hard to see this flexibility. I probably do things in a both inefficient and hard way in my projects. How do I get used to this? Is this just another "practice, practice, practice" situation? Anything you can recommend? All the best. Kaan. -- https://mail.python.org/mailman/listinfo/python-list