Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: convert php in to python Date: Mon, 30 Nov 2015 19:48:38 +1100 Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 1drqAVToefDosOls6rmFPQezocbBYyDaEO1aDYvgIadA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'survive': 0.09; 'python': 0.10; 'python.': 0.11; 'subject:python': 0.14; 'docstring': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'luck!': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'simple.': 0.16; 'sure.': 0.16; 'trivially': 0.16; 'wrote:': 0.16; 'language': 0.19; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'file.': 0.22; 'trying': 0.22; 'code,': 0.23; 'bit': 0.23; 'header :In-Reply-To:1': 0.24; 'equivalent': 0.27; 'fri,': 0.27; 'skip:# 10': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'convert': 0.29; 'code': 0.30; 'another': 0.32; 'included': 0.32; 'language.': 0.32; 'usually': 0.33; 'received:google.com': 0.35; 'nov': 0.35; 'question,': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'possible': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'list.': 0.37; 'itself': 0.38; 'received:209': 0.38; "didn't": 0.39; 'provide': 0.61; 'skip:n 10': 0.62; 'chrisa': 0.84; 'to:none': 0.91; '*thanks': 0.91; 'migrating': 0.91; 'speaks': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=o7UNYBYu+bGmIrANZ+OoMCEdHkgtcu5gmkYQes1CQSs=; b=xY0P/Rpppu+VjFHw0z1WLvZBPCzxBXsVF9NGpiAbaiSZ2x9ubfXLvyIRWuuEqUC7JA udIQjrZk4i1iH/MgHNzAPdmVDKhc43R3Sp6K8Jn4q5NCHw4IkgBeCz/P5UbQBMwaJFy4 6H+O5Wx8EBXP77tOIgO7CjRQAz61jTmMcdnDLDrIZN6SbulmrE+bYrCBsUxjD3LV9ozX EVOO3rrvIWig/myWGQHMfdKErIJATCgLtf/yEW1yL+pyadCDnKRD9daPWiC4VR7b7mnV 1jIQ+yDQZkvyHXOphSBUJFpUtuApKLVPwteHQesh1xMh7xqnl5o6OYJNksZ7L+3c7nVO flLQ== X-Received: by 10.50.83.38 with SMTP id n6mr20424420igy.92.1448873318898; Mon, 30 Nov 2015 00:48:38 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99732 On Fri, Nov 27, 2015 at 11:52 PM, RENISH RUDANI wrote: > Please help me to convert this code in python. > > > *Thanks & Regards,* > > *Renish Rudani* > > *Action Speaks Louder than Words* Sure. #!/usr/bin/python3 """Emit no output""" You didn't provide any PHP code, so the equivalent Python code is actually an empty file. I put in a docstring and a shebang so you'd be able to find what I wrote. It's possible you included an attachment, but attachments don't always survive as far as the newsgroup/mailing list. Translating code from one language to another usually requires comprehension of what the code's trying to accomplish. You might have to dig into the code a bit and get to know it, and then recreate it in Python. It's not a simple question, unless the code itself is trivially simple. Good luck! At least you're migrating to a better language. ChrisA