[Draft] Development Environment for Python

Discussions about the wiki documentation of FreeCAD and its translation.
User avatar
piffpoof
Posts: 347
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

[Draft] Development Environment for Python

Postby piffpoof » Sun Mar 01, 2015 11:39 am

hello

I've completed a draft level of a page on "Development Environment for Python".

Comments would be appreciated - especially from developers of Python for FreeCAD on Windows and Linux as to whether there are any tools preferable to others. I'd be happy to add anything relevant.

The page covers how to survive with out a full-functioned debugger and is intended as a set of work-around procedures until the fully functioning Debugger is available. At that point it could be retired.

thanks

Dean
User avatar
DeepSOIC
Posts: 7655
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: [Draft] Development Environment for Python

Postby DeepSOIC » Sun Mar 01, 2015 6:22 pm

It looks extremely helpful, I'm sure I'll use the page.
I'm no good python coder.
User avatar
yorik
Site Admin
Posts: 11971
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: [Draft] Development Environment for Python

Postby yorik » Sun Mar 01, 2015 6:29 pm

Wow, very impressive.. Lots of things I didn't know!
User avatar
piffpoof
Posts: 347
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: [Draft] Development Environment for Python

Postby piffpoof » Sun Mar 01, 2015 6:54 pm

hi Yorik
I was thinking of linking it to Scripting Examples

And I thought I would also put a link there to the PySide page we put up the other week. They both need to be connected to Scripting Examples

And I've just noticed that Introduction to Python has gone walk-about.

Or maybe it was never there?

I'm going to put that into a new topic so more people see it and hopefully find where it got to.

[Edit]
Turns out there is a broken link to the page which has been renamed, I've posted it at broken link to "Introduction to Python"
Dean
Last edited by piffpoof on Sun Mar 01, 2015 7:05 pm, edited 1 time in total.
danielfalck
Posts: 395
Joined: Fri Oct 07, 2011 8:58 pm
Location: Beaverton,Oregon, USA
Contact:

Re: [Draft] Development Environment for Python

Postby danielfalck » Sun Mar 01, 2015 7:01 pm

In your PAW macro here:
http://www.freecadweb.org/wiki/index.ph ... dow#Script

on the very last function:

Code: Select all

        
def onCursorPosition(self):
    #print ("Line: {}
Did the wiki somehow truncate the rest of your script?
User avatar
piffpoof
Posts: 347
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: [Draft] Development Environment for Python

Postby piffpoof » Sun Mar 01, 2015 7:11 pm

danielfalck wrote:In your PAW macro here:
...
Did the wiki somehow truncate the rest of your script?
hi
All the code is there in the script, for some reason it does not display, if you edit the page then it is there.

I've sent you the code as a PM, problem is Python is neurotic about spaces and there may be spaces in the code I sent.
I'm not sure what the problem is. Probably needs to be sorted out by someone with more Wiki skill than I.

Yorik? Where are you?

Dean
danielfalck
Posts: 395
Joined: Fri Oct 07, 2011 8:58 pm
Location: Beaverton,Oregon, USA
Contact:

Re: [Draft] Development Environment for Python

Postby danielfalck » Sun Mar 01, 2015 7:25 pm

Ok, I used the edit wiki trick to get it. Maybe you could make a gist on github to link to the script?
Thanks for the work that you have done on all of this. I will read it and try out PAW today.
User avatar
piffpoof
Posts: 347
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: [Draft] Development Environment for Python

Postby piffpoof » Sun Mar 01, 2015 7:40 pm

danielfalck wrote:Maybe you could make a gist on github to link to the script?
Been there, done that.
Guide to Using Git on FreeCAD
I set up a github account et al the other week and then found out that git doesn't like people to extract single files. And if they insist then it Zips the files on them.

I don't know of a good way to get around this. I'm not a Wiki wizard. I have put in a feature request for something to be sorted out to handle this which is about all I could think of to do. As Python usage and macros in FreeCAD mature then the size and complexity is going to grow and something will have to sorted out.

But in the meantime it is rather haphazard and ragged for the user. After all, most people don't have the Wiki editing access to get at the "hidden" code.

Dean
danielfalck
Posts: 395
Joined: Fri Oct 07, 2011 8:58 pm
Location: Beaverton,Oregon, USA
Contact:

Re: [Draft] Development Environment for Python

Postby danielfalck » Sun Mar 01, 2015 7:42 pm

I use pastebin.com a lot to show single scripts. Here is a link to a copy of your script:

http://pastebin.com/raw.php?i=yerCrEmA

Maybe set up an account there for a while and link to it?

Thanks
User avatar
yorik
Site Admin
Posts: 11971
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: [Draft] Development Environment for Python

Postby yorik » Sun Mar 01, 2015 9:15 pm

Indeed our wiki truncates big scripts. So far nobody has been able to find out why and solve that problem...
Until now we all managed more or less the way Dan explained, by posting the complete script elsewhere... I wish we had a better solution...