Re: [Tutor] first steps
Ryan McAdam r...@quantodesign.com wrote I saved this module to my desktop You probably need to create a Folder for your Python code or you will soon have a very busy desktop! :-) # File: chaos.py # A simple program illustrating chaotic behavior. def main(): print(This program illustrates a chaotic function) x = eval(input(Enter a number between 0 and 1: )) for i in range(10): x = 3.9 * x * (1 - x) print(x) main() Don;t use eval() here it is bad practice since it opens a security hole in your program and its best to get into good security habits from the start. Instead use the explicit type that you want the data to be, in your case a floating point number(float() ) x = float(input(Enter a number between 0 and 1: )) When I open and run this module in IDLE's shell Thats your mistake. Don't open files in the shell use the File-Open menu to create a new IDLE window that doesn't have the prompt. Then when you run the file the output will appear in the IDLE shell window. going to Run Check Module and then running the module. You shouldn't need to Check Module first (unless IDLE on Mac works differently to IDLE on Windows, which it shouldn't...) Also, when it works correctly, IDLE won't run the program again via the chaos.main() statement. I get this: chaos.main() NameError: name 'chaos' is not defined This tells you that Python does not recognise chaos. If you do want to run from the prompt (eg to test chaos) then you will need to import chaos first import chaos chaos.main() HTH and welcome to the tutor list. -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] first steps
I'm a newbie running my very first module . . . Specs: Mac OSX 10.6.6 Python 3.2 IDLE v 3.2 Tk v 8.5 I saved this module to my desktop # File: chaos.py # A simple program illustrating chaotic behavior. def main(): print(This program illustrates a chaotic function) x = eval(input(Enter a number between 0 and 1: )) for i in range(10): x = 3.9 * x * (1 - x) print(x) main() When I open and run this module in IDLE's shell the application hangs. This can sometimes be 'fixed' by going to Run Check Module and then running the module. But I have a feeling I'm doing something wrong. Is there a better way to import the file into IDLE so I can run it without crashing the app? Also, when it works correctly, IDLE won't run the program again via the chaos.main() statement. I get this: Traceback (most recent call last): File pyshell#1, line 1, in module chaos.main() NameError: name 'chaos' is not defined Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] first steps
Hi Ryan, Also, when it works correctly, IDLE won't run the program again via the chaos.main() statement. I get this: Traceback (most recent call last): File pyshell#1, line 1, in module chaos.main() NameError: name 'chaos' is not defined I think IDLE is looking for a file name to run. If your file name is chaos.py, use that. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] first steps
Ryan, Did you enter it like this at the prompt: chaos.main() statement If so, that's a problem. Your function was called: main(), so if you type chaos.main(), Python doesn't know what you're talking about. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Hi, Sorry, I couldn't reply any earlier. Anyways, Alan explained it quite well. I just wanted to explain why I prefer cherrypy ... On 05/15/2010 05:21 AM, Alan Gauld wrote: M. Bashir Al-Noimimbno...@gmx.com wrote Although, I personally am a bit biased towards: http://www.cherrypy.org/ In simple words could you give me what's distinguished differences between cherrypy and django (I didn't stat with django cuz I'm still python principles)? They work a little differently and Django gives you lots of extra features that CherryPy doesn't - you need extra libraries to get the exta features. (Things like a templating engine and onject persistent database access. I'm also not sure how much of an admin GUI CherryPy delivers out of the box). That's right, CherryPy is just the web application server, whereas Django is the entire framework. Cherrypy's lack of a builtin templating system, database connector or admin interface is a design decision. This is so that you can plug in whatever components you prefer. For example, you may use cherrypy+SQLAlchemy+Kid or cherrypy+SQLObject+Genshi ...etc. [...snip...] One of the good and bad things about Python is that it supports many, many, different web tookits from the simplest CGI through to Zope and Plone which are enterprise class web frameworks(albeit with very different emphases). For most folks the middle ground includes things like Pylons, CherryPy and TG and Django. That's quite right. You can do most of what most people need with these and they are simpler in practice than either raw CGI or the heavyweight tools. So pick one and stick to it. I disagree here. I personally recommend using something 'lean' like cherrypy when building a web interface /around/ your application (for instance, a control panel for a server application, or a XML-RPC+HTTP API for your existing application) where as using a full blown framework like Django if your web-application itself is your main application (like a (web2.0) web site). that said ... Like languages or GUI toolkits, once you learn one moving to another is relatively painfree. Provided it does what you need and has a good support network don't stress over it! +1 hth, cheers, - steve -- random spiel: http://lonetwin.net/ what i'm stumbling into: http://lonetwin.stumbleupon.com/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Hello Bashir, On 05/13/2010 08:48 AM, M. Bashir Al-Noimi wrote: Thanks Alan, [...snip...] Oh my god, I finished the basics of python within one day (continues 10 hours)!!! What's amazing language :-* Yes, everyone here feels the same way :). Anyways, now that you have a hang of python and you already know Qt, I would recommend playing around with PyQT just to get a feel of the language using API that you already know. http://www.riverbankcomputing.co.uk/ http://www.commandprompt.com/community/pyqt/ If you want to directly head on to learning Web Programming though, I suggest you start with: http://www.djangobook.com/en/2.0/ Although, I personally am a bit biased towards: http://www.cherrypy.org/ ...which is a lean, no-frills web application framework. Like other have mentioned, you don't need to know CGI programming to write web applications these days, but knowing how CGI works helps immensely. For a high level overview of web programming using python, see: http://docs.python.org/howto/webservers.html hth, cheers, - steve -- random spiel: http://lonetwin.net/ what i'm stumbling into: http://lonetwin.stumbleupon.com/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Thanks Steve, On 14/05/2010 11:22 ص, steve wrote: Hello Bashir, On 05/13/2010 08:48 AM, M. Bashir Al-Noimi wrote: Thanks Alan, [...snip...] Oh my god, I finished the basics of python within one day (continues 10 hours)!!! What's amazing language :-* Yes, everyone here feels the same way :). Anyways, now that you have a hang of python and you already know Qt, I would recommend playing around with PyQT just to get a feel of the language using API that you already know. http://www.riverbankcomputing.co.uk/ http://www.commandprompt.com/community/pyqt/ Actually I wrote first PyQt application yesterday by using eric IDE, although it has stupid autocompleting and bad GUI but I could create Hello World app within 5 minutes, that's it. My adventure in python going smoothly and community of python has truly open minds. If you want to directly head on to learning Web Programming though, I suggest you start with: http://www.djangobook.com/en/2.0/ Although, I personally am a bit biased towards: http://www.cherrypy.org/ ...which is a lean, no-frills web application framework. In simple words could you give me what's distinguished differences between cherrypy and django (I didn't stat with django cuz I'm still python principles)? Like other have mentioned, you don't need to know CGI programming to write web applications these days, but knowing how CGI works helps immensely. For a high level overview of web programming using python, see: http://docs.python.org/howto/webservers.html hth, cheers, - steve -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
M. Bashir Al-Noimi mbno...@gmx.com wrote Although, I personally am a bit biased towards: http://www.cherrypy.org/ In simple words could you give me what's distinguished differences between cherrypy and django (I didn't stat with django cuz I'm still python principles)? They work a little differently and Django gives you lots of extra features that CherryPy doesn't - you need extra libraries to get the exta features. (Things like a templating engine and onject persistent database access. I'm also not sure how much of an admin GUI CherryPy delivers out of the box) In fact you can use TurboGears which is a direct competitor to Django and uses CherryPy as part of its framework. (Or it did - I know the latest version of TG has changed a lot!) One of the good and bad things about Python is that it supports many, many, different web tookits from the simplest CGI through to Zope and Plone which are enterprise class web frameworks(albeit with very different emphases). For most folks the middle ground includes things like Pylons, CherryPy and TG and Django. You can do most of what most people need with these and they are simpler in practice than either raw CGI or the heavyweight tools. So pick one and stick to it. Like languages or GUI toolkits, once you learn one moving to another is relatively painfree. Provided it does what you need and has a good support network don't stress over it! HTH, Alan G. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] First steps for C++/Qt developers
Hi All, This is my first post and I want to set a plan for learning python syntax within 2 weeks. I'm C++/Qt desktop developer and I want to learn python for creating rapid web applications so I read some articles about that and I found that django is suitable framework -I guess- but I still need some info to complete my plan then applying it. 1. From where I can start python by examples for C++ developers (I don't want documentation tutorials cuz I need simple tutorials compares between C++ python syntax just at start point)? 2. What's most IDE like Qt Creator (smart code completing is very important to me)? 3. One of most different -I guess- between PHP ASP.net is separated html code, does python separates html code or not? 4. Do I need any pre knowledge about CGI principles before stating developing web application with python? 5. Does django provide rapid framework for web applications just like Qt? or you suggest better framework (I don't want to create web applications from scratch)? 6. What's most suitable packaging tool (deploying desktop applications) for Windows OS? 7. Does the period of 2 week enough for learning python syntax basics of web developing? 8. Does any one tested an experience just like me (learning a new language within short period could be crazy ;-) )? -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
On Wed, 12 May 2010 13:09:05 +0200 M. Bashir Al-Noimi mbno...@gmx.com wrote: Hi All, This is my first post and I want to set a plan for learning python syntax within 2 weeks. I'm C++/Qt desktop developer and I want to learn python for creating rapid web applications so I read some articles about that and I found that django is suitable framework -I guess- but I still need some info to complete my plan then applying it. Just a few comments: 1. From where I can start python by examples for C++ developers (I don't want documentation tutorials cuz I need simple tutorials compares between C++ python syntax just at start point)? Depending on what you really mean with these words, it may be a wrong approach, imho. Learning a new language is not just a question of catching syntactic patterns, not even if you properly get associated semantics. It's rather a question of developping a new way of watching topics or problems, and thus modelling designing differently. Else, what you end up with is charabia, like if translating form arab to chinese word-for-word ;-) This is especially important when passing from a static to a dynamic language. Dynamicity opens new doors to modelling practice fields. Or rather: when using a static language these doors are closed... 7. Does the period of 2 week enough for learning python syntax basics of web developing? See note above. 8. Does any one tested an experience just like me (learning a new language within short period could be crazy ;-) )? Ditto. And yes, when I started with python intensively for a period, I used its OO framework like if it were static! It took me a rather long time to realise I had wrong mental schemes, barriers infact. (Actually, for a while, when watching properly written dynamic code, I even thought it was wrong ugly tricky stuff. instead I had a cube of concrete where there should be a brain.) But dynamicity is not the only point. Even rather similar languages like eg Python Ruby Lua develop different programming approaches, styles and flavors. denis vit esse estrany ☣ spir.wikidot.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Hi denis, On 12/05/2010 01:25 م, spir ☣ wrote: On Wed, 12 May 2010 13:09:05 +0200 M. Bashir Al-Noimimbno...@gmx.com wrote: Hi All, This is my first post and I want to set a plan for learning python syntax within 2 weeks. I'm C++/Qt desktop developer and I want to learn python for creating rapid web applications so I read some articles about that and I found that django is suitable framework -I guess- but I still need some info to complete my plan then applying it. Just a few comments: humm, you confused me I'm still a newbie and I don't know anything about differences between C++ python even I couldn't understand you. How C++ is a static language !??!! I use C++ since I was in high school and I still found it most flexible language, and if I found C++ is suitable for rapid web applications (you can read about wt C++ web toolkit) I'll never try to learn a new language but C++ in fact not flexible for web applications, for that I decided to learn python. In addition to your confused comment you didn't answer vital my questions. *PS* Please notice that if I knew the differences between C++ python or even knew enough info about python be sure that i'll never post any question here cuz there is python-l...@python.org mailing list for python questions not for newbie just like me :-[ 1. From where I can start python by examples for C++ developers (I don't want documentation tutorials cuz I need simple tutorials compares between C++ python syntax just at start point)? Depending on what you really mean with these words, it may be a wrong approach, imho. Learning a new language is not just a question of catching syntactic patterns, not even if you properly get associated semantics. It's rather a question of developping a new way of watching topics or problems, and thus modelling designing differently. Else, what you end up with is charabia, like if translating form arab to chinese word-for-word ;-) This is especially important when passing from a static to a dynamic language. Dynamicity opens new doors to modelling practice fields. Or rather: when using a static language these doors are closed... 7. Does the period of 2 week enough for learning python syntax basics of web developing? See note above. 8. Does any one tested an experience just like me (learning a new language within short period could be crazy ;-) )? Ditto. And yes, when I started with python intensively for a period, I used its OO framework like if it were static! It took me a rather long time to realise I had wrong mental schemes, barriers infact. (Actually, for a while, when watching properly written dynamic code, I even thought it was wrong ugly tricky stuff. instead I had a cube of concrete where there should be a brain.) But dynamicity is not the only point. Even rather similar languages like eg Python Ruby Lua develop different programming approaches, styles and flavors. denis vit esse estrany ☣ spir.wikidot.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
M. Bashir Al-Noimi wrote: snip snip humm, you confused me I'm still a newbie and I don't know anything about differences between C++ python even I couldn't understand you. How C++ is a static language !??!! In C++, every variable is declared, and the type of that variable is static over its lifetime. The only flexibility there is that a variable may also get a value of some derived type of its declared type. In Python, variables have no fixed type at all, only the objects (that they're bound to) have type. A variable can be an integer one time, a string the next, and an arbitrary object after that. DaveA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
On Wed, 12 May 2010 15:01:09 +0200 M. Bashir Al-Noimi mbno...@gmx.com wrote: humm, you confused me I'm still a newbie and I don't know anything about differences between C++ python even I couldn't understand you. How C++ is a static language !??!! Have a look at: http://en.wikipedia.org/wiki/Dynamic_language http://en.wikipedia.org/wiki/Static-typing_%28programming_languages%29#Static_typing (and the rest of the article) Denis vit esse estrany ☣ spir.wikidot.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Hi On 12/05/2010 02:25 م, Dave Angel wrote: M. Bashir Al-Noimi wrote: snip snip humm, you confused me I'm still a newbie and I don't know anything about differences between C++ python even I couldn't understand you. How C++ is a static language !??!! In C++, every variable is declared, and the type of that variable is static over its lifetime. The only flexibility there is that a variable may also get a value of some derived type of its declared type. In Python, variables have no fixed type at all, only the objects (that they're bound to) have type. A variable can be an integer one time, a string the next, and an arbitrary object after that. nice that's truly easy i think this options are mix of java+VB (gc+no need to decalre the variable) is it? -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Hi On 12/05/2010 02:52 م, spir ☣ wrote: On Wed, 12 May 2010 15:01:09 +0200 M. Bashir Al-Noimimbno...@gmx.com wrote: humm, you confused me I'm still a newbie and I don't know anything about differences between C++ python even I couldn't understand you. How C++ is a static language !??!! Have a look at: http://en.wikipedia.org/wiki/Dynamic_language http://en.wikipedia.org/wiki/Static-typing_%28programming_languages%29#Static_typing (and the rest of the article) Thanks. What about the other questions, IDE, web framework...etc? -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
On Wed, 12 May 2010 16:12:55 +0200 M. Bashir Al-Noimi mbno...@gmx.com wrote: Hi On 12/05/2010 02:52 م, spir ☣ wrote: On Wed, 12 May 2010 15:01:09 +0200 M. Bashir Al-Noimimbno...@gmx.com wrote: humm, you confused me I'm still a newbie and I don't know anything about differences between C++ python even I couldn't understand you. How C++ is a static language !??!! Have a look at: http://en.wikipedia.org/wiki/Dynamic_language http://en.wikipedia.org/wiki/Static-typing_%28programming_languages%29#Static_typing (and the rest of the article) Thanks. What about the other questions, IDE, web framework...etc? Personly have no experience at all with http://en.wikipedia.org/wiki/Django_%28web_framework%29. And few in web dev in general. Use no IDE properly speaking (you may discover it's not that advantageous with flexible languages, rather a heavy weight in everyday life ;-) but it's only my opinion). Denis vit esse estrany ☣ spir.wikidot.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Thanks a lot Walter for valuable reply, On 12/05/2010 03:09 م, Walter Prins wrote: On 12 May 2010 12:09, M. Bashir Al-Noimi mbno...@gmx.com mailto:mbno...@gmx.com wrote: 1. From where I can start python by examples for C++ developers (I don't want documentation tutorials cuz I need simple tutorials compares between C++ python syntax just at start point)? Not sure about actual examples, but have a look here: http://wiki.python.org/moin/LanguageComparisons As you say, this is only a starting point however, because Python really introduces new idioms (natural ways of expression) that does not exist in other languages. The bigger task is learning proper Python idioms/ways of expressing your intent naturally in Python, rather than writing C++ in Python syntax. For me this comparison is enough it's just a magic drug for courage :-P :-P :-P 1. What's most IDE like Qt Creator (smart code completing is very important to me)? 2. One of most different -I guess- between PHP ASP.net is separated html code, does python separates html code or not? There are multiple ways to do web development in Python, including (as you put it) PHP style and ASP.Net style. There isn't however really a RAD/visual environment specifically for *web* development in Python, however personally I would suggest this is not neccesarily a negative and may indeed be a positive. 1. Do I need any pre knowledge about CGI principles before stating developing web application with python? That depends, but I'd hazard to say understanding web (including CGI) principles would be neccesary. 1. Does django provide rapid framework for web applications just like Qt? or you suggest better framework (I don't want to create web applications from scratch)? QT is a mostly a UI widget library/framework, DJango is patently not really a UI widget library, although it takes care of a lot other details that service in the context of web development. At the risk of confusing matters further, you may want to look into the Pyjamas project. Pyjamas is essentially a Python to Javascript compiler with a UI widget abstraction layer and a Web UI layer of its, and that has bindings to GTK (similar to QT) or its own web-based UI controls. As a result, applictions targetting/using Pyjamas are/can be written in pure python, much like any conventional GUI desktop applicatoin would be, but which can then either run either as a web application or a GUI application depending on which binding is selected. More on the Pyjamas project here: http://pyjs.org/ Nice I read about same thing in Qt labs http://labs.trolltech.com/blogs/2009/09/18/qt-in-the-cloud-with-qwebclient/ but I still have a tiny two questions, pyjamas comes with UI widgets which can bind to web/js or desktop/GTK, Qt or wxWidget ui, *could I use any ui desinger (like Glade) for designing pyjamas ui?* pyjamas from code side like desktop ui where DJango is a full web framework so I'm wondering, *do I need to use one of them or both together (in case if i want to gain the benefits of ajax options)? * 1. 2. What's most suitable packaging tool (deploying desktop applications) for Windows OS? There are several, each with pro's and con's. See for example here: http://pypi.python.org/pypi/bbfreeze/0.95.4 http://www.py2exe.org/ Which one is most suitable will depend on the context you're operating in. 1. Does the period of 2 week enough for learning python syntax basics of web developing? You can probably get going in 2 weeks, but of course you'll not have mastered anything in that period and you'll be learning well beyond the initial 2 weeks (as you would be with any new language/platform.) Walter -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
M. Bashir Al-Noimi mbno...@gmx.com wrote This is my first post and I want to set a plan for learning python syntax within 2 weeks. Learning python syntax in 2 weeks is easily achievable if you go through the official tutorial at python.org. It is designed for people coming from another language, especially C++ or Java. If you work through it at a sensible pace - ie slow enough to think about it - you should be done in 2 or 3 days. From there you will know enough to start working through the Django tutorial material and write short simple Python function and programs. 1. From where I can start python by examples for C++ developers (I don't want documentation tutorials cuz I need simple tutorials compares between C++ python syntax just at start point)? As others have said, trying to convert your knowledge of C++ into Python is likely to result in you writing Python that looks like C++. It is also likely to introduce bad habits based on C++ limitations. You need to learn the Python way of doing things (and its limitations!) 2. What's most IDE like Qt Creator (smart code completing is very important to me)? Most Python IDEs do at least basic tooltips and such but if you are familiar with Eclipse then you can install PyDev and get all the usual Eclipse tools, including a good debugger. The one thing that is less useful in Eclipse is its interpreter prompt, but you can just use a tool like IDLE or Pythonwin or IPython in a terminal for that. 3. One of most different -I guess- between PHP ASP.net is separated html code, does python separates html code or not? Python supports all the different styles of web development but Django, like most modern web tools separates code from presentation. 4. Do I need any pre knowledge about CGI principles before stating developing web application with python? Since it is all built on CGI it is always a good idea to understand what is really going on. But raw CGI skill is not essential to get started in Django. 5. Does django provide rapid framework for web applications just like Qt? or you suggest better framework (I don't want to create web applications from scratch)? Django is a framework for rapid Web development but it is very different to, for example Glade. It is not an IDE or visual editor. 6. What's most suitable packaging tool (deploying desktop applications) for Windows OS? If its a web server based app then installing Python and Django on the server and loading your packages on is a better bet that trying to create an exe file os similar. 7. Does the period of 2 week enough for learning python syntax basics of web developing? Yes, but it will be a steep curve. Ask lots of questions, and read lots of documentation. Ask the questions in the place most likely to answer them correctly! (ie python stuff here, Django stuff on a Django list) 8. Does any one tested an experience just like me (learning a new language within short period could be crazy ;-) )? I've been programming for about 30 years and have learned well over 20-30 languages. C++ was the hardest to learn and took about a month to get comfortable, most take a week. Becoming an expert, now that's a different thing altogether - it took me about 4 years to reach that in C++ and about 1 year to lose it again! I'm still learning in Python after 10+ years! (Mainly because I don't use it for industrial stength projects) -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps for C++/Qt developers
Thanks Alan, On 12/05/2010 06:56 م, Alan Gauld wrote: M. Bashir Al-Noimi mbno...@gmx.com wrote This is my first post and I want to set a plan for learning python syntax within 2 weeks. Learning python syntax in 2 weeks is easily achievable if you go through the official tutorial at python.org. It is designed for people coming from another language, especially C++ or Java. If you work through it at a sensible pace - ie slow enough to think about it - you should be done in 2 or 3 days. Oh my god, I finished the basics of python within one day (continues 10 hours)!!! What's amazing language :-* From there you will know enough to start working through the Django tutorial material and write short simple Python function and programs. 1. From where I can start python by examples for C++ developers (I don't want documentation tutorials cuz I need simple tutorials compares between C++ python syntax just at start point)? As others have said, trying to convert your knowledge of C++ into Python is likely to result in you writing Python that looks like C++. It is also likely to introduce bad habits based on C++ limitations. You need to learn the Python way of doing things (and its limitations!) Actually I found some principles like extended C++ libraries, for example I'm using Qt classes for creating objects just like dictionary in python, where python provides them by default wow =-O . 2. What's most IDE like Qt Creator (smart code completing is very important to me)? Most Python IDEs do at least basic tooltips and such but if you are familiar with Eclipse then you can install PyDev and get all the usual Eclipse tools, including a good debugger. The one thing that is less useful in Eclipse is its interpreter prompt, but you can just use a tool like IDLE or Pythonwin or IPython in a terminal for that. PyDev is amazing specially I'm familiar with eclipse (I was using it before releasing Qt Creator) but as I can see it's suitable for web applications (specially with Aptana) more than desktop application because web application don't need visual editor but in case if I want to develope dektop applications (of course in the future) what's most suitable IDE for that? Until now I tested the following: 1. PyDev http://www.pydev.org/index.html (95/100): amazing and gave a good impression for first look but it's not supporting visual editor for desktop applications. 2. eric http://eric-ide.python-projects.org/index.html(80/100): the most active IDE for desktop applications in python but it has many negatives like autocompleting is so stupid managing the projects syncing changes between UI files and the code bad interface. 3. boa-constructor http://prdownloads.sourceforge.net/boa-constructor/ (70/100): generally it has only two negatives it uses wxPython and it's not active since 2007 although I prefer it more than eric but I really hate wx 4. SPE https://sourceforge.net/project/showfiles.php?group_id=145384(50/100): most likely to eric by it has arranged interface, uses wxPython and it's not active since 2006 (dead project) I found many IDEs for desktop application but most of them very simple or/and dead (PythonCard... etc) Do u've more details? 3. One of most different -I guess- between PHP ASP.net is separated html code, does python separates html code or not? Python supports all the different styles of web development but Django, like most modern web tools separates code from presentation. 4. Do I need any pre knowledge about CGI principles before stating developing web application with python? Since it is all built on CGI it is always a good idea to understand what is really going on. But raw CGI skill is not essential to get started in Django. Could you guide me to quick guide for learning CGI? 5. Does django provide rapid framework for web applications just like Qt? or you suggest better framework (I don't want to create web applications from scratch)? Django is a framework for rapid Web development but it is very different to, for example Glade. It is not an IDE or visual editor. 6. What's most suitable packaging tool (deploying desktop applications) for Windows OS? If its a web server based app then installing Python and Django on the server and loading your packages on is a better bet that trying to create an exe file os similar. 7. Does the period of 2 week enough for learning python syntax basics of web developing? Yes, but it will be a steep curve. Ask lots of questions, and read lots of documentation. Ask the questions in the place most likely to answer them correctly! (ie python stuff here, Django stuff on a Django list) 8. Does any one tested an experience just like me (learning a new language within short period could be crazy ;-) )? I've been programming for about 30 years and have
Re: [Tutor] First steps for C++/Qt developers
Hi Walter, On 13/05/2010 12:45 ص, ALAN GAULD wrote: Forwarded to the list. Please use Reply All when posting. *From:* Walter Prins wpr...@gmail.com *To:* Alan Gauld alan.ga...@btinternet.com *Sent:* Wednesday, 12 May, 2010 18:36:31 *Subject:* Re: [Tutor] First steps for C++/Qt developers Regarding IDE's: I find Eclipse with PyDev pretty good, and it recently gained support for Django specifically, so it's a good fit from that point of view for you. This of course does not include a form designer, you can choose whatever tool you like there. As an aside, there's also Delphi RAD'esque tool called Boa constructor which aims to be a RAD IDE with forms designer for Python. Not sure how active the project is etc, but maybe worth a look. As I said above Boa constructor has two negatives it uses wxPython and it's not active since 2007 As for Pyjamas, I don't know enough about it to answer if and how it may be used together with Django, although I can't see any fundamental reasons why that should not be possible. But, perhaps it's an idea for you to just develop some feel for Python itself first, writing some things from scratch, and once you've got a bit of a Python foundation you can have a look at Pyjamas etc. Walter -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps with Tkinter
Catherine I'm a Python newbie too but have done some programming with C++ Builder so have a little knowledge of GUIs etc Best regards Alun At 22:41 26/01/2006, catherine curley wrote: Alan As a matter of interest, did you have much knowledge of Python before you tried TKinter? I'm only a python beginner at present. Catherine On 1/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi! Just started trying to get to grips with Python and Tkinter. Have Frederick Lundh's tutorial and am on program hello2.py which looks like this # File: hello2.py from Tkinter import * class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text=QUIT, fg=red, command=frame.quit) self.button.pack(side=LEFT) self.hi_there = Button(frame, text=Hello, command=self.say_hi) self.hi_there.pack (side=LEFT) def say_hi(self): print hi there, everyone! root = Tk() app = App(root) root.mainloop() I am running from inside Pythonwin 2.4 IDE under XP Pro and every time I run hello2.py it freezes when I press QUIT. The only way to kill it is through Alt-Ctrl-Del but this crashes Pythonwin. Any workaround for this so that I can use Tkinter from inside the IDE? BTW the same thing happend with IDLE Thanks in advance Alun Griffiths ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] First steps with Tkinter
Hi! Just started trying to get to grips with Python and Tkinter. Have Frederick Lundh's tutorial and am on program hello2.py which looks like this # File: hello2.py from Tkinter import * class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text=QUIT, fg=red, command=frame.quit) self.button.pack(side=LEFT) self.hi_there = Button(frame, text=Hello, command=self.say_hi) self.hi_there.pack(side=LEFT) def say_hi(self): print hi there, everyone! root = Tk() app = App(root) root.mainloop() I am running from inside Pythonwin 2.4 IDE under XP Pro and every time I run hello2.py it freezes when I press QUIT. The only way to kill it is through Alt-Ctrl-Del but this crashes Pythonwin. Any workaround for this so that I can use Tkinter from inside the IDE? BTW the same thing happend with IDLE Thanks in advance Alun Griffiths ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps with Tkinter
On Thu, 26 Jan 2006 18:20:48 + [EMAIL PROTECTED] wrote: root.mainloop() I am running from inside Pythonwin 2.4 IDE under XP Pro and every time I run hello2.py it freezes when I press QUIT. The only way to kill it is through Alt-Ctrl-Del but this crashes Pythonwin. Any workaround for this so that I can use Tkinter from inside the IDE? BTW the same thing happend with IDLE Hi, when running Tkinter apps from IDLE or Pythonwin, you need to comment out the call to mainloop() . This is because the IDE itself runs a Tkinter mainloop() and two of these cannot coexist in one process. I hope this helps Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First steps with Tkinter
Alan As a matter of interest, did you have much knowledge of Python before you tried TKinter? I'm only a python beginner at present. Catherine On 1/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi!Just started trying to get to grips with Python and Tkinter.Have FrederickLundh's tutorial and am on program hello2.py which looks like this# File: hello2.pyfrom Tkinter import *class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text=QUIT, fg=red, command=frame.quit) self.button.pack(side=LEFT) self.hi_there = Button(frame, text=Hello, command=self.say_hi) self.hi_there.pack (side=LEFT) def say_hi(self): print hi there, everyone!root = Tk()app = App(root)root.mainloop()I am running from inside Pythonwin 2.4 IDE under XP Pro and every time I run hello2.py it freezes when I press QUIT.The only way to kill it is throughAlt-Ctrl-Del but this crashes Pythonwin.Any workaround for this so that Ican use Tkinter from inside the IDE?BTW the same thing happend with IDLE Thanks in advanceAlun Griffiths___Tutor maillist-Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor