EAGLE Central Forums
Where the EAGLE community meets. Sponsored by Stratford Digital.

Home » CadSoft Support Forums » eagle.userchat.eng » Cadsoft Eagle with Python Scripting
Cadsoft Eagle with Python Scripting [message #150559] Sun, 14 April 2013 03:08 Go to next message
Robin Watson
Messages: 10
Registered: April 2013
Junior Member
Hi,

I've only started using Eagle a few weeks ago, and as much as I like it,
I have found what I consider some pretty fundamental features just
missing. As the built in scripting language is extremely restrictive
(when compared to a 'real' language like python, lua or ruby), I made an
attempt to get python running with Eagle.

(http://youtu.be/_w7CECR7Dv8)

The above is a video of a project been working on for the 3-4 days,
which basically involves exposing the Cadsoft ULP and SCR to python
(albeit in not the fastest way). But it does allow me to know use 90% of
the ULP and all of the SCR directly from python, including the Object
Heirarchies, board.grid... schematic... which have all be exposed in a
pythonic way.

as an example, to get all the Instances in the schematic..

instances = Eaglepy.ULSchematic().instances()

or loop,

for instance in Eaglepy.ULSchematic().instances():
     print instance.name()

etc..

Hopefully when I have had time to test this a bit more I will release
the code to the community, along with any tools I have built. for others
who might want this funtionality. (something that should be out of the
box with proper bindings to a proper language imo...)

Cheers

Rob.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/74113#74113
Re: Cadsoft Eagle with Python Scripting [message #150582 is a reply to message #150559] Mon, 15 April 2013 23:36 Go to previous messageGo to next message
Robin Watson
Messages: 10
Registered: April 2013
Junior Member
Just wanted to post a little update to show how quick and easy it is to
knock out some pretty functional tools in an evening with python... and
enjoy the benefits of hundreds of throusands of hours of other peoples
time coding various modules. All with simple "import x"...

The first pass of the 'Outliner' tool in the video allows saving
selections as groups.. effectively acting as a simple explorer of the
scene, which I want to add lots more too.

The alignment tools, although they could be done directly in ULP, it
would probably take longer and not look half as pretty as directly using
Qt myself (rather then the minimal set of wrapped qt bits exposed
through the various dlgFunctions() )

&feature=youtu.be

Cheers

Rob.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/74219#74219
Re: Cadsoft Eagle with Python Scripting [message #151943 is a reply to message #150582] Tue, 06 August 2013 21:30 Go to previous messageGo to next message
Mehul Tikekar
Messages: 1
Registered: August 2013
Junior Member
Hi Rob,
Is it possible to have a console running in Eagle to add/modify/delete
stuff on the schematics or boards in a pythonic way?

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/85799#85799
Re: Cadsoft Eagle with Python Scripting [message #151944 is a reply to message #150582] Tue, 06 August 2013 22:00 Go to previous messageGo to next message
Christoph Gohle
Messages: 1
Registered: August 2013
Junior Member
Hey Rob,

looks nice. Do you have some code for us?

Cheers,
Christoph

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/85811#85811
Re: Cadsoft Eagle with Python Scripting [message #151966 is a reply to message #150559] Thu, 08 August 2013 02:30 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Is this EAGLE 6 only or will it work with EAGLE 5?

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/85947#85947
Re: Cadsoft Eagle with Python Scripting [message #152068 is a reply to message #151966] Fri, 16 August 2013 21:14 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Rob, you still around at all or did you just throw in this tease and
leave forever?

I've been trying to hack some python together myself.  I'm using PyQt,
and I can make up nice graphical menus, but I can't figure out how you
created your alignment tool and kept it displayed while having it work. 
The only thing I know is to create a script file with python and then
run the script when I exit.  Of course, exit means I'm closing the
GUI...

Anybody have any ideas how this works?

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/86910#86910
Re: Cadsoft Eagle with Python Scripting [message #152069 is a reply to message #152068] Fri, 16 August 2013 21:44 Go to previous messageGo to next message
Robin Watson
Messages: 10
Registered: April 2013
Junior Member
Hi Doug.

I've emailed you all the code. I've not looked at this since I posted
those videos, and haven't touched eagle in a while, but I'll stick it on
a git repository somewhere when I have a change to orgainise it and
write a quick readme.

Cheers

Rob.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/86912#86912
Re: Cadsoft Eagle with Python Scripting [message #152070 is a reply to message #152069] Fri, 16 August 2013 22:14 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Brilliant!  Cheers mate!

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/86913#86913
Re: Cadsoft Eagle with Python Scripting [message #154332 is a reply to message #150559] Thu, 13 March 2014 17:46 Go to previous messageGo to next message
Jesse Millwood
Messages: 2
Registered: March 2014
Junior Member
Robin or Doug,

Would either of you mind sending me the code as well or pointing me to a
repo where it may be?

Thank you
Jesse

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/106200
Re: Cadsoft Eagle with Python Scripting [message #154334 is a reply to message #154332] Thu, 13 March 2014 18:16 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
I set up a Bitbucket repo for it.  (Private repositories on Bitbucket
are free, Github charges for them.)  Let me ask Rob what kind of
copyright/license he wants to use, and I'll let you know how to get
it...

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/106204
Re: Cadsoft Eagle with Python Scripting [message #154335 is a reply to message #154334] Thu, 13 March 2014 18:16 Go to previous messageGo to next message
Jesse Millwood
Messages: 2
Registered: March 2014
Junior Member
Thank you very much

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/106205
Re: Cadsoft Eagle with Python Scripting [message #155039 is a reply to message #154334] Fri, 18 April 2014 22:00 Go to previous messageGo to next message
Randolph Voorhies
Messages: 1
Registered: April 2014
Junior Member
I would love to get access to this as well.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/109637
Re: Cadsoft Eagle with Python Scripting [message #155043 is a reply to message #154334] Sat, 19 April 2014 12:56 Go to previous messageGo to next message
Chuck Huber
Messages: 601
Registered: October 2004
Senior Member
Rob, Doug,

Count me in as well, please.

- Chuck
Re: Cadsoft Eagle with Python Scripting [message #155048 is a reply to message #154334] Sat, 19 April 2014 20:26 Go to previous messageGo to next message
warrenbrayshaw
Messages: 1762
Registered: January 2010
Location: New Zealand
Senior Member
And me too please

Warren
Re: Cadsoft Eagle with Python Scripting [message #155063 is a reply to message #154334] Mon, 21 April 2014 23:30 Go to previous messageGo to next message
Robin Watson
Messages: 10
Registered: April 2013
Junior Member
If you already have a bitbucket setup, by all means share it on this
thread. As far as I am concerned The MIT License (MIT) | Open Source
Initiative (http://opensource.org/licenses/MIT) license is fine.

Rob.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/109912
Re: Cadsoft Eagle with Python Scripting [message #155143 is a reply to message #155063] Tue, 29 April 2014 22:44 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Sorry for the delay, I was in San Diego, California, watching my son
compete in the Triton Invitational track meet.

When I get home I'll make the repository public and then reply to this
thread with the URL...

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/110801
Re: Cadsoft Eagle with Python Scripting [message #155245 is a reply to message #155143] Wed, 07 May 2014 01:36 Go to previous messageGo to next message
warrenbrayshaw
Messages: 1762
Registered: January 2010
Location: New Zealand
Senior Member
Hi Doug

Have you made it home yet or are you still out with your son celebrating?

Regards
Warren
Re: Cadsoft Eagle with Python Scripting [message #155246 is a reply to message #155245] Wed, 07 May 2014 04:40 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
I'll be back in the office tomorrow, Wednesday the 7th.

My son threw far enough to make the nationals in discus, but didn't
throw the hammer far enough to qualify.  I'm still a proud dad though!

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/111816
Re: Cadsoft Eagle with Python Scripting [message #155247 is a reply to message #155246] Wed, 07 May 2014 04:49 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
P.S. Anybody program in the Scala language?  I've seen some decent XML
file processing done with it.  I'm going to try parsing and manipulating
EAGLE files with it...

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/111817
Re: Cadsoft Eagle with Python Scripting [message #156030 is a reply to message #155143] Fri, 27 June 2014 06:06 Go to previous messageGo to next message
Cad User
Messages: 1
Registered: June 2014
Junior Member
Hi Doug,


I'm also quite interested in this. Any news?


Thanks,
Hans

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/118746
Re: Cadsoft Eagle with Python Scripting [message #156031 is a reply to message #156030] Fri, 27 June 2014 08:51 Go to previous messageGo to next message
Robin Watson
Messages: 10
Registered: April 2013
Junior Member
I'll get this setup this weekend and paste the URL here.

Cheers

Rob.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/118785
Re: Cadsoft Eagle with Python Scripting [message #156032 is a reply to message #156031] Fri, 27 June 2014 09:49 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Sorry guys, I got side-tracked with work again.  I finally figured out
how to make the repository public:

https://bitbucket.org/AnalogNotes/eagle-python

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/118779
Re: Cadsoft Eagle with Python Scripting [message #156036 is a reply to message #156032] Fri, 27 June 2014 13:29 Go to previous messageGo to next message
Baron
Messages: 92
Registered: November 2008
Location: UK
Member
Doug Wellington scribbled thus:

> Sorry guys, I got side-tracked with work again.  I finally figured out
> how to make the repository public:
>
> https://bitbucket.org/AnalogNotes/eagle-python
>
> --
> To view any images and attachments in this post, visit:
> http://www.element14.com/community/message/118779

NO ! It requires a password and login name...

--
Best Regards:
Baron.
Re: Cadsoft Eagle with Python Scripting [message #156038 is a reply to message #156036] Fri, 27 June 2014 13:34 Go to previous messageGo to next message
Robin Watson
Messages: 10
Registered: April 2013
Junior Member
Look at the post above Dougs. I got round to cleaning up, and putting it
on github myself.. I asked Doug to remove the version I sent him, to
ease confusion.

> Here is the complete code.
>
>
>
> https://github.com/rmawatson/PyEagle

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/118791
Re: Cadsoft Eagle with Python Scripting [message #156039 is a reply to message #156036] Fri, 27 June 2014 14:38 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
> Baron wrote:
>
> NO !  It requires a password and login name...

Sorry mate, Robin's original message didn't get propagated to the NNTP
group and for some reason, even though he posted after me, his message
shows up before mine on the Element14 forum.  If I had known that he was
putting a repository up, I wouldn't have made mine public.  Once he
created his, I set mine back to private.  Since he's the author of the
code, it's better that you use his repo...

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/118806
Re: Cadsoft Eagle with Python Scripting [message #156041 is a reply to message #156039] Fri, 27 June 2014 19:21 Go to previous messageGo to next message
Baron
Messages: 92
Registered: November 2008
Location: UK
Member
Doug Wellington scribbled thus:

>> Baron wrote:
>>
>> NO !  It requires a password and login name...
>
> Sorry mate, Robin's original message didn't get propagated to the NNTP
> group and for some reason, even though he posted after me, his message
> shows up before mine on the Element14 forum.  If I had known that he
> was putting a repository up, I wouldn't have made mine public.  Once
> he created his, I set mine back to private.  Since he's the author of
> the code, it's better that you use his repo...
>
> --
> To view any images and attachments in this post, visit:
> http://www.element14.com/community/message/118806

OK ! Thanks for update.

--
Best Regards:
Baron.
Re: Cadsoft Eagle with Python Scripting [message #156059 is a reply to message #156038] Sun, 29 June 2014 22:13 Go to previous messageGo to next message
warrenbrayshaw
Messages: 1762
Registered: January 2010
Location: New Zealand
Senior Member
Hi Robin

That's a lot of work you have done.
Thanks for sharing

Warren
Re: Cadsoft Eagle with Python Scripting [message #156118 is a reply to message #150559] Thu, 03 July 2014 17:35 Go to previous messageGo to next message
foxx00
Messages: 1
Registered: July 2014
Junior Member
Excellent work!

I've been trying to import eagle schematics into Python now that they in
XML format.

So far I have a script that can import and return iterable objects for
layers, parts. segments, that still needs some work, and libraries which
is broken.

If this is at all helpful, you can find it here:
https://drive.google.com/file/d/0Bz505QwUGfXKdHI4YUZxeGxHaTQ/edit?usp=shari ng

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/119385
Re: Cadsoft Eagle with Python Scripting [message #156145 is a reply to message #156118] Sun, 06 July 2014 12:17 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
That's great foxx00!

Here are a couple quick tools I wrote to explore EAGLE files. The first is a short Python script that just displays the top few node levels. Save it to an executable file (add a shebang if you need it) and put the EAGLE file name on the command line:
import sys
import xml.etree.ElementTree as ET

if len(sys.argv) < 2:
  print "%s <file> - read EAGLE XML file" % sys.argv[0]
  sys.exit()

input_file = sys.argv[1]
try:
  input_string = open(input_file).read()
except:
  print "Couldn't read %s..." % input_file
  sys.exit()

try:
  tree = ET.fromstring(input_string)
except:
  print "Couldn't parse file, is this an EAGLE 6 document?"
  sys.exit()

print "%s consists of:" % input_file
for child in tree:
  print child.tag
  for grandchild in child:
    print "  ", grandchild.tag
    if grandchild.tag == "schematic" or grandchild.tag == "board":
      for greatgrandchild in grandchild:
        print "    ",  greatgrandchild.tag

I've been playing around with functional programming lately, so the second is a quick Scala (Scala is rapidly becoming my favorite language!) script that gives you node sequences for each of the main file sections, along with a couple examples of iterating through them (the filename is hard-coded in this one at the moment, sorry):
import xml.XML

val fileName  = "test.brd"
val eagleFile = XML.loadFile(fileName)

// search for drawing node, then for each child node
// length is zero if not found (e.g. you won't find a
// schematic in a board file...).  Comment out as
// desired to speed things up.
val settings  = eagleFile \ "drawing" \ "settings"
val grid      = eagleFile \ "drawing" \ "grid"
val layers    = eagleFile \ "drawing" \ "layers"
val board     = eagleFile \ "drawing" \ "board"
val schematic = eagleFile \ "drawing" \ "schematic"

print("\n\nUsing xpath to search for layers:\n\n")
for (l <- layers \ "layer" ) println(l)
println

val allLayers = (layers \\ "layer")
print("\n\nNow iterating through layers in a loop:\n\n")
allLayers.foreach{ l =>
  val layerNumber = (l \ "@number").text
  val name = (l \ "@name").text
  val visible = (l \ "@visible").text
  println(s"Layer $layerNumber, $name, is visible: $visible")
}

I've been using XML Copy Editor and Firstobject XML Editor to display and edit the files...

Regards,
Doug
Re: Cadsoft Eagle with Python Scripting [message #157568 is a reply to message #156032] Fri, 26 September 2014 00:09 Go to previous messageGo to next message
Anton Bilbaeno
Messages: 1
Registered: September 2014
Junior Member
> Doug Wellington wrote:
>
>
>
> Sorry guys, I got side-tracked with work again.  I finally figured out
> how to make the repository public:
>
>
>
> https://bitbucket.org/AnalogNotes/eagle-python
Doug,

When I click on the link (I am already logged into my Bitbucket
account), I get the following message:


h1.   You do not have access to this repository. 
Use the links at the top to get back.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/127219
Re: Cadsoft Eagle with Python Scripting [message #157597 is a reply to message #157568] Sat, 27 September 2014 02:09 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Anton,

You can find the repository at http://https://github.com/rmawatson/PyEagle

Regards,
Doug
Re: Cadsoft Eagle with Python Scripting [message #157599 is a reply to message #157597] Sat, 27 September 2014 02:16 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Sorry about that link. (Stupid iPad!) Here's another attempt: https://github.com/rmawatson/PyEagle
Re: Cadsoft Eagle with Python Scripting [message #169442 is a reply to message #150559] Fri, 17 February 2017 20:10 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
I'm curious if anyone else has been using Python (or any other language for that matter) to either make a server/client tool like this one or to directly manipulate the XML files?
Re: Cadsoft Eagle with Python Scripting [message #169444 is a reply to message #169442] Fri, 17 February 2017 21:14 Go to previous messageGo to next message
Joop_
Messages: 69
Registered: March 2007
Member
Doug Wellington wrote on Fri, 17 February 2017 21:10
I'm curious if anyone else has been using Python (or any other language for that matter) to either make a server/client tool like this one or to directly manipulate the XML files?


I know of at least one program that reads (not manipulate) directly the xml files:

http://www.teuniz.net/eagle/eaglelibcheck/
Re: Cadsoft Eagle with Python Scripting [message #169445 is a reply to message #150559] Fri, 17 February 2017 21:43 Go to previous messageGo to next message
rickb
Messages: 16
Registered: March 2016
Location: Junction City, OR USA
Junior Member
Does anyone know if this works with eagle 7.7?

Rick
Re: Cadsoft Eagle with Python Scripting [message #169453 is a reply to message #169445] Sat, 18 February 2017 00:42 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
rickb wrote on Fri, 17 February 2017 14:43
Does anyone know if this works with eagle 7.7?

Do you mean the Python scripting? I've mainly used it with version 5 and 6. I'll try to test it with version 7 this weekend...
Re: Cadsoft Eagle with Python Scripting [message #169522 is a reply to message #169453] Mon, 20 February 2017 22:47 Go to previous messageGo to next message
rickb
Messages: 16
Registered: March 2016
Location: Junction City, OR USA
Junior Member
Quote:
Do you mean the Python scripting?


Yes, thanks.

Rick
Re: Cadsoft Eagle with Python Scripting [message #169524 is a reply to message #169522] Tue, 21 February 2017 00:31 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
rickb wrote on Mon, 20 February 2017 15:47
Quote:
Do you mean the Python scripting?

Yes, thanks.

Sorry mate, I didn't get to try it out. We had a (late) Chinese New Year celebration at the Bagua school Saturday and the little lady and I spent most of Sunday out of town with family.

I'm now on the fence about how much more effort to put into the Python thing. I had started a book on advanced EAGLE use and I was including writing scripts and ULPs and how to manipulate the XML files externally. With the changes in the EAGLE world lately, part of me is angry enough to motivate me to finish up the external program that lets you directly manipulate the XML files, but the other part of me is disgusted enough to want to drop it all and just walk away. End of an era. Sigh...
Re: Cadsoft Eagle with Python Scripting [message #169525 is a reply to message #169524] Tue, 21 February 2017 02:48 Go to previous messageGo to next message
rickb
Messages: 16
Registered: March 2016
Location: Junction City, OR USA
Junior Member
I understand your frustration. I bought 7.7 before the official announcement and feel the same way. I will continue to use it until it no longer meets my needs or until Kicad meets my expectations, which ever happens first. I would like to see what you have written, however rough it may be for educational purposes.

Rick
Re: Cadsoft Eagle with Python Scripting [message #169529 is a reply to message #169525] Tue, 21 February 2017 18:17 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
rickb wrote on Mon, 20 February 2017 19:48
I understand your frustration. I bought 7.7 before the official announcement and feel the same way. I will continue to use it until it no longer meets my needs or until Kicad meets my expectations, which ever happens first.

I see that there is a python scripting API for KiCad. I'm going to work with that a bit. Also, while I'm not a huge scheme fan, gEDA does have guile scripting. In particular, this page about hierarchical blocks in gEDA looks very interesting to me: GEDA Blocks. He even uses "make" which for me as a Unix guy is very appealing!

Quote:
I would like to see what you have written, however rough it may be for educational purposes.

The general outline of the book is to talk about command line use and scripting, then how to make menu changes and key assignments, followed by a couple chapters on writing ULPs to create scripts. Then I used Python to take a look at the XML files directly. For my example code, I reimplemented my arrange and distribute ULPs in a Python script you run from the command line.

In the next chapter, I started building a graphical interface to view the files. This turned into mostly a library and BOM manipulation tool, sort of an external BOM-EX if you will. I considered using PyQt for the GUI, but the licensing didn't work for me, so at that point, I switched to using Java. I've got quite a few of the basic functions implemented, so you can open an EAGLE file, change attributes, move items, lock and unlock, save, etc. Next, I was going to render the board file and display it in 3D space so that you could fly by and see the back side. I've done this kind of thing before with POV-RAY, Sketchup, Blender, TurboCAD, and Lightwave, but it would be nice to simplify that process.

I think the last thing I'm going to do is implement some export function so that I can convert all of my current designs to KiCad or gEDA. And I have to say, the Circuit Studio deal is sounding mighty nice - for less than the cost of a year of EAGLE Premium subscription, you can get a perpetual license. At the end of the year, I'll have saved $5 and have a usable copy of Circuit Studio...
Re: Cadsoft Eagle with Python Scripting [message #169597 is a reply to message #169529] Wed, 22 February 2017 19:32 Go to previous messageGo to next message
Dietmar Schwertberger
Messages: 31
Registered: April 2011
Member
On 21.02.2017 19:17, Doug Wellington wrote:
> I considered using PyQt for the GUI, but the licensing didn't work for me, so
> at that point, I switched to using Java.
For a more liberal license, you should have considered wxPython instead.
Python seems a much more natural choice for these tasks than Java.
Also, it would allow for easier integration if you really want to
migrate to KiCad. The PCB part of KiCad has a Python console already.
I would expect the Schematic part to follow sooner or later.

Regards,

Dietmar
Re: Cadsoft Eagle with Python Scripting [message #169598 is a reply to message #169597] Wed, 22 February 2017 19:55 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Dietmar Schwertberger wrote on Wed, 22 February 2017 12:32
For a more liberal license, you should have considered wxPython instead.

Thanks, part of my issue is that I was also writing in C++ and I didn't want to have to release that source code. It's my code, I wrote it and I want to keep it private. Over the years I have grown weary of people contacting me demanding my source code, my schematic and board files, and my gerbers. It's hard to make your investment back when someone can grab your work and match or beat your time to market and undermine your pricing. Anything with GPL licensing is out for me because of that

Quote:
Python seems a much more natural choice for these tasks than Java.

For scripting, rapid prototyping and as a language to use for teaching, Python is fantastic. Because of it being interpreted though, there is no way to effectively control your IP.
Re: Cadsoft Eagle with Python Scripting [message #169601 is a reply to message #169597] Wed, 22 February 2017 20:08 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Also, switching to the Java world lets me use Groovy, Scala, Clojure, and even Jython or JRuby all together...

FWIW, the Java ecosystem is fantastic. The build, test, code analysis, continuous integration, etc., tools are great!
Re: Cadsoft Eagle with Python Scripting [message #169602 is a reply to message #169598] Wed, 22 February 2017 20:16 Go to previous messageGo to next message
Dietmar Schwertberger
Messages: 31
Registered: April 2011
Member
On 22.02.2017 20:55, Doug Wellington wrote:
> Dietmar Schwertberger wrote on Wed, 22 February 2017 12:32
> Thanks, part of my issue is that I was also writing in C++ and I didn' > want to have to release that source code. It's my code, I wrote it
and I> want to keep it private. Over the years I have grown weary of people
Put your core C++ code into a .pyd (i.e. actually a DLL).
Still you can control your code from Python, offering a scripting
interface without much effort.


> contacting me demanding my source code, my schematic and board files, and
> my gerbers. It's hard to make your investment back when someone can grab
> your work and match or beat your time to market and undermine your pricing.
> Anything with GPL licensing is out for me because of that
The wx license is not GPL. It is LGPL, but even allows to distribute
binaries on your own terms. So basically, it's not much different from
MIT, BSD or similar licenses for any practical application.


> For scripting, rapid prototyping and as a language to use for teaching,
> Python is fantastic.
It's also a great language to implement large applications, either GUI
or web based. Implementing GUIs in C++ seems to be a huge waste of
resources. The learning curve for GUIs is a bit steep, just as for C++.
For this reason I started improving the wxGlade GUI builder last year.
If you go for wx, you should have a look at the current wxGlade version
from the repository.
(Documentation update is work in progress and not yet online.)


> Because of it being interpreted though, there is no
> way to effectively control your IP.
Well, there are ways, but these are a bit complicated. I have one
application where I'm using a dongle for Python code and .pyd extensions.
But protection of the Python code requires a custom Python runtime.
For extension of other people's code, that's probably not an option.
On the other hand, don't forget that Python bytecode might be easier
to decompile, but it's also possible for C++ code. I think there are
quite powerful reverse engineering tools for compiled binaries.


Regards,

Dietmar
Re: Cadsoft Eagle with Python Scripting [message #169603 is a reply to message #169601] Wed, 22 February 2017 20:36 Go to previous messageGo to next message
Dietmar Schwertberger
Messages: 31
Registered: April 2011
Member
On 22.02.2017 21:08, Doug Wellington wrote:
> FWIW, the Java ecosystem is fantastic. The build, test, code analysis,
> continuous integration, etc., tools are great!
For things like graphics, hardware interfacing, file formats,
networking, GUIs etc. I found that development at the interpreter
console provides the biggest boost in productivity.
The only comparable language that I know, is Forth. But that one is
a bit too special for most people...

Regards,

Dietmar
Re: Cadsoft Eagle with Python Scripting [message #169604 is a reply to message #169602] Wed, 22 February 2017 20:43 Go to previous messageGo to next message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Dietmar Schwertberger wrote on Wed, 22 February 2017 13:16
Put your core C++ code into a .pyd (i.e. actually a DLL). Still you can control your code from Python, offering a scripting interface without much effort.

Yes, I use Python for the GUI and scripting, and the C++ is for the rendering and math functions (using a GPU).

Quote:
The wx license is not GPL. It is LGPL, but even allows to distribute binaries on your own terms. So basically, it's not much different from MIT, BSD or similar licenses for any practical application.

That is very nice.

Quote:
(Python is) also a great language to implement large applications, either GUI or web based.

Yes, I agree. At my "real" job during the day, I use Python and QT for large applications every day.


Quote:
If you go for wx, you should have a look at the current wxGlade version from the repository.

I will definitely look at that. Thank you...

Quote:
I think there are quite powerful reverse engineering tools for compiled binaries.

I have no illusions that a determined person would not be able to reverse engineer my work. If they wish to go through that effort, that is up to them, but since I either give my tools away for free or charge a very small amount of money, I hope it is not worth their trouble.
Re: Cadsoft Eagle with Python Scripting [message #169605 is a reply to message #169603] Wed, 22 February 2017 21:29 Go to previous message
Doug Wellington
Messages: 270
Registered: January 2010
Senior Member
Dietmar Schwertberger wrote on Wed, 22 February 2017 13:36
For things like graphics, hardware interfacing, file formats, networking, GUIs etc. I found that development at the interpreter console provides the biggest boost in productivity.

Yes! It's quite fun to use pyqt from the ipython prompt to interactively show and hide or manipulate various parts of my GUI.

You can do similar things with various JVM languages that have REPLs. For example, here's some Scala typed into the Ammonite REPL to create a popup window with a single button:

@ {
  import javax.swing._, java.awt.event._
  val frame = new JFrame("Hello World Window")

  val button = new JButton("Click Me")
  button.addActionListener(new ActionListener{
    def actionPerformed(e: ActionEvent) = button.setText("You clicked the button!")
  })
  button.setPreferredSize(new java.awt.Dimension(200, 100))
  frame.getContentPane.add(button)
  frame.pack()
  frame.setVisible(true)

  }

Previous Topic: Sneak peek: obstacle avoidance and walk around routing in EAGLE v8...
Next Topic: An alternative licensing idea
Goto Forum:
  


Current Time: Thu Aug 24 04:50:18 GMT 2017