can't find socket.ssl() on win32

2005-12-07 Thread ds
i'm running under win2k trying to implement an ssl socket, and keep 
getting the error
File "C:\Code\Python\ssl\NewsSrc.py", line 67, in connect
 ssl = socket.ssl(sock, None, None)
AttributeError: 'module' object has no attribute 'ssl'
i'm running this under ActiveState version 2.2.2, but i have also tried 
under ActiveState version 2.3 anyone have any ideas?

thanks in advance.
-- 
http://mail.python.org/mailman/listinfo/python-list


Licensing

2008-03-29 Thread DS
I'm pretty sure this is the wrong place to ask, but I'm hoping someone 
will point me in the right direction.

I'm getting ready to publish a first open-source project written in 
python.  I am planning to use GPLas the license.  However, in my code, 
there is a function that I like from Python Cookbook.  I would like to 
use it, although I could certainly write a less elegant version that 
would do the same thing.

So, my options appear to be:
1.   Don't use it.
2.   Use it with no comment -- that doesn't seem right.
3.   Use it with remarks in the code that acknowledge the source.
4.   Provide a separate licensing page for that function
   along with the GPL for my code.

What is the appropriate course of action here?  I'm thinking #3 is 
probably ok.  How do others deal with this in an honorable way?  In the 
book, it appears that they are saying they don't really care unless 
there is some massive use.

Thanks



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Licensing

2008-03-29 Thread DS
Scott David Daniels wrote:
> DS wrote:
>   
>> I'm getting ready to publish a first open-source project written in 
>> python.  I am planning to use GPL as the license.  However, in my code, 
>> there is a function that I like from Python Cookbook
>> So, my options appear to be:
>> 1.   Don't use it.
>> 2.   Use it with no comment -- that doesn't seem right.
>> 3.   Use it with remarks in the code that acknowledge the source.
>> 
> I vote for this.  If you got it of the web site, include a url.  If you
> went for the book, I'd prefer crediting both, but at least give enough
> so the interested reader can get back to some version of "the original."
>
>   
>> 4.   Provide a separate licensing page for that function
>>   along with the GPL for my code.
>> What is the appropriate course of action here?  I'm thinking #3 is 
>> probably ok.  How do others deal with this in an honorable way?
>> 
> As the author of several of those recipes, I definitely expect others
> to use them.  I'd hate to slow them up by requiring them to ask
> permission, but would appreciate an acknowledgment.
>
> -Scott David Daniels
> [EMAIL PROTECTED]
>   

Thanks for your perspective. I'll do both.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Licensing

2008-03-30 Thread DS
Paul Boddie wrote:
> On 29 Mar, 20:24, DS <[EMAIL PROTECTED]> wrote:
>   
>> I'm pretty sure this is the wrong place to ask, but I'm hoping someone
>> will point me in the right direction.
>>
>> I'm getting ready to publish a first open-source project written in
>> python.  I am planning to use GPLas the license.  However, in my code,
>> there is a function that I like from Python Cookbook.  I would like to
>> use it, although I could certainly write a less elegant version that
>> would do the same thing.
>> 
>
> Note that the Python Cookbook says this about licensing: "Except where
> otherwise noted, recipes in the Python Cookbook are published under
> the Python license." The link is incorrect, but I presume they mean
> this licence:
>
> http://www.python.org/psf/license/
>
> It's generally not recommended to use this licence for anything other
> than Python because it mentions the need to reproduce the Python
> copyright statement in derived works, which would be nonsense for
> anything which isn't the Python distribution. However, one can infer
> that the copyright notice specific to the software concerned should be
> reproduced, and this is what the original CWI licence says.
>
> Of course, if a different licence is mentioned on the specific recipe
> you're using, you have to observe the terms mentioned in that licence
> instead.
>
>   
>> So, my options appear to be:
>> 1.   Don't use it.
>> 2.   Use it with no comment -- that doesn't seem right.
>> 3.   Use it with remarks in the code that acknowledge the source.
>> 4.   Provide a separate licensing page for that function
>>along with the GPL for my code.
>>
>> What is the appropriate course of action here?  I'm thinking #3 is
>> probably ok.  How do others deal with this in an honorable way?  In the
>> book, it appears that they are saying they don't really care unless
>> there is some massive use.
>> 
>
> You just need to do what's necessary to satisfy the licence applied to
> the code you're using. If that's the Python licence, I would imagine
> that reproducing the copyright statement and licence details would be
> sufficient, even if your own work is GPL-licensed.
>
> What I've done when I've released work which incorporates other work
> (itself available under a permissive licence) is to include the
> copyright statements and the licence text for that other work, but
> I've made it clear in the licensing information that the derived work
> (my code incorporating the other code) is available under the specific
> licence I've chosen, noting that the other work was made available
> under a different licence.
>
> So I suppose that #4 is the closest, but you should be able to assert
> that the entire work is GPL-licensed unless the recipe isn't licensed
> in a GPL-compatible way, which would open up a range of other issues
> that you hopefully won't have to deal with. ;-)
>
> Paul
>
> P.S. This isn't anything close to legal advice, so please take other
> opinions into account. ;-)
>   
Thanks for taking the time to write.  I was also wondering about what 
ramifications there are from mixing code from other licenses.  So, I 
guess if I was going to do it, I'd have a second license file for this 
specific function with the license for it.  I definitely don't want to 
be in a situation where credit for someone else's work is not adequately 
documented.  It has happened to me, I know how I felt about it at the time.

