![]() |
|
Re: ** Python Support Thread **
Quote:
|
Re: ** Python Support Thread **
Thanks for the help.
Would it be worth it to start with perl (or a different programming language) instead of learning python if one eventual goal (fully realizing I have a steep learning curve ahead) is to create an application that interacts with a SQL database and also connects to a flash client and a 'downloadable' client? |
Re: ** Python Support Thread **
Quote:
I would say no. Perl is a lot more cryptic, python is a pretty easy language to pick up and learn, and there's at least as many (probably more) libraries out there for Python that do exactly what you'll need to. |
Re: ** Python Support Thread **
Quote:
|
Re: ** Python Support Thread **
+PyPi is basically a CPAN for Python. I like Perl but it's rather chaotic (which is also the strong suit of the language)
http://pypi.python.org/pypi |
Re: ** Python Support Thread **
OK, I'm firmly against using ****ing tabs as meaningful characters. Maybe it's fine once all the editors you are going to use are all set up just so but moving text files between OS's and computers is just too much of a pain in the ass over using line and block endings.
|
Re: ** Python Support Thread **
Quote:
http://developer.qt.nokia.com/wiki/PySideDocumentation/ http://doc.qt.nokia.com/4.7/qdeclara...roduction.html |
Re: ** Python Support Thread **
Quote:
If you're not setting the standard for the code you're sharing then I recommend setting the 'show invisible characters' option in whatever editor you're using... it will prevent a lot of headaches, especially in a language with significant whitespace! |
Re: ** Python Support Thread **
are you really meant to use exceptions for program flow? I really like Python except that it seems to encourage constructs like
Code:
try:I don't think I would even ask this question if I was sober, but even tomorrow morning I will be interested in your feedback. |
Re: ** Python Support Thread **
Quote:
Why should I write starting/end blocks when I indent either way. I think Python code is very readable and the indentation as delimiter may seem odd but it's one of the neatest things. I guess I'm with you that only spaces should be used though, no clue why tabs were allowed. |
Re: ** Python Support Thread **
Smacks like a step backwards to COBOL and it's zones and having to start lines in particular columns. I never found braces or semi colons so hard to use. Especially when you have nested conditions and try to line up statements on both sides of the block by eye, was that 20 spaces or 24? I like Python but this feature I could do without.
|
Re: ** Python Support Thread **
Quote:
|
Re: ** Python Support Thread **
You also don't need to use a set number of spaces, you just need to be consistent for the block. If you like two spaces, that will work just fine.
Technically, this is valid. It's just a bad idea because your code should be consistent: Code:
x = 0Code:
dic = {} |
Re: ** Python Support Thread **
Quote:
I've now written a significant amount of Production Python code and I can think of only one method where I had a 6 level indent in my method (requiring 24 spaces). I might have written a few others that I can't think of - but its certainly very rare. I've found a number of things I don't like about Python - but the spaces as syntax isn't one of them. It's also never been a complaint I've heard from regular Python programmers but is something I frequently hear from people that haven't programmed in Python very muhc. |
Re: ** Python Support Thread **
Quote:
|
Re: ** Python Support Thread **
I don't see the real problem with tabs vs spaces. Every single editor/IDE worth using has an ability to set the tab size. By using spaces specifically you're imposing your rules on everyone else unless their editor/IDE also has an ability to convert leading spaces to tabs in an intelligent way.
There's absolutely no down side in using tabs. |
Re: ** Python Support Thread **
Quote:
In a perfect world with perfect developers - it might actually be possible that tabs could be better than spaces. But people aren't perfect and using exclusively tabs is hard to do (and impossible to enforce or automatically correct) and soon you have a mess of spaces and tabs that just doesn't work with multiple developers. |
Re: ** Python Support Thread **
Quote:
You can almost say writing print or writing cursive is the same concept. You don't just randomly switch to cursive as you're writing print right? How could you write 50 lines of code using tab and then just out of no where you hit space 2 times + hit tab once + hit space 2 times on line 51? That just shouldn't happen ever. |
Re: ** Python Support Thread **
It happened a lot at my old company before we had a nazi-Programmer (good kind) go through our repository and find people committing tabs and make them switch editor settings.
Here's a common example where we'd see it. You write a long line like this: Quote:
Quote:
Edit: Copying and pasting is also a great example of how spaces start getting introduced. Anyway, I'll let it go now and just be happy that I've always worked with people that use spaces and set up tabs to automatically be converted to spaces. |
Re: ** Python Support Thread **
Quote:
Code:
v = -1 |
Re: ** Python Support Thread **
Like RoundTower mentioned, in that specific case you should probably just do:
Quote:
|
Re: ** Python Support Thread **
I'm coming from using C++. The last formal instruction I had was in college. I was using Dev-C++ as my programming kit/compiler. So I'm a little lost as to how exactly Python works as a scripting language. Is there a front-end that I'll be working with?
|
Re: ** Python Support Thread **
Since Python is not statically compiled, you don't really need an IDE. Typing
Code:
python myScript.pyThat being said, there are Python IDEs available. |
Re: ** Python Support Thread **
You do not need IDE. In case you need to debug you can use print function. This by far best and superior way for writing programs.
For simple editor you can use IDLE (it comes whit python distribution), but if you really think that you can not live without VisualStudio look like software, debugger and code completion try using Eclipse whit Pydev plugin. |
Re: ** Python Support Thread **
Quote:
Bash IDEs all you want but please, please learn there's more to debugging than print statements. Sometimes a full debugger is overkill... but sometimes a debugger is the only way. |
| All times are GMT -4. The time now is 12:19 PM. |
|
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 2008-2020, Two Plus Two Interactive