[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread Gilles Duboscq
Gilles Duboscq added the comment: Thanks Victor we'll look into moving away from this pattern. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread Gilles Duboscq
Gilles Duboscq added the comment: I get '0' so it was not built with HAVE_GETHOSTBYNAME_R. -- ___ Python tracker <https://bugs.python.org/issue39853> ___ ___

[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread Gilles Duboscq
Gilles Duboscq added the comment: I'm not sure it's the same but we have seen stack traces looking like the one there: https://github.com/astropy/astropy/issues/9699 Current thread 0x7fffa857e3c0 (most recent call first): File "/sw/lib/python3.7/socket.py", line 748 in g

[issue18319] gettext() cannot find translations with plural forms

2020-05-07 Thread Gilles Bassière
Gilles Bassière added the comment: Hi there, I worked on a patch for this issue (see attached pull request). I would be happy to discuss it with people involved in gettext module maintenance but I'm not sure how to contact them. Is there a dedicated mailing list or an IRC channel

[issue18319] gettext() cannot find translations with plural forms

2020-05-01 Thread Gilles Bassière
Change by Gilles Bassière : -- nosy: +Gilles Bassière versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue18319> ___ ___ Python-bugs-list mailin

[issue39539] Improve Keccak support in hashlib including KangarooTwelve

2020-02-03 Thread Gilles Van Assche
New submission from Gilles Van Assche : Dear all, I think it would be nice if hashlib would include the support of Keccak with a chosen suffix, as well as the fast instance KangarooTwelve (K12). 1) Currently, hashlib's interface for Keccak only supports the 6 instances of FIPS 202 (SHA3

[issue37930] make fails when compiling Python 2.6 from source (posixmodule.c)

2019-10-21 Thread Gilles Bardoux
Gilles Bardoux added the comment: Hi Oguz, You just need to change one line in Include/objimpl.h: replace "long double dummy" by "double dummy". Enjoy! --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -248,7 +248,7 @@ typedef union _gc_head { uni

Parsing multipart HTTP response

2015-08-03 Thread Gilles Lenfant
. -- Gilles Lenfant -- https://mail.python.org/mailman/listinfo/python-list

Re: Parsing multipart HTTP response

2015-08-03 Thread Gilles Lenfant
Le lundi 3 août 2015 17:01:40 UTC+2, Gilles Lenfant a écrit : Hi, I searched without succeeding a Python resource that is capable of parsing an HTTP multipart/mixed response stream, preferably as a generator that yields headers + content for each part. Google and friends didn't find

Re: Parsing multipart HTTP response

2015-08-03 Thread Gilles Lenfant
Le lundi 3 août 2015 17:39:57 UTC+2, Mark Lawrence a écrit : On 03/08/2015 16:01, Gilles Lenfant wrote: Hi, I searched without succeeding a Python resource that is capable of parsing an HTTP multipart/mixed response stream, preferably as a generator that yields headers + content

Stopping a wsgiref server programmatically

2014-01-14 Thread Gilles Lenfant
://gist.github.com/glenfant/7369894#file-pipetestserver-py-L173 ). Is there a volunteer with a Windows box for helping me to get it fixed. Note: I have no windows box to experiment alternate. Many thanks by advance. -- Gilles Lenfant -- https://mail.python.org/mailman/listinfo/python-list

Re: Skipping decorators in unit tests

2013-10-11 Thread Gilles Lenfant
by 3rd party tools Cheers and thanks again for taking time to help me. -- Gilles Lenfant -- https://mail.python.org/mailman/listinfo/python-list

Skipping decorators in unit tests

2013-10-10 Thread Gilles Lenfant
stuffs in my target tested modules. Can someone point out good practices or dedicated tools that remove temporarily the decorations. I pasted a small example of what I heed at http://pastebin.com/20CmHQ7Y Many thanks in advance -- Gilles Lenfant -- https://mail.python.org/mailman/listinfo/python

Re: [GUI] Good frameworks for Windows/Mac?

2013-08-08 Thread Gilles
On Thu, 8 Aug 2013 01:47:21 -0700 (PDT), sagar varule sagar.var...@gmail.com wrote: Pyside is also Good. It has a Designer which can be helpful. Thanks for the info. -- http://mail.python.org/mailman/listinfo/python-list

[ActivePython] Add Qt/PyQt and wxWidgets/wxPython?

2013-08-08 Thread Gilles
Hello I upgraded to ActivePython 2.7.2.5, and would like to get started learning about Qt and wxWidgets in Python. I have a couple of question: 1. Are there obvious reasons to choose either QT/PyQt or wxWidgets/wxPython? I have the impression that Qt is a richer GUI than wxWidgets, but it could

Re: Source code to identify user through browser?

2013-08-06 Thread Gilles
On Wed, 05 Jun 2013 15:08:54 +0200, Gilles nos...@nospam.com wrote: I was wondering if some Python module were available to identify a user through their browser, like it's done on the Panopticlick site: http://panopticlick.eff.org/ It appears that flash cookies is a better solution to keep most

[GUI] Good frameworks for Windows/Mac?

2013-08-06 Thread Gilles
Hello I need to write a small GUI application that should run on Windows and Mac. What open-source framework would you recommend? I just need basic widgets (button, listbox, etc.) and would rather a solution that can get me up and running fast. I know about wxWidgets and Qt: Are there other

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-08-06 Thread Gilles
On Sat, 3 Aug 2013 06:47:07 -0500 (CDT), Wayne Werner wa...@waynewerner.com wrote: Have you checked Kenneth Rietz's inbox.py[1]? It's fairly simple to use/extend and might fit your modest needs. -W [1]:https://crate.io/packages/inbox/ Thanks. I'll check it out. --

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-08-06 Thread Gilles
On Sat, 03 Aug 2013 21:41:16 -0400, Kevin Walzer k...@codebykevin.com wrote: For what it's worth, that hasn't been my experience. Thanks for the feedback. I'll experiment and see how it goes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can someone suggest better resources for learning sqlite3? I wanted to use the Python library but I don't know sql.

2013-08-06 Thread Gilles
On Sat, 3 Aug 2013 10:57:32 -0700 (PDT), Aseem Bansal asmbans...@gmail.com wrote: I found Python3's sqlite3 library. I found that I needed sql commands for using it. I have tried sql.learncodethehardway but it isn't complete yet. I tired looking on stackoverflow's sql tag also but nothing much

Re: [GUI] Good frameworks for Windows/Mac?

2013-08-06 Thread Gilles
On Tue, 6 Aug 2013 13:22:01 +0200, Vlastimil Brom vlastimil.b...@gmail.com wrote: I mostly use wxPython myself, but if you just need some basic widgets and not some very complex or non-standard layouts, the tkinter - available in the standard library - might be perfectly viable.

[ActivePython] Upgrading fails

2013-08-06 Thread Gilles
Hello, I already posted in their forum, but got no reply and figured some people here might have experienced this too. I'm currently running ActivePython 2.5.1.1 on my XP Pro host. After downloading and running the installer to 2.7.2.5, I get the following error message: Windows Installer: The

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-08-01 Thread Gilles
On Wed, 24 Jul 2013 10:38:52 -0400, Kevin Walzer k...@codebykevin.com wrote: Thanks. hMailServer was one of the apps I checked, and I was just making sure there weren't something simpler, considering my needs, ideally something like Mongoose MTA. Regardless, because of the SPAM anti-measures

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-23 Thread Gilles
On Mon, 22 Jul 2013 08:54:11 -0400, Eric S. Johansson e...@harvee.org wrote: try http://emailrelay.sourceforge.net/ Thanks. I did find it, but it says it's not a full MTA: E-MailRelay is not a routing MTA. It forwards e-mail to a pre-configured SMTP server, regardless of any message addressing

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-23 Thread Gilles
On Mon, 22 Jul 2013 08:10:10 -0600, Michael Torrie torr...@gmail.com wrote: Where did you look? Here's one I found. It's not the real sendmail program, but it implements the interface which is all you need: http://glob.com.au/sendmail/ I just googled for sendmail win32 Thanks, but I need an

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-23 Thread Gilles
On Mon, 22 Jul 2013 10:14:15 -0400, Kevin Walzer k...@codebykevin.com wrote: http://www.hmailserver.com Thanks. hMailServer was one of the apps I checked, and I was just making sure there weren't something simpler, considering my needs, ideally something like Mongoose MTA. Regardless, because of

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Gilles
On Sun, 21 Jul 2013 18:28:27 -0600, Michael Torrie torr...@gmail.com wrote: The Sendmail MTA has been ported to many platforms including windows. But... Thanks for the tip. Since I couldn't find a good, basic, native Windows app, I was indeed about to look at eg. Exim + Cygwin, and resort to a

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Gilles
On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going to have much luck running an SMTP server.

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Gilles
On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going to have much luck running an SMTP server.

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Gilles
On Mon, 22 Jul 2013 22:29:42 +1000, Chris Angelico ros...@gmail.com wrote: One thing to check when you change how you send mail is your SPF record. I run the mail server for kepl.com.au and have set its SPF to: v=spf1 ip4:122.107.147.136 ip4:203.214.67.43 ip4:192.168.0.0/16 -all If your SPF is

Simple Python script as SMTP server for outgoing e-mails?

2013-07-21 Thread Gilles
Hello Every once in a while, my ISP's SMTP server refuses to send perfectly legit e-mails because it considers them as SPAM. So I'd like to install a dead-simple SMTP server on my XP computer just to act as SMTP backup server. All I'd need is to change the SMTP address in my e-mail

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-21 Thread Gilles
On Mon, 22 Jul 2013 00:48:29 +1000, Chris Angelico ros...@gmail.com wrote: Rather than write something from scratch, I'd look at deploying something out-of-the-box - Postfix, for instance - which you will be able to configure much faster than writing your own. And then you could have it either

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-21 Thread Gilles
On Sun, 21 Jul 2013 11:46:52 -0600, Michael Torrie torr...@gmail.com wrote: What you're looking for is not an SMTP server but a Mail Transfer Agent, called an MTA. Pretty much all distros ship with an MTA by default, even if the SMTP server part of it isn't installed or running. And often the MTA

Source code to identify user through browser?

2013-06-05 Thread Gilles
Hello I was wondering if some Python module were available to identify a user through their browser, like it's done on the Panopticlick site: http://panopticlick.eff.org/ I'd like to ban abusive users, and it seems like a good solution, since few users will think of installing a different

Re: Cross-compiling Python for ARM?

2013-04-20 Thread Gilles
On Tue, 16 Apr 2013 17:22:55 +0300, Anssi Saari a...@sci.fi wrote: In any case, cross compiling Python shouldn't be that hard. I just recently built 2.7.3 for my OpenWRT router since the packaged Python didn't have readline support (some long standing linking issue with readline and ncurses and

Cross-compiling Python for ARM?

2013-04-15 Thread Gilles
Hello I tried running uWSGI on an ARM-based appliance, but it fails. Apparently, it could be due to the official Python 2.6.6 interpreter in the depot not being compiled the way uWSGI expects it to be: ./configure --enable-shared; make; make install;

What web server for WSGI? Recommended book?

2013-03-27 Thread Gilles
Hello After going through multiple articles about the advantage of using WSGI instead of FastCGI + Flup to run Python web apps, I have a couple of questions: 1. Which server + WSGI module would you recommend? I know about Apache and Graham Dumpleton's mod_wsgi, but what about Lighttpd

[WSGI] Tell Python to listen to LAN interface?

2013-03-26 Thread Gilles
Hello I'm following this tutorial to learn about writing Python apps in WSGI: http://webpython.codepoint.net/wsgi_tutorial On a Linux host with Python 2.6.6 installed, I launched the Environment dictionary sample, but can't connect to it from my remote Windows host since the application only

Re: [WSGI] Tell Python to listen to LAN interface?

2013-03-26 Thread Gilles
On Tue, 26 Mar 2013 23:50:36 +1100, Chris Angelico ros...@gmail.com wrote: According to the docstring, the first argument to make_server() is the host name to bind to. Using localhost means you're bound to 127.0.0.1, as you see. Use your LAN IP address there, or to bind to all local addresses -

Daemonizing an application.

2013-02-27 Thread Gilles Lenfant
in advance fo any pointer. -- Gilles Lenant -- http://mail.python.org/mailman/listinfo/python-list

Re: Daemonizing an application.

2013-02-27 Thread Gilles Lenfant
Le mercredi 27 février 2013 11:52:19 UTC+1, Gilles Lenfant a écrit : Hello, Hello again, And thanks to all for your pointers and ideas. As the app is already tied to an Unix like OS, I'll go with signal handling first since I can do all I need through reconfiguration (SIGHUP). If I need

Re: Daemonizing an application.

2013-02-27 Thread Gilles Lenfant
Le mercredi 27 février 2013 14:55:42 UTC+1, Tarek Ziadé a écrit : On 2/27/13 11:52 AM, Gilles Lenfant wrote: Hello, [...] Thanks in advance fo any pointer. You can have a look at Circus - https://circus.readthedocs.org which is a process manager. circusctl is used

Installing Apache 2 and mod_wsgi on CentOS?

2013-02-12 Thread Gilles
Hello Before I go ahead, I'd like to make sure I'm doing it the right away: 1. yum install httpd mod_wsgi 2. Edit /etc/sysconfig/httpd to uncomment this line to get Apache to run as worker MPM: #HTTPD=/usr/sbin/httpd.worker 3. Edit mod_wsgi 4. Build a test WSGI Python script 5. Start Apache,

[2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
Hello I have a couple of newbie questions about using Python in a FastCGI + Flup context on a shared CentOS server: 1. The following script runs fine... = #!/usr/bin/env python2.6 def myapp(environ, start_response): start_response('200 OK',

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 10:30:01 +0100, Gilles nos...@nospam.com wrote: I have a couple of newbie questions about using Python in a FastCGI + Flup context on a shared CentOS server: Please ignore the thread. I found the error, and a way to catch compile-time errors (log on through SSH, and run

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 21:30:12 +1100, Chris Angelico ros...@gmail.com wrote: That'll catch some forms of error, but not everything. You may also want to consider looking for your server's error log - that may be getting the actual traceback. I don't know what your server setup is, but there's likely

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 22:30:45 +1100, Chris Angelico ros...@gmail.com wrote: Try running python2.6 -V Your shebang line says that it's looking for a program named python2.6, which is quite probably not the same as the one named just python. Indeed, they have two versions of Python installed: #

Re: [2.4.3/Newbie] Web script doesn't run

2013-02-11 Thread Gilles
On Mon, 11 Feb 2013 22:42:50 +1100, Chris Angelico ros...@gmail.com wrote: It's entirely possible you have a third Python, a 3.x, as well. Different Pythons coexist quite happily on a system. Thank for the help. I'm on my way to figure out how mod_fcgid, Flup, and Python scripts work together. --

Iterating over files of a huge directory

2012-12-17 Thread Gilles Lenfant
that yields the file names of a directory and does not make a giant list of what's in. i.e : for filename in enumerate_files(some_directory): # My cooking... Many thanks by advance. -- Gilles Lenfant -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating over files of a huge directory

2012-12-17 Thread Gilles Lenfant
Le lundi 17 décembre 2012 16:52:19 UTC+1, Oscar Benjamin a écrit : On 17 December 2012 15:28, Gilles Lenfant ... wrote: In the last couple of months there has been a lot of discussion (on python-list or python-dev - not sure) about creating a library to more efficiently iterate over

Re: Question about long-running web scripts

2012-10-26 Thread Gilles
On Thu, 25 Oct 2012 08:53:11 -0400, David Hutto dwightdhu...@gmail.com wrote: OTOH, Python web scripts can be written as long-running scripts: In this case, what is the added-value of using FastCGI? Why can't the web server simply call the Python script directly, just like CGI? The server

Re: Question about long-running web scripts

2012-10-26 Thread Gilles
On Thu, 25 Oct 2012 14:24:16 +0100, Tim Golden m...@timgolden.me.uk wrote: But actually, I didn't mean one-shot scripts, where the Python interpreter + script must be loaded each time, but rather: If I leave a Python running in an endless loop, why not just use either CGI or some other basic

Re: Question about long-running web scripts

2012-10-26 Thread Gilles
On Fri, 26 Oct 2012 12:00:17 +0100, Tim Golden m...@timgolden.me.uk wrote: Certainly there are Python equivalents (mod_python, mod_wsgi, etc.) which can run in effectively the same way as mod_php, and they could be configured to run an fcgi frontend script, I presume. There's always a certain

Question about long-running web scripts

2012-10-25 Thread Gilles
Hello I'd like to check something about running Python web applications. Generally speaking, the reason scripts run faster when called through FastCGI or the mod_* modules, is because the interpreter is already up and running. But when running PHP scripts, this does nothing about fetching the

Re: Question about long-running web scripts

2012-10-25 Thread Gilles
On Thu, 25 Oct 2012 13:03:14 +0100, Tim Golden m...@timgolden.me.uk wrote: (Your question is a little confused at the end. I'm choosing to understand: why can't we just run Python one-shot, like CGI? The likely alternative meaning is: why can't the incoming request be routed to an already-running

[2.5.1 + CGI] Which interpreter and files?

2012-10-19 Thread Gilles
Hello I'd like to use the Mongoose basic web server with Python which can call scripts through CGI. I have a coupole of questions: 1. Mongoose must be told in the shebang file where to locate the interpreter, but ActivePython 2.5.1 comes with fours files that look like the interpreter

Re: [2.5.1 + CGI] Which interpreter and files?

2012-10-19 Thread Gilles
On Fri, 19 Oct 2012 21:09:55 +1100, Chris Angelico ros...@gmail.com wrote: The ones with the -w tag are designed for Windows apps that are going to bring up a GUI and don't want a console. The python[w]25.exe ones will be in case you have multiple Pythons installed and want to explicitly call for

Re: python scripts for web

2012-10-19 Thread Gilles
On Thu, 18 Oct 2012 23:05:48 -0700 (PDT), chip9m...@gmail.com wrote: these scripts will do a lot of calculation on a big dataset, and it is possible that there will be many requests in a short period of time. In that case, are you sure a web script is a good idea? If you're thinking web to make

Re: How to investigate web script not running?

2012-09-30 Thread Gilles
On Sat, 29 Sep 2012 10:05:25 -0700 (PDT), Ramchandra Apte maniandra...@gmail.com wrote: Definitely not plug 'n play :-/ Well the plug and play standard is superseded by USB practically. Indeed ;-) Anyway, Support finally got back to me, and it turns out that they have Flup alreay installed on

#!/usr/bin/env python vs. #!/usr/bin/python?

2012-09-28 Thread Gilles
Hello I've seen both shebang lines to run a Python script on a *nix host: #!/usr/bin/env python #!/usr/bin/python What's the difference? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: #!/usr/bin/env python vs. #!/usr/bin/python?

2012-09-28 Thread Gilles
On Fri, 28 Sep 2012 06:57:28 -0400, Roy Smith r...@panix.com wrote: The first one looks through your PATH to find the right python interpreter to run. The second one is hard-wired to run /usr/bin/python. If you only have a single copy of python installed, it doesn't really matter which you

How to investigate web script not running?

2012-09-28 Thread Gilles
Hello I'm trying to run my very first FastCGI script on an Apache shared host that relies on mod_fcgid: == #!/usr/bin/python from fcgi import WSGIServer import cgitb # enable debugging cgitb.enable() def myapp(environ, start_response): start_response('200 OK',

Re: How to investigate web script not running?

2012-09-28 Thread Gilles
On Fri, 28 Sep 2012 13:37:36 +0200, Gilles nos...@nospam.com wrote: == Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. == Looks like fcgi.py doesn't support WSGI: Traceback (most recent call

Re: How to investigate web script not running?

2012-09-28 Thread Gilles
On Fri, 28 Sep 2012 14:16:22 +0200, Michael Ross g...@ross.cx wrote: Do it the other way around: # cgitb before anything else import cgitb cgitb.enable() # so this error will be caught from fcgi import WSGIServer Thanks much for the tip. The error isn't displayed when calling the script from a

Re: #!/usr/bin/env python vs. #!/usr/bin/python?

2012-09-28 Thread Gilles
On Fri, 28 Sep 2012 09:19:54 -0400, D'Arcy Cain da...@druid.net wrote: Not just flexible but portable. On various systems I have Python in /usr/bin, /usr/local/bin and /usr/pkg/bin. #!/usr/bin/env python finds it in each case so I only need one version of the script. Good to know. --

[fcgi.py] Force cache upgrade?

2012-09-28 Thread Gilles
Hello Does someone know if something must be done after editing a FastCGI + WSGI script so that the changes will show in the browser immediately instead of having to wait X minutes? === #!/usr/bin/env python2.6 def myapp(environ, start_response): start_response('200 OK',

Re: [fcgi.py] Force cache upgrade?

2012-09-28 Thread Gilles
On Fri, 28 Sep 2012 23:57:14 +0200, Gilles nos...@nospam.com wrote: I guess the FastCGI server (Flup) only updates its cache every so often. Do I need to type a command to force Flup to recompile the Python script? Turns out that, yes, mod_fcgid is configured to reload a script only after some

[WSGI] FCGID + Flup vs. mod_wsgi?

2012-09-21 Thread Gilles
Hello The shared host I intend to use to run a small Python web app only supports mod_fcgid on its Apache server. If I understood what I read on the Net, the ideal solution would be to have mod_wsgi installed and have it run either as a module within Apache or a stand-alone process to

[issue7358] cStringIO not 64-bit safe

2012-09-10 Thread Gilles Louppe
Gilles Louppe added the comment: Hi, Any solution regarding that issue? We are currently encountering the exact same bug when pickling too large objects. Best, Gilles -- nosy: +Gilles.Louppe ___ Python tracker rep...@bugs.python.org http

[web] Long-running process: FCGI? SCGI? WSGI?

2012-09-05 Thread Gilles
Hello To write a long-running web application, I'd like to some feedback about which option to choose. Apparently, the choice boilds down to this: - FastCGI - SCGI - WSGI It seems like FCGI and SCGI are language-neutral, while WSGI is Python-specific. Besides that, how to make an informed

Re: [2.5.1] Read each line from txt file, replace, and save?

2012-09-05 Thread Gilles
On Sun, 02 Sep 2012 14:04:29 -0400, Terry Reedy tjre...@udel.edu wrote: If you process each line separately, there is no reason to read them all at once. Use the file as an iterator directly. Since line is already a string, there is no reason to copy it into a new string. Combining these two

[2.5.1] Read each line from txt file, replace, and save?

2012-09-02 Thread Gilles
Hello This is a newbie question. I need to read a text file into a variable, loop through each line and use a regex to substitute some items within the line, and save the whole variable into a new text file. This triggers an error when I save the modified variable that contains all the lines:

Re: [2.5.1] Read each line from txt file, replace, and save?

2012-09-02 Thread Gilles
On Sun, 02 Sep 2012 12:19:02 +0200, Gilles nos...@nospam.com wrote: (snip) Found it: #rewrite lines to new file output = open('output.txt','w') for line in textlines: #edit each line line = just a test output.write(%s % line) output.close() -- http://mail.python.org

[CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
Hello Apache fails running this basic CGI script that I found on the Net: www.acme.com/cgi-bin/test.py?name=myname === #!/usr/bin/env python # Import modules for CGI handling import cgi, cgitb cgitb.enable() # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
Found it: The script MUST return something to the browser. I was missing this: print Content-Type: text/html;charset=utf-8 print # print a document print Name is %s % ( cgi.escape(name), ) Sorry about that. -- http://mail.python.org/mailman/listinfo/python-list

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
On Mon, 20 Aug 2012 07:59:39 -0400, Rod Person rodper...@rodperson.com wrote: Check the Apache error log, there should be more information there. It's a shared account, so I only have access to what's in cPanel, which didn't display anything. Problem solved. Thank you. --

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
On Mon, 20 Aug 2012 16:56:14 +0200, Hans Mulder han...@xs4all.nl wrote: Most such panels have a button to show the error log for your own site. If you can't find it, ask the help desk of the web hosting company. If there really is no way for you to see the error log, ask the help desk to mail

[CGI] Why is HTML not rendered?

2012-08-17 Thread Gilles
Hello I'm learning how to call Python scripts through the different solutions available. For some reason, this CGI script that I found on Google displays the contents of the variable but the HTML surrounding it is displayed as-is by the browser instead of being rendered: --

Re: [CGI] Why is HTML not rendered?

2012-08-17 Thread Gilles
On Fri, 17 Aug 2012 14:44:37 +0100, Robert Kern robert.k...@gmail.com wrote: For some reason, this CGI script that I found on Google displays the contents of the variable but the HTML surrounding it is displayed as-is by the browser instead of being rendered Thanks all. I (obviously) combined

Re: Running Python web apps on shared ASO servers?

2012-08-16 Thread Gilles
On Sun, 12 Aug 2012 02:03:33 +0200, Gilles nos...@nospam.com wrote: Does it mean that ASO only supports writing Python web apps as long-running processes (CGI, FCGI, WSGI, SCGI) instead of embedded Python à la PHP? I need to get the big picture about the different solutions to run a Python web

Re: Running Python web apps on shared ASO servers?

2012-08-13 Thread Gilles
On Sun, 12 Aug 2012 22:26:19 +0100, Tim Golden m...@timgolden.me.uk wrote: Just to make a point: one person's isn't a good solution is another person's works perfectly well for me. Modern servers are really quite quick: the cost of starting up a Python process and generating an HTML page can be

Re: Running Python web apps on shared ASO servers?

2012-08-12 Thread Gilles
On Sun, 12 Aug 2012 07:56:26 +0200, Dieter Maurer die...@handshake.de wrote: You should probably read the mentioned forum resources to learn details about the Python support provided by your web site hoster. Yup, but so far, no answer, so I figured someone here might now. Those articles seem to

Running Python web apps on shared ASO servers?

2012-08-11 Thread Gilles
Hello I use A Small Orange (ASO) as my web provider. Asking the question in their forum so far didn't work, so I figured I might have a faster answer by asking here. Support replied this in an old thread: Just a CGI option. We don't have enough users to justify adding mod_python support.

Re: Using a CMS for small site?

2012-07-05 Thread Gilles
On Wed, 4 Jul 2012 17:09:40 -0700 (PDT), alex23 wuwe...@gmail.com wrote: Not necessarily! There are several static site generators written in Python :) One that I see being updating a lot is Nikola: http://nikola.ralsina.com.ar/ I'll check it out, thanks. --

Re: Using a CMS for small site?

2012-07-05 Thread Gilles
On Thu, 05 Jul 2012 10:27:40 +0200, Dieter Maurer die...@handshake.de wrote: There is also Plone (http://plone.org;) -- easy to set up. You likely need third party extensions for the anti-SPAM support and the onlie payment. I'll see what extensions it offers. Thanks. --

Using a CMS for small site?

2012-07-04 Thread Gilles
Hello Someone I know with no computer knowledge has a studio appartment to rent in Paris and spent four months building a small site in Joomla to find short-time renters. The site is just... - a few web pages that include text (in four languages) and pictures displayed in a Flash slide show - a

Re: Using a CMS for small site?

2012-07-04 Thread Gilles
On Wed, 04 Jul 2012 06:28:09 -0400, Roy Smith r...@panix.com wrote: You probably want to look at https://www.django-cms.org/. It's not something that a person with no computer knowledge could set up, but once it's set up, that person could use it to build pages. But, to be honest, for somebody

Re: Using a CMS for small site?

2012-07-04 Thread Gilles
On Wed, 04 Jul 2012 11:21:42 -0400, Roy Smith r...@panix.com wrote: This is really getting quite far afield for a Python group. There are better forums for these kinds of questions. Probably. I'll keep that in mind while checking Python web frameworks. Thanks. --

Re: [newbie] Equivalent to PHP?

2012-06-21 Thread Gilles
On Tue, 12 Jun 2012 11:39:50 +0200, Gilles nos...@nospam.com wrote: I'm an amateur programmer, and would like to know what the main options are to build web applications in Python instead of PHP. When I need to host my Python application (preferably in Europe since my users will be located

Re: [newbie] Equivalent to PHP?

2012-06-21 Thread Gilles
On Thu, 21 Jun 2012 10:44:08 -0700, Paul Rubin no.email@nospam.invalid wrote: There are both kinds. The first kind is called a Virtual Private Server (VPS). The second kind is called shared hosting. Thanks much for the infos. -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Equivalent to PHP?

2012-06-14 Thread Gilles
On Wed, 13 Jun 2012 19:03:29 -0500, Tim Chase python.l...@tim.thechases.com wrote: That's just my off-the-top-of-my-head list of things that you'd have to come up with that Django happens to give you out-of-the-box. Thanks much. So the next step will have to find a framework that's right for a

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On Wed, 13 Jun 2012 10:19:29 +1000, Chris Angelico ros...@gmail.com wrote: It's far simpler to manage, it retains running state, and is easily enough encapsulated. It's the non-magic way of doing things. Also, it plays very nicely with the MUD style of process, which is something I do a lot with

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On 13 Jun 2012 08:29:05 GMT, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ and especially lack PHP's security vulnerabilities. Thanks for the link. -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On Tue, 12 Jun 2012 16:48:27 +0200, Matej Cepl mc...@redhat.com wrote: I don't think it is a proper description of the situation (please, somebody correct my mistakes, I am not 100% sure about it myself). WSGI applications (which is basically all web applications in Python) could run in the

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On Wed, 13 Jun 2012 19:41:41 +1000, Chris Angelico ros...@gmail.com wrote: For high-availability servers, I can't speak for Python, as I've never done that there; but it seems likely that there's good facilities. My personal preference is Pike, but that's off-topic for this list. :) But the simple

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On Wed, 13 Jun 2012 20:00:59 +1000, Chris Angelico ros...@gmail.com wrote: Most high level languages probably have some sort of HTTP server available. Some make it trivially easy to plug some code in and start serving. Python is advertised as batteries included, and one of its packets of batteries

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On Wed, 13 Jun 2012 18:01:23 +, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: Maybe this article will help you http://www.infoworld.com/d/application-development/pillars-python-six-python-web-frameworks-compared-169442 The comments on /. should round out anything missing from the article (I

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On Wed, 13 Jun 2012 17:27:21 +0200, Christian Heimes li...@cheimes.de wrote: A long running process has lots of benefits that makes design and development easier and makes your app faster. Thanks much for the infos. Makes you wonder why commercial companies still choose PHP to write their web

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On 13 Jun 2012 22:16:51 GMT, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Surely the obvious answer is that a framework offers the benefit that you don't have to write the application from scratch. Yes, but between receiving the query and sending the response, what features do

Re: [newbie] Equivalent to PHP?

2012-06-13 Thread Gilles
On Wed, 13 Jun 2012 23:16:31 +0200, Christian Heimes li...@cheimes.de wrote: PHP was developed for non-developers. (see http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ ). It's much easier and also cheaper to find bad coders and non-developers than code people. The outcome is bad

  1   2   3   4   >