At this point, I'm thinking that it is not worth messing with.  What I 
am going to do is write a separate function to accomplish the same 
thing.  It's only a few lines long. Of course, having seen the other 
code I'm forever tainted...

There is something a little humorous about reading through the Python 
Cookbook.  You have submissions from all these incredibly smart people 
with little gems of functions.  But, if you actually use them, it's kind 
of a hassle.  On the other hand, I'm glad the book exists, and my memory 
of the specific details of a function fade over time, but it has/does 
give my a better understanding in general of how do things.

Thanks again.

-- 
http://mail.python.org/mailman/listinfo/python-list


How to create an Excel app that runs Python?

2020-03-24 Thread farayao . ds
I have the following scenario:

I have created lots of python files that I use to calculate a Cashflow model, 
when I run these files I get a beautiful pandas DataFrame that contains my 
final model. My mission is to show this table to the rest of the company in a 
friendly format ("Excel") and they need to be able to generate this table 
themselves from Excel, using the Python script I created ("the idea is that 
they open an excel file that has some type of dashboard and a form that they 
need to fill in, once they fill it in and press "Go" or "Run" or something like 
that, these parameters will be sent to the Python script to generate this final 
pandas DataFrame. Finally this DataFrame needs to be displayed/pasted in the 
Excel sheet that they initially opened)


The problems:

The company needs to be able to run this model, but the users, apart from me, 
use Excel and they can't open up a Jupyter notebook or VSC to run the code. 
They can't even install Python on their machines (or at least that is not ideal)


My Attempts:

I am currently using "xlwings" to run Python within Excel, although it requires 
that the user has Python and xlwings installed and has added the xlwings 
"Addin", which is not an ideal solution at all.

I am thinking about using Dash, I don't know if it is what I need since I 
haven't looked into it that much yet (I have been trying to make it work on 
xlwings first)



If you have any suggestions on how to do this, I would really appreciate that.

Thank you
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create an Excel app that runs Python?

2020-03-25 Thread farayao . ds
On Tuesday, 24 March 2020 17:38:11 UTC, Paolo G. Cantore  wrote:
> On Tue, Mar 24, 2020, 4:45 PM  wrote:
> 
> > I have the following scenario:
> >
> > I have created lots of python files that I use to calculate a Cashflow
> > model, when I run these files I get a beautiful pandas DataFrame that
> > contains my final model. My mission is to show this table to the rest of
> > the company in a friendly format ("Excel") and they need to be able to
> > generate this table themselves from Excel, using the Python script I
> > created ("the idea is that they open an excel file that has some type of
> > dashboard and a form that they need to fill in, once they fill it in and
> > press "Go" or "Run" or something like that, these parameters will be sent
> > to the Python script to generate this final pandas DataFrame. Finally this
> > DataFrame needs to be displayed/pasted in the Excel sheet that they
> > initially opened)
> >
> >
> > The problems:
> >
> > The company needs to be able to run this model, but the users, apart from
> > me, use Excel and they can't open up a Jupyter notebook or VSC to run the
> > code. They can't even install Python on their machines (or at least that is
> > not ideal)
> >
> >
> > My Attempts:
> >
> > I am currently using "xlwings" to run Python within Excel, although it
> > requires that the user has Python and xlwings installed and has added the
> > xlwings "Addin", which is not an ideal solution at all.
> >
> > I am thinking about using Dash, I don't know if it is what I need since I
> > haven't looked into it that much yet (I have been trying to make it work on
> > xlwings first)
> >
> >
> >
> > If you have any suggestions on how to do this, I would really appreciate
> > that.
> >
> > Thank you
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> The scenario you describe should be fulfilled by a web application.
> 
> I'm sure your users are also able to use a browser, not only Excel.
> 
> The HTML forms management offers the GUI capabilities to enter the 
> parameters. The processing steps could be as follows:
> 
> 1. Enter the url for the application in question and display the form.
> 2. Enter the needed data in the form.
> 3. Process the data (with lots of your python scripts) and show the 
> result in the browser.
> 4. If all is ok, download the data sheet in Excel format (using 
> DataFrame.to_excel)

Hello Paolo,

Thanks for your reply, indeed now I'm thinking on building a web app, do you 
have any suggestions for this? I am thinking of using Tkinter, the method that 
you describe using HTML is also using Javascript?

Kind Regards
Felipe
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create an Excel app that runs Python?

