Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread Ferrous Cranus
Document Root for me is /home/nikos/public_html Is where Apache store the user www files. How to tell it my using a variable? -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Marc Aymerich
On Thursday, January 17, 2013 1:32:25 AM UTC+1, Piet van Oostrum wrote: > Marc Aymerich writes: > > > > > Hi, > > > I've been trying very, very hard to load an RSA key using M2Crypto but > > without any success. > > > > > > basically this is what I'm trying to do: > > from M2Crypto i

Re: Importing Classes from child folders.

2013-01-17 Thread Tobias M.
On an import python looks for the module in the directories specified in sys.path. The documentation on sys.path says: "As initialized upon program startup, the first item of this list is the directory containing the script that was used to invoke the Python interpreter." [1] So it`s importa

Big girl pleasuring herself

2013-01-17 Thread Constantine
Big girl pleasuring herself http://ninelirowaytu.blogspot.com/2013/01/big-girl-pleasuring-herself.html -- http://mail.python.org/mailman/listinfo/python-list

iterating over the lines of a file - difference between Python 2.7 and 3?

2013-01-17 Thread Wolfgang Maier
I just came across an unexpected behavior in Python 3.3, which has to do with file iterators and their interplay with other methods of file/IO class methods, like readline() and tell(): Basically, I got used to the fact that it is a bad idea to mix them because the iterator would use that hidden re

Re: iterating over the lines of a file - difference between Python 2.7 and 3?

2013-01-17 Thread Peter Otten
Wolfgang Maier wrote: > I just came across an unexpected behavior in Python 3.3, which has to do > with file iterators and their interplay with other methods of file/IO > class methods, like readline() and tell(): Basically, I got used to the > fact that it is a bad idea to mix them because the it

[ANN] Salut à Toi 0.3: Python social XMPP client

2013-01-17 Thread Goffi
G'day everybody, I've released the 0.3 version of Salut à Toi, a python XMPP client, which is multi-frontends (desktop, web, console, cli). You can see a live demo on http://www.libervia.org . SàT is made using Twisted/Wokkel, and Pyjamas for the web frontend. It offers features such as microbl

Re: iterating over the lines of a file - difference between Python 2.7 and 3?

2013-01-17 Thread Terry Reedy
On 1/17/2013 7:04 AM, Peter Otten wrote: Wolfgang Maier wrote: I just came across an unexpected behavior in Python 3.3, which has to do with file iterators and their interplay with other methods of file/IO class methods, like readline() and tell(): Basically, I got used to the fact that it is a

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread rusi
On Jan 16, 6:51 pm, Ferrous Cranus wrote: > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > f = open( '../' + page ) > > How to say the same thing in an absolute way by forcing Python to detect > DocumentRoot by

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread Roy Smith
In article <339d9d6d-b000-4cf3-8534-375e0c44b...@googlegroups.com>, Ferrous Cranus wrote: > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > f = open( '../' + page ) > > How to say the same thing in an absolute

Re: SimpleAI, Artificial Intelligence with Python - [released]

2013-01-17 Thread fisadev
On Wednesday, January 16, 2013 9:38:12 PM UTC-3, alex23 wrote: > On Jan 17, 8:01 am, Elias Andrawos wrote: > > > SimpleAI is an easy to use lib implementing in python many of the > > > artificial intelligence algorithms described on the book "Artificial > > > Intelligence, a Modern Approach" >

Param decorator - can you suggest improvements

2013-01-17 Thread Mark Carter
I thought it would be interesting to try to implement Scheme SRFI 39 (Parameter objects) in Python. The idea is that you define a function that returns a default value. If you call that function with no arguments, it returns the current default. If you call it with an argument, it resets the de

python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Utpal Sarkar
Hi, I was assuming that sys.stdout would be referencing the same physical stream as iostreams::cout running in the same process, but this doesn't seem to be the case. The following code, which makes a call to a C++ function with a python wrapper called "write", that writes to cout: from cStrin

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread Joel Goldstick
On Thu, Jan 17, 2013 at 9:09 AM, Roy Smith wrote: > In article <339d9d6d-b000-4cf3-8534-375e0c44b...@googlegroups.com>, > Ferrous Cranus wrote: > > > When trying to open an html template within Python script i use a > relative > > path to say go one folder back and open index.html > > > > f = o

Re: Param decorator - can you suggest improvements

2013-01-17 Thread Steven D'Aprano
On Thu, 17 Jan 2013 06:35:29 -0800, Mark Carter wrote: > I thought it would be interesting to try to implement Scheme SRFI 39 > (Parameter objects) in Python. > > The idea is that you define a function that returns a default value. If > you call that function with no arguments, it returns the cur

Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Leonard, Arah
Hello fellow Python programmers, I'm building a 32-bit CPython 2.7.3 distro for Windows using the MS Visual Studio Professional 2008 SP1 (and all hotfixes) MSVC 9 compiler. My build works, technically, but it also happens to benchmark over 30% slower than the precompiled binaries in the distri

Re: python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Nobody
On Thu, 17 Jan 2013 07:02:24 -0800, Utpal Sarkar wrote: > I was assuming that sys.stdout would be referencing the same physical > stream as iostreams::cout running in the same process, but this doesn't > seem to be the case. At startup, it refers to the same FILE* as C's stdout. This initially sh

Re: python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Chris Angelico
On Fri, Jan 18, 2013 at 2:02 AM, Utpal Sarkar wrote: > I was assuming that sys.stdout would be referencing the same physical stream > as iostreams::cout running in the same process, but this doesn't seem to be > the case. That's more-or-less true, but there will likely be separate buffering, so

Re: python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Utpal Sarkar
Thanks a lot Chris and Nobody! I'll have a look at dup2 for a start. > > I was assuming that sys.stdout would be referencing the same physical > > stream as iostreams::cout running in the same process, but this doesn't > > seem to be the case. > > > > That's more-or-less true, but there will

Re: python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Chris Angelico
On Fri, Jan 18, 2013 at 2:51 AM, Utpal Sarkar wrote: > Thanks a lot Chris and Nobody! I'll have a look at dup2 for a start. Okay. Look for code that redirects the standard I/O streams and then exec()s another process (possibly after fork()ing); you're going to be doing pretty much the same thing.

Re: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Terry Reedy
On 1/17/2013 10:29 AM, Leonard, Arah wrote: Hello fellow Python programmers, I’m building a 32-bit CPython 2.7.3 distro for Windows using the MS Visual Studio Professional 2008 SP1 (and all hotfixes) MSVC 9 compiler. My build works, technically, but it also happens to benchmark over 30% slower t

Re: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Stefan Krah
Leonard, Arah wrote: > I?m building a 32-bit CPython 2.7.3 distro for Windows using the MS Visual > Studio Professional 2008 SP1 (and all hotfixes) MSVC 9 compiler. My build > works, technically, but it also happens to benchmark over 30% slower than the > precompiled binaries in the distributed P

RE: iterating over the lines of a file - difference between Python 2.7 and 3?

2013-01-17 Thread Wolfgang Maier
Thanks Peter, for this very helpful reply and for pointing out _pyio.py to me! It's great to be able to check implementation details sometimes. So, if I understand you correctly, I can simply import io and open files with io.open() - instead of open and although this is a bit a detour in Python3

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Piet van Oostrum
Piet van Oostrum wrote: > Converting to X.501 isn't difficult (assuming this is a 2048 bit key): > Get rid of the 'RSA' in header and trailer > Prepend X.501 header 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A' to the data > Reformat the lines to 64 characters. This solution is a bit restricted as it only

RE: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Leonard, Arah
> I think the official binaries use the PGO build. Be sure to run all tests > thoroughly, we've had problems in with the PGO build in 3.3. Thanks Stefan. I hope that's not the case. PGO seems something of an anathema from well-documented builds. Unless I'm missing something, if PGO i

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Marc Aymerich
On Thursday, January 17, 2013 5:39:57 PM UTC+1, Piet van Oostrum wrote: > > Converting to X.501 isn't difficult (assuming this is a 2048 bit key): > > > Get rid of the 'RSA' in header and trailer > > > Prepend X.501 header 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A' to the data > > > Reformat the lines

Re: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Stefan Krah
Leonard, Arah wrote: > But after benchmarking a PGO build made by running the build_pgo.bat it > turns out that it made no difference whatsoever to my performance loss. > Within an acceptable statistical variation in the benchmark tool itself my > PGO build performed identically to my re

Re: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread donarb
On Jan 17, 7:29 am, "Leonard, Arah" wrote: > Hello fellow Python programmers, > > I'm building a 32-bit CPython 2.7.3 distro for Windows using the MS Visual > Studio Professional 2008 SP1 (and all hotfixes) MSVC 9 compiler.  My build > works, technically, but it also happens to benchmark over 30

RE: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Leonard, Arah
> I remember that some versions of Visual Studio silently completed the PGO > build without actually having PGO capabilities. :) > I think for VS 2008 at least "Professional" is needed, for VS 2010 "Ultimate". Well, that certainly sounds like Microsoft. Fortunately I'm using VS 2008 Profession

RE: iterating over the lines of a file - difference between Python 2.7 and 3?

2013-01-17 Thread Peter Otten
Wolfgang Maier wrote: > What will my IO object return then when I read from it in Python 2.7? str > where Python3 gives bytes, and unicode instead of str ? This is what I > understood from the Python 2.7 io module doc. You can always double-check in the interpreter: >>> with open("tmp.txt", "w"

ANN: A new version (0.3.2) of the Python module which wraps GnuPG has been released.

2013-01-17 Thread Vinay Sajip
A new version of the Python module which wraps GnuPG has been released. What Changed? = This is a minor enhancement and bug-fix release. See the project website ( http://code.google.com/p/python-gnupg/ ) for more information. Summary: Improved support for status messages from GnuPG. F

RE: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Leonard, Arah
>Try dumping the build configuration parameters: > > >>> import pprint, sysconfig > >>> pprint.pprint(sysconfig.get_config_vars()) > >Then you can compare the existing version with yours. I would absolutely love to be able to do that and have it work. Most unfortunately that only works on *n

Islam In Brief

2013-01-17 Thread BV BV
Islam In Brief Islam in Brief is the first part of The Fog is Lifting series of documentaries challenging your knowledge about the Islamic faith and traditions http://www.youtube.com/profile?user=IslamInBrief#g/p thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Stefan Krah
Leonard, Arah wrote: > By the way, do you happen to know how tricky it is to get Python 2.7.3 to > build with VS 2010? Or have any tips there? It doesn't seem to be > officially supported, but it sure would be nice to get out of the dark ages > of MS compilers and be only one version behind t

Have You Ever Used Evernote API?

2013-01-17 Thread Jillian
Hey Guys, Im with User Research and we're currently doing a National Research Study for Devs who have used the Evernote API. The study is just a 90 minute phone call and all participants will receive their choice of technical software, hardware, or videogames. If you're interested in particip

RE: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-17 Thread Leonard, Arah
Hello Python programmers, Here's an update on my conundrum: When compiling and building CPython 2.7.3 for Win32 from source I see a 30% performance loss from the precompiled binaries in the Python 2.7.3 MSI. Everything that I do gets the same results. I've tried a standard release bu

Warning for users of the Python and Jython wiki

2013-01-17 Thread Steven D'Aprano
Hello all, Some time recently, the wiki at http://wiki.python.org/ was hacked. The vandal who broke in deleted all the wiki data. However, it is possible that before destroying the data, he may have gained access to user passwords. If you had an account on the wiki, and use the same password e

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Piet van Oostrum
Marc Aymerich writes: > Thank you very much Piet, > I'm just starting to grasp these cryptography related concepts and your code > is helping me a lot to understand how to handle these keys in a low level. > > I'm updating my code incorporating your new contribution! > > Just to let you know, d

College Physics 9th edition by Sears, Zemansky

2013-01-17 Thread kalvinmanual1
I have solutions manuals to all problems and exercises in these textbooks. To get one in an electronic format contact me at: kalvinmanual(at)gmail(dot)com and let me know its title, author and edition. Please this service is NOT free. solutions manual :: CALCULO VECTORIAL 7th Ed. by Louis Leitho

[HELP!] a doubt about entering password in python

2013-01-17 Thread douxin
Hi all: i have some doubts in doing python programming i wanted to execute a command "su -c 'fdisk -l'",and it needed a password so i wanted to write a python script to get this done. i knew 'pexpect' would work fine,but i had to set a certain timeout to take care of the real

Re: [HELP!] a doubt about entering password in python

2013-01-17 Thread Steven D'Aprano
On Fri, 18 Jan 2013 10:49:30 +0800, douxin wrote: > i use Popen to execute "su -c 'fdisk -l'" in sub process,and > assigned subprocess.PIPE to stdin,stdout i tried to enter password > by doing "stdin.write("password"+"\n")" and i expected i could get > the output of "fdisk -l" by d

Re: Param decorator - can you suggest improvements

2013-01-17 Thread Dan Sommers
On Thu, 17 Jan 2013 15:21:08 +, Steven D'Aprano wrote: > On Thu, 17 Jan 2013 06:35:29 -0800, Mark Carter wrote: > >> I thought it would be interesting to try to implement Scheme SRFI 39 >> (Parameter objects) in Python. >> >> The idea is that you define a function that returns a default valu

Re: [HELP!] a doubt about entering password in python

2013-01-17 Thread MRAB
On 2013-01-18 03:12, Steven D'Aprano wrote: On Fri, 18 Jan 2013 10:49:30 +0800, douxin wrote: i use Popen to execute "su -c 'fdisk -l'" in sub process,and assigned subprocess.PIPE to stdin,stdout i tried to enter password by doing "stdin.write("password"+"\n")" and i expected i coul

Re: [HELP!] a doubt about entering password in python

2013-01-17 Thread Ramchandra Apte
On Friday, January 18, 2013 9:30:29 AM UTC+5:30, MRAB wrote: > On 2013-01-18 03:12, Steven D'Aprano wrote: > > > On Fri, 18 Jan 2013 10:49:30 +0800, douxin wrote: > > > > > >> i use Popen to execute "su -c 'fdisk -l'" in sub process,and > > >> assigned subprocess.PIPE to stdin,stdout i

Parent module adsite.adsiteviews.mainhanlder does not exist

2013-01-17 Thread Nick Dong
I created a django project using django 1.4.2. There is one 'app'(adsite) in this project. And It works. But when I copied some 'py' files into the 'app' folder, I got "Parent module adsite.adsiteviews.mainhanlder does not exist." Should I register the new files to __init__ in the 'app'? Did new

Re: [HELP!] a doubt about entering password in python

2013-01-17 Thread Chris Angelico
On Fri, Jan 18, 2013 at 3:45 PM, Ramchandra Apte wrote: > I think you are correct - su uses some tty magic to stop ECHO and probably > doesn't read the password from stdin. I believe that's right, but the 'sudo' command - at least on my Debian and Ubuntu systems - accepts a -S parameter to read

Re: python sys.stdout and C++ iostreams::cout

2013-01-17 Thread Lie Ryan
On 18/01/13 02:02, Utpal Sarkar wrote: Hi, I was assuming that sys.stdout would be referencing the same physical stream as iostreams::cout running in the same process, but this doesn't seem to be the case. The following code, which makes a call to a C++ function with a python wrapper called "

Re: To make a method or attribute private

2013-01-17 Thread Lie Ryan
On 17/01/13 11:34, iMath wrote: To make a method or attribute private (inaccessible from the outside), simply start its name with two underscores 《Beginning Python From Novice to Professional》 but there is another saying goes: Beginning a variable name with a single underscore indicates tha