Re: Need help with Python to C code compiler

2011-08-08 Thread Dan Stromberg
Shedskin is one option - if it doesn't have the modules you need, you could try finding pure python versions of them and translating them too, along with your own code. Cython is probably the one I hear the most about. On Mon, Aug 8, 2011 at 10:37 PM, Vijay Anantha Murthy < vijay.mur...@gmail.com

Need help with Python to C code compiler

2011-08-08 Thread Vijay Anantha Murthy
Hi All, Is there any compiler which will help me convert my python code to proper C code? In my python code I am using the XML.dom.minidom module to parse an xml and process the results obtained by ElementsByTagName. I don't know of any such compiler which will help me convert this kind of python

Re: Network shares in Windows

2011-08-08 Thread MRAB
On 09/08/2011 02:46, Nanda, Ameet wrote: Hi All, I was trying to access a network shared folder on a windows network. I couldn’ t find of a good documentation online to do that. Are there any recommendations on how to do it in windows. So if my folder is shared as \\ameetn\Dropbox and when I am

Network shares in Windows

2011-08-08 Thread Nanda, Ameet
Hi All, I was trying to access a network shared folder on a windows network. I couldn' t find of a good documentation online to do that. Are there any recommendations on how to do it in windows. So if my folder is shared as \\ameetn\Dropbox and when I am trying to open it up, it says I don't h

Re: Docstrings and class Attributes

