Re: python vs smalltalk 80

2008-11-19 Thread Jason Scheirer
On Nov 18, 10:53 pm, gavino <[EMAIL PROTECTED]> wrote: > python vs smalltalk 80 > > which is nicer? I thought this was comp.lang.colorforth. WHAT IS GOING ON? -- http://mail.python.org/mailman/listinfo/python-list

Re: pdftk

2009-02-24 Thread Jason Scheirer
On Feb 24, 12:43 pm, JB wrote: > Reimar Bauer a écrit : > > > Hi > > > Does one know about a python interface to pdftk? > > Or something similar which can be used to fill a form by fdf data. > > everyday i use : > > import os > os.system("pdftk.exe source.pdf fill_form data.fdf output output.pdf >

Re: Does Paramiko 1.7.2 and 1.6.4 work with CentOS 4

2009-02-24 Thread Jason Scheirer
On Feb 25, 12:55 am, Shah Sultan Alam wrote: > Hi Groups, >  Can you please help me on the following... > > 1. Does Paramiko 1.7.2 and 1.6.4 work with CentOS 4 > > 2. If yes, what is the exact 'yum' command to install paramiko on CentOS 4? > I have tried all possible ones without success. > >    

Re: Looking for tips on running Python version 2.6 and 3.0 together on same *WINDOWS* machine

2009-02-24 Thread Jason Scheirer
On Feb 24, 9:20 pm, "Martin v. Löwis" wrote: > > It's easy - the registry isn't used except to associate files. The > > associations are made with the most-recently-installed version. > > > I currently have 2.4, 2.5, 2.6 and 3.0 on my Windows machine. > > In addition, at install time, there is the

Re: Are there any python libraries/packages like Juicer/Sprockets/bundle_fu?

2009-03-04 Thread Jason Scheirer
On Mar 4, 1:22 am, Phillip B Oldham wrote: > Hi all. > > Just wondering whether there are any libraries for python like ruby's > Juicer[1], Sprocets[2], or bundle_fu[3]? > > Thanks! > > [1]http://www.cjohansen.no/en/ruby/juicer_a_css_and_javascript_packaging... > [2]http://getsprockets.com/ > [3]h

Re: Can Python do shopping cart?

2009-03-05 Thread Jason Scheirer
On Mar 5, 2:30 pm, Muddy Coder wrote: > Hi Folks, > > I know PHP can do shopping cart, such as Zen Cart. I wonder can Python > do such a thing? Thanks! > > Muddy Coder http://www.satchmoproject.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python do shopping cart?

2009-03-06 Thread Jason Scheirer
On Mar 6, 1:19 am, Lie Ryan wrote: > Muddy Coder wrote: > > Hi Folks, > > > I know PHP can do shopping cart, such as Zen Cart. I wonder can Python > > do such a thing? Thanks! > > > Muddy Coder > > Python is Turing Complete "Python is Turing complete" is c.l.p's equivalent to Godwin's law. >From

Re: ipython / vs \ in readline on MS Windows (and ipython help grepper)

2009-03-12 Thread Jason Scheirer
On Mar 10, 3:34 pm, bdb112 wrote: > Q1/ I run a standard python ditribution with ipython and readline > under cygwin.  The tab filename completion works fine in the OS (bash > shell) as expected, and tab filename completion at the ipython command > line works, but with MS style path separators (ba

Re: Jython on Google AppEngine.

2009-04-09 Thread Jason Scheirer
On Apr 9, 9:12 am, Alan Kennedy wrote: > Hi all, > > You may be interested to know that you can now run jython 2.2 out of > the box on Google AppEngine, thanks to their new java support. > > A patch is required for jython 2.5, but we will be folding this in > before the jython 2.5 RC release over

Re: calculate field in ARCGIS

2009-04-09 Thread Jason Scheirer
On Apr 9, 12:55 pm, Chris Rebert wrote: > On Thu, Apr 9, 2009 at 12:42 PM, Lydia wrote: > > Hi Python users, > > > I ran into a problem with python coding in ARCGIS. Does anybody have the > > experience in dealing with this? > > > I need to calculate NEWFIELD based on OLDFIELD under condition: if

Re: Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Jason Scheirer
On Apr 13, 5:51 pm, Matthew Wilson wrote: > I want to have .foo directory that contains some python code.  I can't > figure out how to import code from that .foo directory.  Is this even > possible? > > TIA > > Matt Yes, but it's not a particularly recommended thing to do as it is CRAZY. You can

Re: Using Python after a few years of Ruby

2009-04-14 Thread Jason Scheirer
On Apr 14, 12:01 am, blahemailb...@gmail.com wrote: > Although I'm not 100% new to Python, most of my experience using high- > level languages is with Ruby. I had a job doing Rails web development > a little ways back and I really enjoyed it. At my current workplace > though, we're looking at using

Re: How to get all named args in a dict?

2009-05-14 Thread Jason Tackaberry
On Thu, 2009-05-14 at 20:15 +, kj wrote: > That problem is easily solved: just make "x = locals()" the first > statement in the definition of foo. That doesn't solve the problem. You'd need locals().copy() Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError function not found

2009-05-29 Thread Jason Tackaberry
of a matrix.""" Given that this does, I assume this _is_ a class method. So are you putting _determinant() inside the class? If so, you should either make it method, and invoke it as self._determinant(), or bring it outside the class into the global scope, in which case y

Re: Serious Problem with Timezone

2008-05-19 Thread Jason Scheirer
On May 19, 3:02 pm, T-u-N-i-X <[EMAIL PROTECTED]> wrote: > Hey There, > > I'm a django developer and working on a project right now.. Last week > I just discovered a new problem in Python.. Here's what I do.. > > [01:00] ([EMAIL PROTECTED] ~)$ date > Sal May 20 01:00:10 EEST 2008 > [01:00] ([EMAIL

Re: Python is slow

2008-05-22 Thread Jason Scheirer
On May 22, 9:14 am, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow.    Almost all of the web applications written in > Python are slow.   Zope/Plone is slow, sloow, so very slooow.  Even > Google Apps is not faster.   Neither is Youtube. > Facebook and Wikipedia (Mediawiki), written in PH

Re: Invalid Version Number (Distutils from Cygwin)

2008-06-09 Thread Jason Tishler
gs: http://cygwin.com/ml/cygwin/2008-05/msg00622.html Can we reach consensus on what is the best ld version string regular expression to use? If so, then I will work to get this change committed to the Python code base and release a patched Cygwin Python 2.5.2 with this fix included.

Re: Do this as a list comprehension?

2008-06-09 Thread Jason Scheirer
On Jun 9, 7:06 am, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Jun 6, 1:40 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > >> On Thu, 05 Jun 2008 23:42:07 -0400, John Salerno wrote: > >>> Is it possible to write a list comprehension for this so as to produce a > >>> list of

Re: Iterate creating variables?

2008-06-13 Thread Jason Scheirer
On Jun 13, 8:11 am, [EMAIL PROTECTED] wrote: > I have twenty-five checkboxes I need to create (don't ask): > > self.checkbox1 = ... > self.checkbox2 = ... > . > . > . > self.checkbox25 = ... > > Right now, my code has 25 lines in it, one for each checkbox, since > these are all variables. > > Is th

Re: Was the move to Python 2.0 as big a deal?

2008-06-14 Thread Jason Scheirer
On Jun 14, 9:35 am, John Salerno <[EMAIL PROTECTED]> wrote: > Just curious if people put up any resistance to 2.0 like some people do > for 3.0. Was it as big of a change in the language, or was the > transition smoother? It seems silly for anyone to say they would prefer > to stick with 1.x versio

Re: Combining music or video files?

2008-06-15 Thread Jason Scheirer
On Jun 15, 7:53 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Before I try this and destroy my computer :) I just wanted to see if > this would even work at all. Is it possible to read a binary file such > as an mp3 or an avi, put its contents into a new file, then read another > such file and appe

Re: Please explain Python "__whatever__" construct.

2008-06-16 Thread Jason Scheirer
On Jun 16, 2:56 pm, [EMAIL PROTECTED] wrote: > After a couple of weeks studying Python, I already have a few useful > scripts, including one that downloads 1500 Yahoo stock quotes in 6 > seconds. However, many things are puzzling to me. I keep on seeing > things like "__main__" in scripts.  A more

Re: Getting Python to run Python Scripts in cygwin

2008-06-19 Thread Jason Tishler
en python will not be able to find ".py" unless you specify a (relative or absolute) path to it. Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 -- http://mail.python.org/mailman/listinfo/python-list

Re: Porn Addiction

2008-06-25 Thread Jason Scheirer
On Jun 24, 5:24 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been downloading porn online and > masturbating to it for a few years... Lately it's gotten even worse, I > spend hours and hours surfing and masturbating to it. It's taking over > my life and ruining everything.. I eve

Re: Help me optimize my feed script.

2008-06-26 Thread Jason Scheirer
On Jun 26, 12:30 pm, [EMAIL PROTECTED] wrote: > I wrote my own feed reader using feedparser.py but it takes about 14 > seconds to process 7 feeds (on a windows box), which seems slow on my > DSL line. Does anyone see how I can optimize the script below? Thanks > in advance, Bill > > # UTF-8 > impor

Re: Use of the "is" statement

2008-06-27 Thread Jason Scheirer
On Jun 27, 8:38 am, Gary Herron <[EMAIL PROTECTED]> wrote: > Joel Corbin wrote: > > Hello, > > > I'm trying to clarify what exactly the behaviour of the is statement > > is (or should be). Naturally, this has been nearly impossible to > > google for, even using quotations... It is my impression tha

Re: Django or TurboGears for a new project

2008-06-27 Thread Jason Scheirer
On Jun 27, 9:52 am, Kirk Strauser <[EMAIL PROTECTED]> wrote: > We're looking to migrate a Zope site to Django, but before getting beyond > the dreaming stage, I thought I'd see what others are doing these days. > > If you were going to start a fairly complex site today with lots of DB > integration

Re: "method involving two objects" is that possible in Python?

2008-06-27 Thread Jason Scheirer
On Jun 27, 2:41 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I just started to learn Python. I understood how one can create a > class and define a method related with that class. According to my > understanding every call of a methods is related with a specific > object. For example, we have

Re: GUI Programming by hand not code with Python Code

2008-07-06 Thread Jason Scheirer
On Jul 6, 7:33 pm, [EMAIL PROTECTED] wrote: > Is their a program that lets you design a GUI by hand (like gambas) > not by code (like wxpython) but the commands are in python? > > A program similar to gambas or vb > > Gambas with python code instead of gambas code would be perfect. > > Thanks in ad

__del__ methods

2008-07-18 Thread Jason Baker
I have a class that I need to do some finalization on when it dies. I know I can use the __del__ method, but I seem to recall that it impedes garbage collection. Is this the case? (keep in mind that my code aims to be compatible with python 2.3 to python 2.5) -- http://mail.python.org/mailman/li

Re: __del__ methods

2008-07-18 Thread Jason Baker
On Jul 18, 2:10 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 18 Jul 2008 11:31:20 -0700, Jason Baker wrote: > > I have a class that I need to do some finalization on when it dies.  I > > know I can use the __del__ method, but I seem to rec

Re: tkinter for my python program !!

2008-07-23 Thread Jason Scheirer
On Jul 23, 11:38 am, David <[EMAIL PROTECTED]> wrote: > > Further, finally when i invoke the python program by > > giving the necessary input file, i get the following > > errors . > > Does it have any relation with the python version installed ? > > yes > > > I am using Redhat 9.0 > > You may want

clearing all warning module caches in a session

2008-07-26 Thread jason-sage
an easy way to invalidate all the module-level caches of warnings so that the entire warning system is truly reset? Thanks, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: SVN access with pysvn under Cygwin (Installation problems)

2008-07-30 Thread Jason Tishler
n > File "/usr/lib/python2.5/pysvn/__init__.py", line 104, in > import _pysvn_2_5 > ImportError: No module named _pysvn_2_5 > > Is there some trick to getting .pyd to work under Cygwin? You need to build (and install) pysvn under Cygwin. The pre-built

Re: SVN access with pysvn under Cygwin (Installation problems)

2008-07-31 Thread Jason Tishler
Andy, On Thu, Jul 31, 2008 at 03:10:26AM -0700, Andy Dingley wrote: > On 30 Jul, 20:30, Jason Tishler <[EMAIL PROTECTED]> wrote: > > You need to build (and install) pysvn under Cygwin. The pre-built > > Windows version will not work under Cygwin. > > Thanks. Presuma

Re: Automatically fill in forms on line

2008-03-31 Thread Jason Scheirer
On Mar 31, 9:50 am, "Jackie Wang" <[EMAIL PROTECTED]> wrote: > Dear all, > > I want to automatically complete the following task: > > 1. Go tohttp://www.ffiec.gov/Geocode/default.aspx; > 2. Fill in an address in the form "Street Address:" . e.g. "1316 State > Highway 102"; > 3. Fill in a ZIPcode in

Re: Automatically fill in forms on line

2008-03-31 Thread Jason Scheirer
On Mar 31, 10:35 am, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Mar 31, 9:50 am, "Jackie Wang" <[EMAIL PROTECTED]> wrote: > > > > > Dear all, > > > I want to automatically complete the following task: > > > 1. Go tohttp://www.ffiec.

Re: XML Parsing

2008-04-01 Thread Jason Scheirer
On Apr 1, 12:42 pm, Alok Kothari <[EMAIL PROTECTED]> wrote: > Hello, > I am new to XML parsing.Could you kindly tell me whats the > problem with the following code: > > import xml.dom.minidom > import xml.parsers.expat > document = """Lettermanis token>betterthan token>JayLeno""" > > # 3

Re: object-relational mappers

2008-04-01 Thread Jason Scheirer
On Apr 1, 1:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > I've been poking around the world of object-relational > mappers and it inspired me to coin a corellary to the > the famous quote on regular expressions: > > "You have objects and a database: that's 2 problems. > So: get an object-relati

Re: Unicode conversion problem (codec can't decode)

2008-04-03 Thread Jason Scheirer
On Apr 3, 9:35 pm, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > I'm having a problem (Python 2.4) converting strings with random 8-bit > characters into an escape form which is 7-bit clean for storage in a database. > Here's an example: > > body = meta['mini_body'].encode('unicode-escape') > >

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Jason Scheirer
On Apr 7, 8:54 pm, BonusOnus <[EMAIL PROTECTED]> wrote: > How do I pass a dictionary to a function as an argument? > > # Say I have a function foo... > def foo (arg=[]): > x = arg['name'] > y = arg['len'] > > s = len (x) > > t = s + y > > return (s, t) > > # The dictionary: > > dict = {} > dict['na

Re: Google App Engine

2008-04-08 Thread Jason Scheirer
On Apr 8, 7:50 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > > Google have announced a new service called 'Google App Engine' which may > > be of interest to some of the people here > > OK, now we need a compatibility layer so you can move apps from > Google App Engine to yo

Re: get array element

2008-04-10 Thread Jason Scheirer
On Apr 10, 10:22 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have an array, and I would like to get the indice value. > > a = array([13,14,15,16]) > > I would like something like a.getindice(15) > > If I want 15 it would return 2 a.index(15) -- http://mail.python.org/mailman/listinfo/p

Re: basic python question about for loop

2008-04-12 Thread Jason Stokes
"jmDesktop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So what is n and x in the first iteration? Sorry. I'm trying. Remember how Python's range operator works. range(n, x) constructs a list that consists of all elements starting with n and up to, but /not including/, x.

Re: String Literal to Blob

2008-04-12 Thread Jason Scheirer
On Apr 12, 2:44 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > in line... > > > On Fri, Apr 11, 2008 at 2:05 PM, Steve Holden <[EMAIL PROTECTED] > > > wrote: > > > Victor Subervi wrote: > > > I have worked on this many hours a day for two

Re: Easiest way to get started with WebApps?

2008-04-18 Thread Jason Scheirer
On Apr 18, 12:06 pm, [EMAIL PROTECTED] wrote: > which is the easiest module to use to just get started with webapps > quicklya nd starting getting things up and running, not advanced stuff > just basic. web.py is probably the most reasonable small webapp framework to get going (it's a very small d

Re: py3k concerns. An example

2008-04-18 Thread Jason Scheirer
On Apr 18, 4:19 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 18 Apr., 23:09, Matimus <[EMAIL PROTECTED]> wrote: > > > The reason it doesn't work is that you are unpacking the dictionary > > with **, and you have done nothing to define any keys or define a > > length. > > This is a non-issue. Th

Re: What happened with python? messed strings?

2008-04-20 Thread Jason Scheirer
On Apr 20, 11:54 am, <[EMAIL PROTECTED]> wrote: > Hi, > I used extensively python and now I find this mess with strings, > I can't even reproduce tutorial examples:>>> "apfel".encode('utf-8')  (it was > with umlaut) > >   File "", line 0 > >     ^ > SyntaxError: 'ascii' codec can't decode byte 0xc

Re: Nested lists, simple though

2008-04-20 Thread Jason Scheirer
On Apr 20, 3:25 pm, Zethex <[EMAIL PROTECTED]> wrote: > Im a bit new to python.  Anyway working on a little project of mine and i > have nested lists > > ie > > Answer = [['computer', 'radeon', 'nvidia'], ['motherboard', 'asus']] > > and so forth.., > Anyway the amount of [[]] do increase over time

Re: about python

2008-04-22 Thread Jason Scheirer
On Apr 22, 7:50 pm, [EMAIL PROTECTED] wrote: > How can python execute in browser? > > Mukul Very carefully. Alternately, applets/Jython. -- http://mail.python.org/mailman/listinfo/python-list

Re: python-ldap - Operations Error

2008-04-23 Thread Jason Scheirer
On Apr 23, 5:16 pm, [EMAIL PROTECTED] wrote: > Hello all, I am trying to integrate TurboGears with our Active > Directory here at the office.  TurboGears aside, i cannot get this to > work.  The simplest thing i can do to test this is: > > >>> import ldap > >>> l = ldap.initialize("ldap://server.ne

Re: Explicit variable declaration

2008-04-24 Thread Jason Stokes
"Filip Gruszczynski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> If you want to just declare that name exist, but doesn't want to >> declare the type, why don't you just do this: >> >> def somefunc(): >> nonlocal = nonlocal >> local = 0 # or None or [] or an initial

Re: RPM of a Python program

2008-08-14 Thread Jason Scheirer
On Aug 13, 5:52 pm, Clay Hobbs <[EMAIL PROTECTED]> wrote: > I want to make an RPM (Redhat Package Manager) file to install a Python > program (not a module).  How is this done?  Does it use Distutils, or > something completely different?  Thanks in advance. > > -- Ratfink You first want to make su

Pre-university student looking to contribute to OS project

2008-08-15 Thread Jason Walsh
nd see if there are any projects in particular that would be good for a younger programmer like me. I've taken a look at this (http://wiki.python.org/moin/CodingProjectIdeas) and there's good things there, but I'd really like to get involved in a pre-existing project. Thank

Re: How to simulate packages?

2008-08-21 Thread Jason Scheirer
On Aug 21, 11:26 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 21 Aug 2008 13:04:51 -0300, Daniel <[EMAIL PROTECTED]>   > escribi : > > > I have a project that I've decided to split into packages in order to > > organize my code better.  So what I have looks something like this > > >

Re: setattr and getattr, when to use?

2008-08-22 Thread Jason Scheirer
On Aug 22, 8:50 pm, maestro <[EMAIL PROTECTED]> wrote: > Why are these functions there? Is it somehow more idiomatic to use > than to do obj.field ? > Is there something you can with them that you can't by obj.field > reference? You can generate them dynamically from strings. In some cases you don

Re: setattr and getattr, when to use?

2008-08-22 Thread Jason Scheirer
On Aug 22, 10:17 pm, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Aug 22, 8:50 pm, maestro <[EMAIL PROTECTED]> wrote: > > > Why are these functions there? Is it somehow more idiomatic to use > > than to do obj.field ? > > Is there something you can w

Re: List of modules available for import inside Python?

2008-08-28 Thread Jason Scheirer
On Aug 27, 11:04 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > ssecorp wrote: > > Is there a way to view all the modules I have available for import > > from within Python? > > Like writing in the interpreter: > > import.modules > > there's a helper script in the 2.5 source code kit that locates a

Re: How to check is something is a list or a dictionary or a string?

2008-08-29 Thread Jason Scheirer
On Aug 29, 9:16 am, [EMAIL PROTECTED] wrote: > Hi, > > How to check if something is a list or a dictionary or just a string? > Eg: > > for item in self.__libVerDict.itervalues(): >             self.cbAnalysisLibVersion(END, item) > > where __libVerDict is a dictionary that holds values as strings o

Re: path slashes cleaning

2008-09-04 Thread Jason Scheirer
On Sep 4, 6:32 am, "Francesco Guerrieri" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 3:25 PM, Mathieu Prevot <[EMAIL PROTECTED]> wrote: > > Hi, > > > for scripts that take arguments, I would like to remove the trailing > > slash if it's present. > > > Is there something else than: > > > a='

Re: Problem with Python shell through Cygwin Screen (Python/Vim/Screen combo)

2008-09-19 Thread Jason Tishler
ctly accesses the console under Cygwin. For example: http://mail.python.org/pipermail/python-list/2004-June/21.html AFAICT, you will have to use Cygwin Python with screen. Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669

Re: Linq to Python

2008-09-23 Thread Jason Scheirer
On Sep 23, 7:48 am, hrishy <[EMAIL PROTECTED]> wrote: > Hi > > Will LINQ be ported to Python ? > > regards > Hrishy I think this question is more appropriate to ask on an IronPython development list -- LINQ is pretty solidly intertwined with .Net, and so you'll likely want to look at the .Net impl

Re: decent interactive python shell on MS Windows?

2008-10-01 Thread Jason Scheirer
On Oct 1, 9:53 am, [EMAIL PROTECTED] wrote: > Hi everyone, > > After having used Python on Linux for some time, I now have to do > Python coding on Windows. I am big fan of the interactive Python shell > to test, eg, regexps. > > Is there an interactive Python shell on Windows that supports: > > -

Re: index all instances by id - a memory leak?

2008-10-01 Thread Jason Scheirer
On Oct 1, 10:01 pm, Dan Barbus <[EMAIL PROTECTED]> wrote: > On Oct 2, 7:54 am, Dan Barbus <[EMAIL PROTECTED]> wrote: > > > > >     def getItemById(id): > >         return _itemsById[id] > > I just saw that this won't compile. Still, ignoring this, I thing the > purpose of the code is pretty clear.

Python equivalent of Perl e flag with regular expression

2008-10-02 Thread Friedman, Jason
I have lines that look like this: select column1, 'select' as type from table where column2 = 'foo' I want to return: SELECT column1, 'select' AS type FROM table WHERE column2 = 'foo' This is SQL with the keywords converted to uppercase. Note that the second "select" string is not a keyword and

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-15 Thread Jason Earl
t as a Python weakness. Python does match (and exceed) Perl for docs available on the command line. Once you get used to using the excellent info-based Python documentation using man is downright primitive. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Introspection

2010-01-06 Thread Jason Scheirer
On Jan 6, 8:38 am, Steven D'Aprano wrote: > On Wed, 06 Jan 2010 06:53:40 -0800, m...@infoserv.dk wrote: > > I'm looking for a way to make a list of string literals in a class. > > > Example: > > > class A: > >    def method(self): > >        print 'A','BC' > > ExtractLiterals(A) > > ['A','BC'

Re: Manipulating pointers in C using ctypes

2010-01-08 Thread Jason Scheirer
On Jan 8, 7:37 am, Daniel Platz wrote: > Hello! > > I have to ask a newbie question about manipulating pointers in C using > ctypes. I have a C dll with two functions. The first one creates a > pointer and returns it to python. The second one takes a pointer as an > argument shows its address and

Re: Append to an Excel file

2010-01-09 Thread Jason Scheirer
On Jan 9, 12:30 am, pp wrote: > Hi All, > > How do I add a line to an existing file. This should append to the > existing data in the excel file, which was saved previously. > > Thanks, > PP http://pypi.python.org/pypi/xlwt -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarifications on compiling for Windows

2010-01-09 Thread Jason Scheirer
On Jan 7, 10:51 pm, Mensanator wrote: > On Jan 8, 12:19 am, peteshinners wrote: > > > > > > > > > My presentation for Pycon is coming together, but I need to make sure > > my information about compiling Python and Python extensions for > > Windows is correct. I'm really only experienced with this

Re: Most "active" coroutine library project?

2009-09-25 Thread Jason Tackaberry
some network resource). It's true that the yields in fetch_google() aren't yielding control _directly_ to one of the task() coroutines, but it _is_ doing so indirectly, via the coroutine scheduler, which runs inside the main loop. Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Re: Most "active" coroutine library project?

2009-09-25 Thread Jason Tackaberry
ython co-routines that's being discussed > is the fact that you can only yeild/resume from the main coroutine > function. With my implementation this is only half true. It's true that for other active coroutines to be reentered, "main" coroutines (there can be mor

Re: Most "active" coroutine library project?

2009-09-25 Thread Jason Tackaberry
27;d say it's the same basic construct. Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Re: putchar(8)

2009-10-16 Thread Jason Tackaberry
On Fri, 2009-10-16 at 12:01 -0700, gervaz wrote: > Hi all, is there in python the equivalent of the C function int putchar > (int c)? I need to print putchar(8). >>> print '\x08' or: >>> print chr(8) -- http://mail.python.org/mailman/listinfo/python-list

Re: Cpython optimization

2009-10-23 Thread Jason Sewall
haps_ the numpy or scipy people (I am not associated with either of them) would be interested in some threading for certain array operations. Maybe you could write something on top of what they have to speed up array ops. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I run a python program from within emacs?

2009-11-01 Thread Jason Sewall
re actually running the python interpreter in Emacs, in which case the code is run in that buffer. If you're still having trouble, probably an Emacs or Aquamacs list is a better place to look. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: faster than list.extend()

2009-11-16 Thread Jason Sewall
it up 5-10% more. I'm pretty surprised this is faster than Tim's t2 (which is actually a little slower than the original); I always thought of comprehensions as the fastest way to do this find of stuff. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Imitating "tail -f"

2009-11-21 Thread Jason Sewall
pretty cool. Jason On Nov 21, 2009 11:11 PM, wrote: On 02:43 am, ivo...@gmail.com wrote: > > I'm trying to simply imitate what "tail -f" does, i.e. read... select(), poll(), epoll, etc. all have the problem where they don't support files (in the thing-on-a-filesystem

Re: Text mining in Python

2010-03-10 Thread Jason Tackaberry
tely). Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with variable and function

2010-03-14 Thread Jason Tackaberry
xpect). If you can provide an example doesn't work, we should be able to explain why and provide advice. Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Re: to pass self or not to pass self

2010-03-16 Thread Jason Tackaberry
eate the bound methods at instantiation time, rather than using the descriptor protocol which has the overhead of creating a new bound method each time the method attribute is accessed? Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Re: pythoncom.CoInitialize() not recognised in Eclipse

2010-03-28 Thread Jason Scheirer
On Mar 28, 7:14 pm, KB wrote: > Hi there, > > I have in the past used PythonWin to write python for COM, and > switched to Eclipse. > > I am getting an error from the IDE saying it does not recognise > CoInitialize(): > > > import pythoncom > > pythoncom.CoInitialize() > pythoncom.CoUninitial

subclass of object

2010-04-02 Thread Jason Friedman
Hi, what is the difference between: def MyClass(object): pass and def MyClass(): pass -- http://mail.python.org/mailman/listinfo/python-list

packaging python code in zip file

2010-12-09 Thread mark jason
hi, I have created a python app in eclipse pydev .The app is structured as below.. mypackage |__ __init__.py |__ driver.py |__ helper.py |__ utils.py The driver.py has the main program.I have added if __name__=="__main__" block in the driver.py and pydev's run configurat

printing error message from an Exception

2010-12-09 Thread mark jason
hi I was trying out some file operations and was trying to open a non existing file as below def do_work(filename): try: f = open(filename,"r"); print 'opened' except IOError, e: print 'failed',e.message finally: f.close() print 'closed' if __na

Re: printing error message from an Exception

2010-12-10 Thread mark jason
On Dec 10, 11:55 am, Steven D'Aprano wrote: >     # By the way, IOError is not the only exception you could see. thanks for the help Steven. Is it OK to catch Exception instead of IOError ? In some operation which can cause many errors ,can I use the following? try: do_something() except Ex

Re: Google AI challenge: planet war. Lisp won.

2010-12-20 Thread Jason Earl
eir own starter package. I am sure that something similar could have been done for OCaml or F#. That's probably too bad. These types of competitions are good publicity for less popular languages (assuming that the bots to well). Jason -- http://mail.python.org/mailman/listinfo/python-list

Code review request

2010-12-22 Thread Jason Staudenmayer
I'm not a programmer but would like to possibly expand in to it (right now an IT guy). Am I on the right track so far? The program should be documented enough to explain. """ Created on Tue Dec 21 13:39:41 2010 @author: jason Usage: cmd_drug_testing.py [options]... Will sel

RE: [SPAM] - Re: Code review request

2010-12-22 Thread Jason Staudenmayer
: Code review request Am 22.12.2010 19:34, schrieb Jason Staudenmayer: Hi All, Hi Jason, the program could be more dense. You have several redundant code in there, too. For example, all the *Employee functions basically just call dbconnect and let it execute the sql there. dbconnect in this

Re: opinion: comp lang docs style

2011-01-04 Thread Jason Earl
a -- (Num is defined in the Prelude) > negate :: a -> a > > This declaration may be read “a type a is an instance of the class > Num if there are class methods (+) and negate, of the given types, > defined on it.” > > (Source www.haskell.org) > > Note the w

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-07 Thread Jason Swails
python32 python_select python26-apple switches seamlessly between them. (I have so many versions to test script compatibility, not because I'm an avid collector). In any case, this seems to be an ideal solution. All the best, Jason On Thu, Jan 6, 2011 at 5:25 PM, Bill Felton wrote: >

RE: Nested structures question

2011-01-12 Thread Jason Staudenmayer
Return False instead of break should work else: print "You guessed it! The number was", the_number print "And it only took you", tries, "tries!\n" return False Jason ..·><º> > -Original Message- > From: &

Re: WxPython versus Tkinter.

2011-01-24 Thread Jason Swails
net is inflammable after all (how else could it still be here after so many flame wars?) Hoping you all have a peaceful night, Jason On Mon, Jan 24, 2011 at 10:54 PM, Stephen Hansen wrote: > On 1/24/11 2:16 PM, rantingrick wrote: > > On Jan 24, 3:58 pm, Infinity77 wrote: > >

Re: WxPython versus Tkinter.

2011-01-24 Thread Jason Swails
ng I'm talking about? It's ok, you wouldn't understand. Suffice it to say that nearly all projects of the magnitude you seem to be projecting requires joint collaboration and participation of these people things that have long since forgotten your point and stopped li

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-02 Thread Jason Swails
te. At least according to the laws of the universe as we understand them today. (we = physicists/scientists) But if you DO upgrade/update/improve/replace IDLE, I like the way the in-terminal interpreter pipes help(module) output through less rather than barfing it on the screen; the only IDLE shortcoming I've encountered in my 30 seconds of tinkering. Perhaps this behavior is just Unix-specific, though, and I'm perfectly content to continue playing in my terminal. Happy trolling, Jason -- Jason M. Swails Quantum Theory Project, University of Florida Ph.D. Graduate Student 352-392-4032 -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-02 Thread Jason Swails
ered as to think we > >> actually care? > > > > Citation: http://goo.gl/LlBFj > > Actually, FWIW, not everybody advertises plonks. > They should. It's a fun word to read. Jason > >Mel. > > -- > http://mail.python.org/mailman/listinfo/pyth

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
(True) False (I know this is fixed in py3) I think 0 -> False, 1-> True is perfectly reasonable and is fairly common in many languages (only Fortran in the languages I use doesn't use this construct). Not a serious issue in any case. --Jason > *school-bell* > -- > http://mail.python.org/mailman/listinfo/python-list > -- Jason M. Swails Quantum Theory Project, University of Florida Ph.D. Graduate Student 352-392-4032 -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
On Wed, Feb 9, 2011 at 5:34 PM, MRAB wrote: > On 09/02/2011 21:42, Jason Swails wrote: > >> You've gotten several good explanations, mainly saying that 0 -> False >> and not 0 -> True, which is why the while loop exits. You've also >> gotten advice about

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
On Wed, Feb 9, 2011 at 8:16 PM, Ethan Furman wrote: > Jason Swails wrote: > >> However, as surprising as this may be I'm actually with RR on this one >> (for a little) -- for code readability's sake, you should make your >> conditional more readable (i.e.

Re: Easy function, please help.

2011-02-10 Thread Jason Swails
7;s just calling an object > constructor- no different than any other class in the language. > Ah, makes sense, thanks. Most of what I see/work in is C and Fortran -- not much OOP there :) --Jason -- > http://mail.python.org/mailman/listinfo/python-list > -- Jason M. Swails Quantum Theory Project, University of Florida Ph.D. Graduate Student 352-392-4032 -- http://mail.python.org/mailman/listinfo/python-list

<    4   5   6   7   8   9   10   11   >