The code you just posted doesn't compile successfully.
However, in your code, you probably have char_ptr defined at the module level,
and you're confused because you didn't declare it as global. Am I right? My
crystal ball has a smudge on it, but I think I can still see okay.
You can still re
PROTECTED]>
> List-Archive: <http://mail.python.org/pipermail/python-list>
> List-Post: <mailto:python-list@python.org>
> List-Help: <mailto:[EMAIL PROTECTED]>
> List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
> <mailto:[EM
On Tue, 2007-12-11 at 16:55 -0800, katie smith wrote:
> I tried your suggestions and all that came up was the error
> Traceback (most recent call last):
> File "C:\Python25\empire\Empire Strategy.pyw", line 1788, in
>
> NewMap1= eval (NewMap1, {}, {})
> File "", line 1
> Tropical Isla
On Wed, Dec 12, 2007 at 09:08:44AM -0500, Calvin Spealman wrote regarding Re:
psycopg:
>
>Don't do that, for a number of reasons. String concatenation is really
>never a good idea and formatting your own query strings is exactly what
>leads to things like sql injection. Let the db lib
On Wed, Dec 12, 2007 at 06:36:49AM -0800, sturlamolden wrote regarding Re: Is a
"real" C-Python possible?:
>
> On 12 Des, 12:56, George Sakkis <[EMAIL PROTECTED]> wrote:
>
> > Ah, the 'make' statement.. I liked (and still do) that PEP, I think it
> > would have an impact comparable to the decora
On Wed, Dec 12, 2007 at 10:08:38AM -0600, [EMAIL PROTECTED] wrote regarding Re:
Is anyone happy with csv module?:
>
> FWIW, CSV is a much more generic format for spreadsheets than XLS.
> For example, I deal almost exclusively in CSV files for simialr situations
> as the OP because I also work wit
On Wed, Dec 12, 2007 at 11:02:04AM -0600, [EMAIL PROTECTED] wrote regarding Re:
Is anyone happy with csv module?:
>
> J. Clifford Dyer <[EMAIL PROTECTED]> wrote:
> > But the software you are dealing with probably doesn't actually
> > need spreadsheets. It just need
On Thu, Dec 13, 2007 at 04:57:04PM +0100, Remco Gerlich wrote regarding Re:
Question from a python newbie:
>
>On Dec 13, 2007 4:39 PM, Russell <[EMAIL PROTECTED]> wrote:
>
> I've been learning Python slowly for a few months, coming from a
> C/C+
> +, C#, Java, PHP background.
On Tue, 2008-02-26 at 14:08 -0800, Jeff Schwab wrote:
> J. Cliff Dyer wrote:
> > On Tue, 2008-02-26 at 13:51 -0500, D'Arcy J.M. Cain wrote:
> >> On Tue, 26 Feb 2008 13:39:38 -0500
> >> "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote:
> >> a = 2 * 2
> >> b = 20 * 20
> >> type(a
I just want to step in and offer my 2¢. This is my first PyCon, and I
agree that a lot of the Lightning talks seemed pretty useless. Overall
though, I had a great experience at this conference. I learned a lot; I
met a lot of cool people; and I got really excited about new ideas to
bring back ho
On Fri, 2009-01-09 at 10:46 -0800, Dennis Lee Bieber wrote:
> On Wed, 07 Jan 2009 11:38:29 -0500, "J. Cliff Dyer"
> declaimed the following in comp.lang.python:
>
> > I want to be able to create an object of a certain subclass, depending
> > on the argument given to the class constructor.
> >
>
On Fri, 2009-01-16 at 16:41 -0500, Steve Holden wrote:
> Steven D'Aprano wrote:
> > On Fri, 16 Jan 2009 11:01:18 -0500, J. Cliff Dyer wrote:
> >
> >> On Fri, 2009-01-16 at 08:57 +, Steven D'Aprano wrote:
> >>> On Fri, 16 Jan 2009 10:03:28 +0200, Hendrik van Rooyen wrote:
> >>>
> Oh come o
Please include all relevant information in the *body* of your message,
not just in the subject. It's a pain having to piece a question back
together between the subject.
On Sun, 2009-01-25 at 13:12 -0800, gert wrote:
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.pyth
On Sun, 2009-02-15 at 09:54 -0800, Pavan Mishra wrote:
> I was wondering if I can use python documentation source
> (reStructuredText) and restructure it along the lines of PHP
> documentation. Allowing users to add comments, improving search etc.
>
> I was thinking if it would be useful.
> --
> h
On Mon, 2008-12-08 at 00:57 -0800, Chris Rebert wrote:
> On Mon, Dec 8, 2008 at 12:26 AM, Bruno Desthuilliers
> <[EMAIL PROTECTED]> wrote:
> > Colin J. Williams a écrit :
> >>
> >> [EMAIL PROTECTED] wrote:
> >>>
> >>> How can I make a "var" parm, where the called function can modify
> >>> the value
On Sun, 2008-12-14 at 11:16 +0100, Piotr Sobolewski wrote:
> Marc 'BlackJack' Rintsch wrote:
>
> > I'd make that first line:
> > sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
> >
> > Why is it even more cumbersome to execute that line *once* instead
> > encoding at every ``print`` statement?
On Thu, 25 Dec 2008 13:22:15 -0500
Matthew Dubins wrote:
> Hello all,
>
> I have made a python script to upload contact information from an
> excel worksheet to an online database. One part of the program that
> really tripped me up was when I wanted to call specific class methods
> that I had
On Mon, 2008-10-20 at 13:29 +, Steven D'Aprano wrote:
> On Mon, 20 Oct 2008 11:01:19 +0200, Bruno Desthuilliers wrote:
>
> > Steven D'Aprano a écrit :
> >> On Sun, 19 Oct 2008 19:03:29 +0200, Bruno Desthuilliers wrote:
> >>
> >>> Steven D'Aprano a écrit :
> >>>
> >>> (snip)
> >>>
> You c
Maybe Ruby is the right language for your need.
Just sayin'.
On Sun, 2008-10-26 at 13:19 +, Pedro Borges wrote:
> The scripts i need to run but be executed with no apparent delay
> specially when the text transforms are simple.
>
>
> On Oct 26, 2008, at 11:13 AM, James Mills wrote:
>
>
Probably because you responded an hour after the question was posted,
and in the dead of night. Newsgroups often move slower than that. But
now we have posted a solution like that, so all's well in the world. :)
Cheers,
Cliff
On Wed, 2009-02-25 at 08:20 +, hrishy wrote:
> Hi Lie
>
> I am
On Sun, 2009-03-01 at 09:51 -0500, Philip Semanchuk wrote:
> On Mar 1, 2009, at 8:31 AM, Hussein B wrote:
>
> > Hey,
> > I'm retrieving records from MySQL database that contains non english
> > characters.
> > Then I create a String that contains HTML markup and column values
> > from the previous
On Mon, 2009-03-02 at 00:33 -0800, Hussein B wrote:
> On Mar 1, 11:27 pm, "J. Clifford Dyer" wrote:
> > On Sun, 2009-03-01 at 09:51 -0500, Philip Semanchuk wrote:
> > > On Mar 1, 2009, at 8:31 AM, Hussein B wrote:
> >
> > > > Hey,
> > > >
On Mon, 2009-03-02 at 06:16 -0800, Hussein B wrote:
> On Mar 2, 4:03 pm, "J. Clifford Dyer" wrote:
> > On Mon, 2009-03-02 at 00:33 -0800, Hussein B wrote:
> > > On Mar 1, 11:27 pm, "J. Clifford Dyer" wrote:
> > > > On Sun, 2009-03-01 at 09:51
On Mon, 2009-04-06 at 15:11 -0400, Victor Subervi wrote:
> Hi:
> I have this code:
>
> x = 1
> while x <= bitties:
> file = open(p + str(x) + ".txt")
> for line in file:
> print line
> print eval(bits[x - 1])
> x += 1
>
> which throws this error:
>
> [Mon Apr 06 12:07:29 2009] [error
On Tue, 2009-04-07 at 08:44 +1000, r-w wrote:
> If no internet connection:
> if have files:
> run anyway, with warning
> else:
> ERROR
> else:
> if error getting hash/files:
> if have files:
> run anyway, with warning
> else:
>
On Mon, 2009-04-06 at 23:41 +0100, Rhodri James wrote:
> On Mon, 06 Apr 2009 23:12:14 +0100, Anish Chapagain
> wrote:
>
> > Hi,
> > I was trying to extract wikipedia Infobox contents which is in format
> > like given below, from the opened URL page in Python.
> >
> > {{ Infobox Software
> > | n
On Thu, 2009-05-07 at 10:49 -0700, Benjamin J. Racine wrote:
> I'd love to see an updated shootout between these three, as I cannot for the
> life of me seem to be able to settle down with one of them.
>
> Things I don't like:
> Wing's lack of integrated mercurial/svn support.
Wing *does* have
You're still not asking questions in a way that we can answer them.
Define "Doesn't work." Define "a".
On Sat, 2009-05-09 at 00:04 -0700, anuraguni...@yahoo.com wrote:
> also not sure why (python 2.5)
> print a # works
> print unicode(a) # works
> print [a] # works
> print unicode([a]) # doesn'
On Fri, 2009-05-22 at 10:54 -0700, Jan wrote:
> This produces an error because by definition of for-loops
> it is executed the same way as:
>
> temp_iterator = iter(y) # temp_iterator is y
> while True:
> try:
> print(next(temp_iterator)) # temp_iterator does not support
> __next__()
>
On Tue, 2008-05-13 at 03:25 -0700, [EMAIL PROTECTED] wrote:
> Why is the \ backslash character frowned upon? Can I still use it in
> Python 3.0 to achieve the same thing it was designed to do?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Many people think it looks ugly, but it s
On Tue, 2008-05-13 at 03:28 -0700, [EMAIL PROTECTED] wrote:
> Hi - I have a list returned from popen/readlines, and am wondering how
> to go about iterating over each item which was returned (rather than
> currently having the whole lot returned).
>
> so far:
>
> >>> f=os.open("./get_hostnames").
On Tue, 2008-05-13 at 10:33 -0700, Dave Parker wrote:
> > You sound like a commercial.
>
> Get Flaming Thunder for only $19.95! It slices, it dices!
>
> > And while programs and libraries written in assembly may be twice as fast
> > as programs and libraries written in C, ...
>
> It's a myth th
On Sun, May 18, 2008 at 07:06:10PM +0100, Matt Porter wrote regarding Compress
a string:
>
> Hi guys,
>
> I'm trying to compress a string.
> E.g:
> "BBBC" -> "ABC"
>
> The code I have so far feels like it could be made clearer and more
> succinct, but a solution is currently escaping me.
On Sat, 2008-05-24 at 15:36 -0700, zxo102 wrote:
> Hi,
>how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to
> "\xED\x6F\x3C\x01" in python coding?
> When I take 'ED6F3C01' as a string and insert '\x' into it, I just got
> the error information : invalid \x escape.
>Thanks.
>
>
On Sat, 2008-05-24 at 15:59 -0700, zxo102 wrote:
> But this is not "\xED\x6F\x3C\x01". I need it for
> struct.unpack('f',"\xED\x6F\x3C\x01") to calculate the decimal value
> (IEEE 754).
> Any other suggestions?
>
> ouyang
>
In fact it is exactly the same string. The repr of a string always
sub
On Fri, 2008-04-18 at 10:28 +0100, [EMAIL PROTECTED] wrote:
> On Thu, 17 Apr 2008 20:57:21 -0700 (PDT)
> hdante <[EMAIL PROTECTED]> wrote:
>
> > Don't use old 8-bit encodings. Use UTF-8.
>
> Yes, I'll try. But is a problem when I only want to read, not that I'm trying
> to write or create the
On Fri, 2008-04-18 at 07:27 -0400, J. Clifford Dyer wrote:
> On Fri, 2008-04-18 at 10:28 +0100, [EMAIL PROTECTED] wrote:
> > On Thu, 17 Apr 2008 20:57:21 -0700 (PDT)
> > hdante <[EMAIL PROTECTED]> wrote:
> >
> > > Don't use old 8-bit encodings. Us
On Thu, 2008-05-01 at 17:31 -0500, Victor Subervi wrote:
> On Wed, Apr 30, 2008 at 12:35 PM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote:
> Post working code, and I'll answer your actual question.
>
> Good grief! The code is *not* double spaced! Take a look. Click to
> the end of the first li
On Thu, 2008-05-08 at 09:12 +0200, Daniel Marcel Eichler wrote:
> Am Mittwoch 07 Mai 2008 21:48:56 schrieben Sie:
>
> > > That's the point. Interfaces garantee that a duck is a duck, an not
> > > only a chicken that quack.
> > Which, in spite of your rhetorical flourish, is the exact opposite of
>
On Thu, 2008-09-04 at 18:48 -0500, Robert Dailey wrote:
> Thanks everyone for your help. I'm not opposed to using [key.lower()
> for key in stage_map] at all, I was just curious to see if there were
> any cleaner alternatives. It looks like that is what I'll be using.
> I'm not familiar with how py
Victor Subervi wrote:
> Hi;
> I have this line of code:
> sql = 'select Name, Price from %sPackages where ID=%s;' % (store, pid)
> which prints to this:
> select Name, Price from productsPackages where ID=1;
> which when I enter it into the MySQL interpreter gives me this:
> mysql> select Name, P
On Fri, Jan 08, 2010 at 03:32:34PM -0400, Victor Subervi wrote regarding
Another Screwy Problem:
> Date: Fri, 8 Jan 2010 15:32:34 -0400
> From: Victor Subervi
> To: python-list
> Subject: Another Screwy Problem
>
>Hi;
>I have this line of code:
> sql = 'select Name, Price from %sPac
On Sat, Mar 27, 2010 at 04:28:56AM -0700, Jonathan Hartley wrote regarding Re:
Classes as namespaces?:
>
> Hey everyone. By coincidence, only yesterday I was wondering about
> using classes as a way of labeling a block of code, ie. an lightweight
> alternative to defining a function that would on
On Fri, Mar 26, 2010 at 02:49:02PM +, kj wrote regarding Classes as
namespaces?:
>
> What's the word on using "classes as namespaces"? E.g.
>
> class _cfg(object):
> spam = 1
> jambon = 3
> huevos = 2
>
> breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos)
>
>
> Granted, this
On Wed, 2009-06-24 at 14:54 -0700, Aahz wrote:
> In article ,
> J. Cliff Dyer wrote:
> >
> >Glad you're enjoying Beazley. I would look for something more
> >up-to-date. Python's come a long way since 2.1. I'd hate for you to
> >miss out on all the iterators, booleans, codecs, subprocess, yield,
On Wed, 2009-06-24 at 15:22 -0700, Frank Ruiz wrote:
> Greetings,
>
> I am trying to process multiple commands using paramiko. I have
> searched other threads, and I think my use case is a little different.
> I am trying to login to a storage node that has a special shell, and
> as such I cant exe
On Wed, 2009-07-08 at 14:45 -0700, Paul Rubin wrote:
> a...@pythoncraft.com (Aahz) writes:
> > >Avoid that len(tuple(g)), use something like the following, it's lazy
> > >and saves some memory.
> > The question is whether it saves time, have you tested it?
>
> len(tuple(xrange(1))) ... hmm
101 - 147 of 147 matches
Mail list logo