2011-08-08 Thread Ben Finney
Steven D'Aprano writes: > Ben Finney wrote: > > > They're an accident of the history that led to their implementation, > > and of the pre-existing parts that they're built from. There doesn't > > need to be a point to them (though they might be useful for reasons > > incidental for the reasons th

Re: Docstrings and class Attributes

2011-08-08 Thread Steven D'Aprano
Ben Finney wrote: > Ethan Furman writes: > >> So if property docstrings are so hard to get to, what's the point in >> having them? > > Why would you expect there be a special point to them? > > Men, like all primates of any sex, have nipples. > > Properties, like any function in Python, have

Re: Docstrings and class Attributes

2011-08-08 Thread Ben Finney
Ethan Furman writes: > So if property docstrings are so hard to get to, what's the point in > having them? Why would you expect there be a special point to them? Men, like all primates of any sex, have nipples. Properties, like any function in Python, have docstrings. They're an accident of t

Re: Object Diffs

2011-08-08 Thread Steven D'Aprano
Croepha wrote: > Hello Python list: > > I am doing research into doing network based propagation of python > objects. In order to maintain network efficiency. I wan't to just > send the differences of python objects, Can you explain in more detail what you mean? Are there constraints on what t

Re: Object Diffs

2011-08-08 Thread Chris Angelico
On Tue, Aug 9, 2011 at 1:23 AM, Terry Reedy wrote: > I have no idea how stable and local pickles are, but I know they were not > designed for diff-ing. Json or yaml representations might do better if > applicable. > In terms of stability, you'd probably have to have a rule that dictionaries are s

Re: Object Diffs

2011-08-08 Thread python
Croepha, You may find it simpler and sufficiently efficient to compress your objects in whatever format they exist (pickle, json, xml, etc) and send the compressed equivalents vs. trying to diff on side and reassemble on the other side. Malcolm -- http://mail.python.org/mailman/listinfo/python-l

Re: Object Diffs

2011-08-08 Thread Terry Reedy
On 8/8/2011 3:50 PM, Croepha wrote: Hello Python list: Hi I am doing research into doing network based propagation of python objects.In order to maintain network efficiency. I want to just send the differences of python objects, I was wondering if there was/is any other research or developmen

Re: Object Diffs

2011-08-08 Thread Dan Stromberg
You probably need a recursive algorithm to be fully general, and yes, looking at pickle might be a good place to start. Note that pickle can't pickle everything, but it can handle most things. Also check out NX - not the CPU feature, but the (re)transmission compressing software (there are two di

Re: Object Diffs

2011-08-08 Thread Chris Angelico
On Mon, Aug 8, 2011 at 8:50 PM, Croepha wrote: > I am doing research into doing network based propagation of python > objects.  In order to maintain network efficiency. I wan't to just > send the differences of python objects You could send pickled versions of each of the object's attributes, rat

Object Diffs

2011-08-08 Thread Croepha
Hello Python list: I am doing research into doing network based propagation of python objects. In order to maintain network efficiency. I wan't to just send the differences of python objects, I was wondering if there was/is any other research or development in this area? I was thinking that I cou

Re: Docstrings and class Attributes

2011-08-08 Thread Eric Snow
On Mon, Aug 8, 2011 at 1:05 PM, Steven D'Aprano wrote: > Ethan Furman wrote: > >> So if property docstrings are so hard to get to, what's the point in >> having them? > > Hard to get, not impossible. But I have no idea really -- they don't seem > very useful to me. They do show up in help(), but

Re: Docstrings and class Attributes

2011-08-08 Thread Chris Kaynor
They are actually quite easy to get to. help() on both the class or instance produces the docstring, and __doc__ on the property as accessed from the class produces the docstring. >>> class Test(object): ... @property ... def fred(self): ... """*This is a docstring.*""" ...

Re: smtp

2011-08-08 Thread Terry Reedy
On 8/8/2011 12:45 PM, Verde Denim wrote: I'm running 2.6.5 on a debian base... It didn't seem to matter what is input - I tried using a single recipient as well as multiples (separated by comma). Output appears as - # python send_my_msg.py From: m...@me.com To: y...@you.com

Re: smtp

2011-08-08 Thread Terry Reedy
On 8/8/2011 12:08 PM, Verde Denim wrote: I'm working on learning various aspects of Py coding, and happened to review the smtplib docs this morning. I entered the sample code from http://www.python.org/doc//current/library/smtplib.html When posting about error messages, please specify Python ve

Re: Docstrings and class Attributes

2011-08-08 Thread Steven D'Aprano
Ethan Furman wrote: > So if property docstrings are so hard to get to, what's the point in > having them? Hard to get, not impossible. But I have no idea really -- they don't seem very useful to me. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: smtp

2011-08-08 Thread Terry Reedy
On 8/8/2011 12:26 PM, Chris Angelico wrote: As a side point: Does anyone else feel that it's potentially confusing to have a function whose parameter has the same name as the function itself? This is straight from the example. Yes. I might change it someday when I can. -- Terry Jan Reedy --

Re: Docstrings and class Attributes

2011-08-08 Thread Terry Reedy
On 8/8/2011 2:26 PM, Steven D'Aprano wrote: Eric Snow wrote: On Mon, Aug 8, 2011 at 6:37 AM, Nick wrote: Is it possible to put a doc string on a class attribute? This really makes little sense. The purpose of docstrings is to give interactive help. The place to document data attributes of

Re: Docstrings and class Attributes

2011-08-08 Thread Ethan Furman
Steven D'Aprano wrote: Eric Snow wrote: On Mon, Aug 8, 2011 at 6:37 AM, Nick wrote: Is it possible to put a doc string on a class attribute? Something like this You can put a docstring on a property (which is a function): class Test(object): @property def fred(self): "attrib

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Terry Reedy
On 8/8/2011 11:17 AM, Francis Labarre wrote: Hello everyone, I'm currentlytrying to port some embedded code from python 2.7 to python 3.2. The current code replicate the basic behavior of the python interpreter in an MFC application. When a command is entered in our embedded interpreter, we wri

Re: Docstrings and class Attributes

2011-08-08 Thread Steven D'Aprano
Nick wrote: > Is it possible to put a doc string on a class attribute? Something > like this > > class Test (object): > '''classx''' > fred = 10 > '''attribute''' The short answer is, no. The longer answer is, maybe, if you can make Test.fred be some sort of object with a docstring

Re: Docstrings and class Attributes

2011-08-08 Thread Steven D'Aprano
Eric Snow wrote: > On Mon, Aug 8, 2011 at 6:37 AM, Nick wrote: >> Is it possible to put a doc string on a class attribute? Something >> like this > > You can put a docstring on a property (which is a function): > > class Test(object): > @property > def fred(self): > "attribute"

Re: Docstrings and class Attributes

2011-08-08 Thread Terry Reedy
On 8/8/2011 8:37 AM, Nick wrote: Is it possible to put a doc string on a class attribute? Class and function docstrings are generated from string expression statements at the beginning of a suite. class Test (object): '''classx''' fred = 10 '''attribute''' This is two stat

Re: smtp

2011-08-08 Thread Hegedüs , Ervin
hello, > > import smtplib > def prompt(prompt): > return raw_input(prompt).strip() > fromaddr = prompt("From: ")toaddrs = prompt("To: ").split()print > "Enter message, end with ^D (Unix) or ^Z (Windows):" > # Add the From: and To: headers at the start!msg = ("From: %s\r\nTo: > %s\r\n\r\n" >

RE: Embedded python console and FILE* in python 3.2

2011-08-08 Thread F L
> If you use the same workflow as you do currently, it won't You're right it shouldn't cause a blocking call. > Come to think of it, you might as well just use StringIO. Yes I could probably replace std{in, out, err} with stringIO objects and retrieve their contents throughthe api. I'll look into

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Thomas Jollans
On 08/08/11 19:44, Thomas Jollans wrote: > If you use the same workflow as you do currently, it won't: > > 1. Feed input to your custom stdin object, which will buffer the code. > 2. Call PyRun_IteractiveOne - it will read from your object, which will >return the buffer contents. > 3. The resu

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Thomas Jollans
On 08/08/11 19:14, F L wrote: >> Is the `code` module (http://docs.python.org/library/code.html) an > insufficiently exact copy of an interpreter for you? > > The problem isn't really to emulate the behavior of the interpreter as > to obtain the result of the execution as a string in c++. > The c

PyCon US 2012 Survey - We need your input!

2011-08-08 Thread Brian Curtin
Hi all, As we ramp up our efforts on PyCon US 2012, we wanted to gather some information from the community on what we can do best to serve you at the March 2012 conference in Santa Clara, CA. We've put together a survey about your experiences at past PyCons as well as what your interests are in t

RE: Embedded python console and FILE* in python 3.2

2011-08-08 Thread F L
> Is the `code` module (http://docs.python.org/library/code.html) an > insufficiently exact copy of an interpreter for you? The problem isn't really to emulate the behavior of the interpreter as to obtain the result of the execution as a string in c++. The code module doesn't seem to help with

Re: smtp

2011-08-08 Thread Chris Angelico
On Mon, Aug 8, 2011 at 5:45 PM, Verde Denim wrote: > I'm running 2.6.5 on a debian base... > It didn't seem to matter what is input - > I tried using a single recipient as well as multiples (separated by comma). Since the recipient list is divided using split(), you should separate multiple addre

Re: smtp

2011-08-08 Thread Verde Denim
On Mon, Aug 8, 2011 at 12:26 PM, Chris Angelico wrote: > On Mon, Aug 8, 2011 at 5:08 PM, Verde Denim wrote: > > and it returns - > > "TypeError" with no other information... > > It appears to be generated from the line > > > > msg = ("From: %s\r\nTo: %s\r\n\r\n" > >% (fromaddr, ", ".join

Re: Docstrings and class Attributes

2011-08-08 Thread Eric Snow
On Mon, Aug 8, 2011 at 6:37 AM, Nick wrote: > Is it possible to put a doc string on a class attribute? Something > like this You can put a docstring on a property (which is a function): class Test(object): @property def fred(self): "attribute" return 10 Python syntax sup

Re: smtp

2011-08-08 Thread Chris Angelico
On Mon, Aug 8, 2011 at 5:08 PM, Verde Denim wrote: > and it returns - > "TypeError" with no other information... > It appears to be generated from the line > > msg = ("From: %s\r\nTo: %s\r\n\r\n" >% (fromaddr, ", ".join(toaddrs))) > > But I'm not sure why... > I transcribed pieces manuall

smtp

2011-08-08 Thread Verde Denim
I'm working on learning various aspects of Py coding, and happened to review the smtplib docs this morning. I entered the sample code from http://www.python.org/doc//current/library/smtplib.html import smtplib def prompt(prompt): return raw_input(prompt).strip() fromaddr = prompt("From: ")toad

Re: WxPython and TK

2011-08-08 Thread Philip Semanchuk
On Aug 7, 2011, at 8:26 PM, azrael wrote: > Today I found a quote from Guido. > > wxPython is the best and most mature cross-platform GUI toolkit, given a > number of constraints. The only reason wxPython isn't the standard Python GUI > toolkit is that Tkinter was there first. > -- Guido van R

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Katriel Cohn-Gordon
Is the `code` module (http://docs.python.org/library/code.html) an insufficiently exact copy of an interpreter for you? On Mon, Aug 8, 2011 at 4:17 PM, Francis Labarre wrote: > Hello everyone, > > I'm currently trying to port some embedded code from python 2.7 to python > 3.2. > > The current co

Re: Embedded python console and FILE* in python 3.2

2011-08-08 Thread Thomas Jollans
On 08/08/11 17:17, Francis Labarre wrote: > Hello everyone, > > I'm currently trying to port some embedded code from python 2.7 to > python 3.2. > > The current code replicate the basic behavior of the python interpreter > in an > MFC application. When a command is entered in our embedded interpr

Embedded python console and FILE* in python 3.2

2011-08-08 Thread Francis Labarre
Hello everyone, I'm currently trying to port some embedded code from python 2.7 to python 3.2. The current code replicate the basic behavior of the python interpreter in anMFC application. When a command is entered in our embedded interpreter, we write it to a FILE* then transform this FILE* int

SQLObject 1.1.2

2011-08-08 Thread Oleg Broytman
Hello! I'm pleased to announce version 1.1.2, a bugfix release of branch 1.1 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use

Docstrings and class Attributes

2011-08-08 Thread Nick
Is it possible to put a doc string on a class attribute? Something like this class Test (object): '''classx''' fred = 10 '''attribute''' print Test.__doc__ print Test.fred.__doc__ This code produces this output classx int(x[, base]) -> integer Convert a string or number to an inte

PyPDF Processing Errors (ValueError: invalid literal for int() with base 16: '\x00\x00')

2011-08-08 Thread blivori
I am trying to create a Python script using the PyPDF Module. What the script does it take the 'Root' folder, merges all the PDFs in it and outputs the merged PDF in an 'Output' folder and renames it to 'Root.pdf' (the folder which containes the split PDFs). What it does then is do the same with t

Re: WxPython and TK

2011-08-08 Thread python
Azrael, > Isn't it maybe time to throw out TK once and for all? Python is missing one > of the most important aspects of todays IT industry. GUI development native > library (I mean a serious one). Check out enhancements to Tk like Ttk included in Python 2.7 and 3.1 and above. http://www.tkdocs

Re: Wait for a keypress before continuing?

2011-08-08 Thread Gelonida N
On 08/08/2011 04:44 AM, John Doe wrote: > Steven D'Aprano wrote: > >> Also, are you using an IDE? If so, it could very well be >> interfering with the keyboard buffer > > I really don't know how to answer your question. I am using > Windows XP SP3. Komodo Edit 6 for editing the *.py file. Dr

Re: Segmentation Fault on exit

2011-08-08 Thread Ulrich Eckhardt
Vipul Raheja wrote: > I have wrapped a library from C++ to Python using SWIG. But when I > import it in Python, I am able to work fine with it, but it gives a > segmentation fault while exiting. 1. Use a debugger Run python with "gdb python", import the module and exit. The debugger should then s

Re: WxPython and TK

2011-08-08 Thread ln4
azrael wrote: > Today I found a quote from Guido. > > wxPython is the best and most mature cross-platform GUI toolkit, given a > number of constraints. The only reason wxPython isn't the standard Python > GUI toolkit is that Tkinter was there first. -- Guido van Rossum > > OK, now. Isn't it mayb

Re: Hardlink sub-directories and files

2011-08-08 Thread Alexander Gattin
Hello, On Tue, Aug 02, 2011 at 02:32:54AM -0700, loial wrote: > This works fine for files, but the directory > also contains sub- directories (which themselves > contain files and sub-directories). However I > do not think it is possible to hard link > directories ? On some Unices it is, as I he