2020-03-25 Thread farayao . ds
On Tuesday, 24 March 2020 16:12:00 UTC, Souvik Dutta  wrote:
> You might try pyqt5 if you want to make a custom GUI and also if you have
> tha time to do so.
> 
> On Tue, Mar 24, 2020, 4:45 PM  wrote:
> 
> > I have the following scenario:
> >
> > I have created lots of python files that I use to calculate a Cashflow
> > model, when I run these files I get a beautiful pandas DataFrame that
> > contains my final model. My mission is to show this table to the rest of
> > the company in a friendly format ("Excel") and they need to be able to
> > generate this table themselves from Excel, using the Python script I
> > created ("the idea is that they open an excel file that has some type of
> > dashboard and a form that they need to fill in, once they fill it in and
> > press "Go" or "Run" or something like that, these parameters will be sent
> > to the Python script to generate this final pandas DataFrame. Finally this
> > DataFrame needs to be displayed/pasted in the Excel sheet that they
> > initially opened)
> >
> >
> > The problems:
> >
> > The company needs to be able to run this model, but the users, apart from
> > me, use Excel and they can't open up a Jupyter notebook or VSC to run the
> > code. They can't even install Python on their machines (or at least that is
> > not ideal)
> >
> >
> > My Attempts:
> >
> > I am currently using "xlwings" to run Python within Excel, although it
> > requires that the user has Python and xlwings installed and has added the
> > xlwings "Addin", which is not an ideal solution at all.
> >
> > I am thinking about using Dash, I don't know if it is what I need since I
> > haven't looked into it that much yet (I have been trying to make it work on
> > xlwings first)
> >
> >
> >
> > If you have any suggestions on how to do this, I would really appreciate
> > that.
> >
> > Thank you
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >

Thank Souvik,

I will check that library out, anything special about that library in 
particular?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create an Excel app that runs Python?

2020-03-25 Thread farayao . ds
On Wednesday, 25 March 2020 12:13:58 UTC, Gisle Vanem  wrote:
> Grant Edwards wrote:
> 
> > On 2020-03-24, oliver  wrote:
> > 
> >> Use the win32com library to interact with Excel via COM.
> > 
> > Huh?  I thought that the users have no way of running a local Python
> > app.
> 
> Maybe creating a self-contained .exe using PyInstaller?
> For me, this:
>pyinstaller.exe --noconfirm --console --onefile file.py
> 
> creates a 'dist/file.exe' that depend on nothing but
> system libraries. But it's 5 MByte though.
> 
> 
> -- 
> --gv

Hello Gisle,

Thanks for your answer. To do this I assume that first I need to create an app 
with Tkinter or can I just do this .exe simply with the multiple files I 
already have?

Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create an Excel app that runs Python?

2020-03-25 Thread farayao . ds
On Tuesday, 24 March 2020 16:26:53 UTC, oliver  wrote:
> Use the win32com library to interact with Excel via COM. Although the
> learning curve is a little steeper it's not too bad and works great. I used
> this technique to control ARENA with Python through its COM API to run a
> whack of simulations (1000-1), then used python to gather the results,
> and used win32com from python to finally inject the data into Excel and get
> it to generate charts and tables that could be used by stakeholders without
> access to python.
> 
> Oliver Schoenborn
>   || Cloud Application Engineer, Owner || Sentian Cloud Computing Inc.
>   || Ottawa, ON, Canada || +1-613-552-4466 (mobile)
>   || [email protected]
> 
> 
> 
> 
> On Tue, Mar 24, 2020 at 7:16 AM  wrote:
> 
> > I have the following scenario:
> >
> > I have created lots of python files that I use to calculate a Cashflow
> > model, when I run these files I get a beautiful pandas DataFrame that
> > contains my final model. My mission is to show this table to the rest of
> > the company in a friendly format ("Excel") and they need to be able to
> > generate this table themselves from Excel, using the Python script I
> > created ("the idea is that they open an excel file that has some type of
> > dashboard and a form that they need to fill in, once they fill it in and
> > press "Go" or "Run" or something like that, these parameters will be sent
> > to the Python script to generate this final pandas DataFrame. Finally this
> > DataFrame needs to be displayed/pasted in the Excel sheet that they
> > initially opened)
> >
> >
> > The problems:
> >
> > The company needs to be able to run this model, but the users, apart from
> > me, use Excel and they can't open up a Jupyter notebook or VSC to run the
> > code. They can't even install Python on their machines (or at least that is
> > not ideal)
> >
> >
> > My Attempts:
> >
> > I am currently using "xlwings" to run Python within Excel, although it
> > requires that the user has Python and xlwings installed and has added the
> > xlwings "Addin", which is not an ideal solution at all.
> >
> > I am thinking about using Dash, I don't know if it is what I need since I
> > haven't looked into it that much yet (I have been trying to make it work on
> > xlwings first)
> >
> >
> >
> > If you have any suggestions on how to do this, I would really appreciate
> > that.
> >
> > Thank you
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >

Hello Oliver,

Thank for your answer, it sounds like a very sophisticated method, which is 
good, although I don't know what you mean when you refer to COM. What is good 
about the win32com library in particular?

Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list