Re: Assignment and comparison in one statement

2008-05-23 Thread TheSaint
On 06:59, sabato 24 maggio 2008 Johannes Bauer wrote: > However, this "assignment and comparison" is not working. What's the > "Python way" of doing this kind of thing? If you want speak a language that isn't understood mostly you'll face unexpected risults. When you got started with C/C++, were

Re: Calling class method by name passed in variable

2008-05-23 Thread Sagari
Thanks to everyone for the advice. In fact, since all the called methods trap necessary exceptions, I see no big problems with that. With all respect, Konstantin -- http://mail.python.org/mailman/listinfo/python-list

Re: simple url regexp

2008-05-23 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > url = re.compile(r"((http|ftp|https)\:\/\/)(www)?([a-zA-Z]{1}([\w\-]+ > \.)+([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+ > \.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?") > > damn i hate these things. > > i want it to only match http://www.name.any/etc > > not http://wiki.x e

Re: Python is slow

2008-05-23 Thread Torsten Bronger
Hallöchen! cm_gui writes: > [...] > > if python is such a good programming/scripting language, > why can't they build a faster interpreter/compiler engine? > and beat php and zend. > to the python team, rebuild your interpreter! > > torontolife.com is slow. For me, torontolife.com is exactly as

Re: Reloading function obtained via 'from xxx import yyy'

2008-05-23 Thread bukzor
On May 23, 3:44 pm, "Joel Koltner" <[EMAIL PROTECTED]> wrote: > ""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL PROTECTED] > > > Try all three of them, in sequence: > > Thanks, will do. > > > If you absolutely don't want to import test, write > > I can live with the import, I ju

Re: Storing objects in relational database

2008-05-23 Thread bukzor
On May 23, 7:00 pm, alex23 <[EMAIL PROTECTED]> wrote: > On May 24, 7:14 am, nayden <[EMAIL PROTECTED]> wrote: > > > the execution fails just after the print statement, and I am not quite > > sure why is that. > > It's often helpful to include the traceback, or at the very least the > last 3-4 lines

Re: Python is slow

2008-05-23 Thread Jeremy Pager
On Fri, 23 May 2008 03:21:23 -0700, Ivan Illarionov <[EMAIL PROTECTED]> wrote: On 23 май, 02:20, Brad <[EMAIL PROTECTED]> wrote: cm_gui wrote: > Python is slow. It ain't C++, but it ain't a punch card either... somewhere in between. I find it suitable for lots of stuff. I use C++ when

Re: why is com-prompt faster and how do i start at cprompt at mydir/ ?

2008-05-23 Thread bukzor
On May 23, 10:18 pm, [EMAIL PROTECTED] wrote: > On 24 Maj, 07:01, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > > > [EMAIL PROTECTED] writes: > > > On 24 Maj, 05:48, Ben Finney <[EMAIL PROTECTED]> > > > wrote: > > > > Can you tell us exactly which programs you mean when you say "the > > > > shell"

Re: Unhandled exceptions checking

2008-05-23 Thread bukzor
On May 23, 6:31 pm, Yosifov Pavel <[EMAIL PROTECTED]> wrote: > Does somebody know existent tool for checking unhandled exceptions? > Like in Java when method throws exception but in code using this > method, try...catch is missed. May be something like PyChecker? > > -- > /Pavel I know that pychec

Re: Python is slow

2008-05-23 Thread cm_gui
i am not comparing Python with C or C++ which are of course compiled languages. if there is any consolation to Python lovers here, Python is still faster than Microsoft ASP/ASPX. i'm not trying to 'troll' here. it's not just me. many have complained that python is slow. python websites are sl

Re: would this be called bug?

2008-05-23 Thread Terry Reedy
"Amit Gupta" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The code is attached below. Basically I am taking a substring of | variable m, and using "buffer" instead of slicing. | | However, the application of int on that buffer start correctly from | the offset, but it scans all t

Re: why is com-prompt faster and how do i start at cprompt at mydir/ ?

2008-05-23 Thread notnorwegian
On 24 Maj, 07:01, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > On 24 Maj, 05:48, Ben Finney <[EMAIL PROTECTED]> > > wrote: > > > Can you tell us exactly which programs you mean when you say "the > > > shell" and "the commandprompt"? > > > commandprompt = windows dos-windows

Re: ctypes help

2008-05-23 Thread Terry Reedy
"gianluca" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Thank you for help! | I've done all you suggest and I've a objdump output like this: | ... | [ 86](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x3755 _IsCoverRelD | [ 87](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x3657

Re: why is com-prompt faster and how do i start at cprompt at mydir/ ?

2008-05-23 Thread Ben Finney
[EMAIL PROTECTED] writes: > On 24 Maj, 05:48, Ben Finney <[EMAIL PROTECTED]> > wrote: > > Can you tell us exactly which programs you mean when you say "the > > shell" and "the commandprompt"? > > commandprompt = windows dos-windows > > shell = standard python interactive prompt Thanks. Be awar

Re: why is com-prompt faster and how do i start at cprompt at mydir/ ?

2008-05-23 Thread notnorwegian
On 24 Maj, 05:48, Ben Finney <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > when running a very computationalheavy program in the shell it > > sometimes freezes but the commandprompt runs it without problems > > Can you tell us exactly which programs you mean when you say "the > shell"

Re: why is com-prompt faster and how do i start at cprompt at mydir/ ?

2008-05-23 Thread Ben Finney
[EMAIL PROTECTED] writes: > when running a very computationalheavy program in the shell it > sometimes freezes but the commandprompt runs it without problems Can you tell us exactly which programs you mean when you say "the shell" and "the commandprompt"? -- \ "One seldom discovers a true

why is com-prompt faster and how do i start at cprompt at mydir/ ?

2008-05-23 Thread notnorwegian
when running a very computationalheavy program in the shell it sometimes freezes but the commandprompt runs it without problems and muh faster, why? also, the command prompt starts at C:\Users\user> i want to start at C:\python25\progs how do i change that? -- http://mail.python.org/mailman/lis

simple url regexp

2008-05-23 Thread notnorwegian
url = re.compile(r"((http|ftp|https)\:\/\/)(www)?([a-zA-Z]{1}([\w\-]+ \.)+([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+ \.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?") damn i hate these things. i want it to only match http://www.name.any/etc not http://wiki.x etc -- http://mail.python.org/mailman/listi

Re: Storing objects in relational database

2008-05-23 Thread Jerry Hill
On Fri, May 23, 2008 at 5:07 PM, nayden <[EMAIL PROTECTED]> wrote: > The reason I am writing here is that I can't seem to figure out how to > save/restore python objects into a relational database. Here's a basic version using the sqlite bindings included with Python 2.5: import sqlite3, pickle

Re: webspider, regexp not working, why?

2008-05-23 Thread alex23
On May 24, 3:26 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > c) If you're going to parse html/xml then bite the bullet and learn one > of the libraries specifically designed to parse html/xml. Many other > regex gurus have learned this lesson. Myself included. =) Agreed. The BeautifulSou

Re: would this be called bug?

2008-05-23 Thread MRAB
On May 24, 1:33 am, Amit Gupta <[EMAIL PROTECTED]> wrote: > The code is attached below. Basically I am taking a substring of > variable m, and using "buffer" instead of slicing. > > However, the application of int on that buffer start correctly from > the offset, but it scans all the way to the end

Re: unittest: Calling tests in liner number order

2008-05-23 Thread Ben Finney
Antoon Pardon <[EMAIL PROTECTED]> writes: > The answers seemed to be negative. Since I really would like this > behaviour I didn't see you explain *why* you think this behaviour is desirable. You've already had responses that explained why it leaves you open to more bugs when code only works if t

Re: function returns , but variable values has not changed in the interactive prompt

2008-05-23 Thread alex23
On May 24, 5:04 am, davidj411 <[EMAIL PROTECTED]> wrote: > if you run execfile function to run a python script and that script > has variables and functions, should't those variable change in the > interactive prompt too? Yes. >cat a.py a = 7 b = 'seven' Python 2.5.1 (r251:54863, May 1 2007, 17

Re: Storing objects in relational database

2008-05-23 Thread alex23
On May 24, 7:14 am, nayden <[EMAIL PROTECTED]> wrote: > the execution fails just after the print statement, and I am not quite > sure why is that. It's often helpful to include the traceback, or at the very least the last 3-4 lines of it, as it helps everyone work out the issue you're having. If

Re: csv iterator question

2008-05-23 Thread alex23
On May 24, 6:36 am, davidj411 <[EMAIL PROTECTED]> wrote: > but when i try to iterate through it again, it appears to print > nothing (no error either). the file is exhausted? No, the iterator is finished. Iterators are generally use-once: "The intention of the protocol is that once an iterator's

Unhandled exceptions checking

2008-05-23 Thread Yosifov Pavel
Does somebody know existent tool for checking unhandled exceptions? Like in Java when method throws exception but in code using this method, try...catch is missed. May be something like PyChecker? -- /Pavel -- http://mail.python.org/mailman/listinfo/python-list

Re: Assignment and comparison in one statement

2008-05-23 Thread George Sakkis
On May 23, 6:59 pm, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Hello group, > > I'm just starting with Python and am extremely unexperienced with it so > far. Having a strong C/C++ background, I wish to do something like > > if (q = getchar()) { >         printf("%d\n", q); > > } > > or translated

Re: Assignment and comparison in one statement

2008-05-23 Thread Carl Banks
On May 23, 6:59 pm, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Hello group, > > I'm just starting with Python and am extremely unexperienced with it so > far. Having a strong C/C++ background, I wish to do something like > > if (q = getchar()) { > printf("%d\n", q); > > } > > or translated

would this be called bug?

2008-05-23 Thread Amit Gupta
The code is attached below. Basically I am taking a substring of variable m, and using "buffer" instead of slicing. However, the application of int on that buffer start correctly from the offset, but it scans all the way to the end, instead of stopping at the length of the buffer. It works howeve

Re: ctypes help

2008-05-23 Thread gianluca
On 23 Mag, 12:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > gianluca <[EMAIL PROTECTED]> wrote: > > On 23 Mag, 07:48, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > On Thu, 22 May 2008 21:55:41 -0700, gianluca wrote: > > > > Yes, I know it but when I load a function (a=myDLL.myFUNCT(

Assignment and comparison in one statement

2008-05-23 Thread Johannes Bauer
Hello group, I'm just starting with Python and am extremely unexperienced with it so far. Having a strong C/C++ background, I wish to do something like if (q = getchar()) { printf("%d\n", q); } or translated to Python: if (p = myfunction()): print p However, this "assignment

Re: Reloading function obtained via 'from xxx import yyy'

2008-05-23 Thread Joel Koltner
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Try all three of them, in sequence: Thanks, will do. > If you absolutely don't want to import test, write I can live with the import, I just don't want to have to type out the full names all the time. ---Joel

Re: csv iterator question

2008-05-23 Thread Marc 'BlackJack' Rintsch
On Fri, 23 May 2008 13:36:55 -0700, davidj411 wrote: > example of open method on file object: > fhandle=open(filename).readelines() Here the name `fhandle` is somewhat misleading. You don't bind the file object to that name, but the result of the call of the `readlines()` method. Which is a lis

Re: csv iterator question

2008-05-23 Thread Ethan Furman
davidj411 wrote: When you save an open file to a variable, you can re-use that variable for membership checking. it does not seem to be that way with the csv.reader function, even when set to a variable name. what is the best way to store the open CSV file in memory or do i need to open the fil

Re: Storing objects in relational database

2008-05-23 Thread [EMAIL PROTECTED]
On 23 mai, 23:14, nayden <[EMAIL PROTECTED]> wrote: > and then I try to restore the object with the following code > > def success(rv): > print "success" > str = cStringIO.StringIO(libpq.PgUnQuoteBytea(rv[0][0])) > i = cPickle.load(str) > i.toString() > > the execution fails just a

Re: Storing objects in relational database

2008-05-23 Thread nayden
and then I try to restore the object with the following code def success(rv): print "success" str = cStringIO.StringIO(libpq.PgUnQuoteBytea(rv[0][0])) i = cPickle.load(str) i.toString() the execution fails just after the print statement, and I am not quite sure why is that. I wo

Re: Python database 'frontends', what's available?

2008-05-23 Thread Matimus
On May 23, 11:59 am, [EMAIL PROTECTED] wrote: > I'm desperately trying to move a Microsoft Access database application > (a simple accounts system I wrote myself) to Linux. Python is one of > my preferred programming laguages so I wonder if there are any good > Python 'frameworks' for writing data

Storing objects in relational database

2008-05-23 Thread nayden
I started playing with python a few weeks ago after a number of years of perl programming and I can say that my first impression is, unsurprisingly, quite positive. ;) The reason I am writing here is that I can't seem to figure out how to save/restore python objects into a relational database. The

Re: Python is slow

2008-05-23 Thread [EMAIL PROTECTED]
On 23 mai, 10:42, "inhahe" <[EMAIL PROTECTED]> wrote: > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in > messagenews:[EMAIL PROTECTED] > > > Brad a écrit : > >> cm_gui wrote: > >>> Python is slow. > > >> It ain't C++, but it ain't a punch card either... somewhere in between. I > >> find it sui

Re: Python database 'frontends', what's available?

2008-05-23 Thread Mike Driscoll
On May 23, 1:59 pm, [EMAIL PROTECTED] wrote: > I'm desperately trying to move a Microsoft Access database application > (a simple accounts system I wrote myself) to Linux.  Python is one of > my preferred programming laguages so I wonder if there are any good > Python 'frameworks' for writing datab

Re: csv iterator question

2008-05-23 Thread Mike Driscoll
On May 23, 3:36 pm, davidj411 <[EMAIL PROTECTED]> wrote: > When you save an open file to a variable, you can re-use that variable > for membership checking. > it does not seem to be that way with the csv.reader function, even > when set to a variable name. > > what is the best way to store the open

Re: Another Question

2008-05-23 Thread Mike Driscoll
On May 23, 1:44 pm, Gandalf <[EMAIL PROTECTED]> wrote: > you've been very helpful but still i have only one problem. I wont the > window not to be close after clicking the X button. > I wont the program to stay on the toolbar > > thanks! Well then, in your event handler, just don't do anything. d

csv iterator question

2008-05-23 Thread davidj411
When you save an open file to a variable, you can re-use that variable for membership checking. it does not seem to be that way with the csv.reader function, even when set to a variable name. what is the best way to store the open CSV file in memory or do i need to open the file each time? exampl

Re: Reloading function obtained via 'from xxx import yyy'

2008-05-23 Thread [EMAIL PROTECTED]
On 23 mai, 21:40, "Joel Koltner" <[EMAIL PROTECTED]> wrote: > How do I get Python to correctly re-load this function definition? > > In test.py: > > def testFunc(): > print 'My testFunc!' > > I execute... > > >>> from test import testFunc > >>> testFunc() > > My testFunc! > > Fine... now I chan

Re: array of 64-bit ints?

2008-05-23 Thread Nick Craig-Wood
Martin v. L?wis <[EMAIL PROTECTED]> wrote: > > Is it possible to have an array of 64-bit-ints using the standard Python > > array module? On my 64-bit architecture (AMD64, MSVC), both "int" and > > "long int" are 32 bit integers. To declare 64-bit ints, one needs either > > "long long int" or

Re: Advice from senior Members

2008-05-23 Thread Nick Craig-Wood
flit <[EMAIL PROTECTED]> wrote: > I am looking for some experience from the senior members. > Now I am doing a simple desktop application, this application will > have 3 main functions: > > 1- Read information about the desktop system; > 2- Interact with the user; > 3- Send information to a

Re: call f(a, *b) with f(*a, **b) ?

2008-05-23 Thread bukzor
On May 23, 12:35 pm, "inhahe" <[EMAIL PROTECTED]> wrote: > " > I wish this worked:>>> def main(a,b,*argv): pass > >>> options['argv'] = argv > >>> main(**options) > > TypeError: main() got an unexpected keyword argument 'argv' > " > - > I was thinking about that exact same thing actually. Exce

Re: Reloading function obtained via 'from xxx import yyy'

2008-05-23 Thread Martin v. Löwis
> ...and I'd like to reload testFunc. How do I do so? 'from test import > testFunc' keeps the old definition around, and 'reload test' of course > doesn't > work becayse I didn't use 'import test' in the first place. Try all three of them, in sequence: import test reload(test) from test impo

Re: Why is math.pi slightly wrong?

2008-05-23 Thread inhahe
""" "Dutton, Sam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Thanks for all the answers and comments. >math.pi is exactly equal to 884279719003555/281474976710656, which is the >closest C double to the actual value of pi So much for poor old 22/7... Sam """ The biblically cor

Re: Python is slow

2008-05-23 Thread inhahe
"Paul Rubin" wrote in message news:[EMAIL PROTECTED] > "inhahe" <[EMAIL PROTECTED]> writes: >> planets are spherical (all implementations of Python are not natively >> compiled (and you said for whatever definition)), and b) It's a far cry >> to >> imagine a planet com

Re: can python do some kernel stuff?

2008-05-23 Thread Ivan Illarionov
On 23 май, 22:32, Jimmy <[EMAIL PROTECTED]> wrote: [...] > however, how can I just simply know a key is pressed? If you are on Linux, use XLib http://python-xlib.sourceforge.net/ You need to catch the KeyPress or KeyRelease X events. while 1: ev = display.next_event() if ev.type == X.KeyP

Reloading function obtained via 'from xxx import yyy'

2008-05-23 Thread Joel Koltner
How do I get Python to correctly re-load this function definition? In test.py: def testFunc(): print 'My testFunc!' I execute... >>> from test import testFunc >>> testFunc() My testFunc! Fine... now I change test.py to: def testFunc(): print 'Modified testFunc!' ...and I'd like to re

Re: call f(a, *b) with f(*a, **b) ?

2008-05-23 Thread inhahe
" I wish this worked: >>> def main(a,b,*argv): pass >>> options['argv'] = argv >>> main(**options) TypeError: main() got an unexpected keyword argument 'argv' " - I was thinking about that exact same thing actually. Except that I was thinking you might want it like this, otherwise it could be

Re: Decorator metaclass

2008-05-23 Thread Thomas Karolski
Turns out the first msg I sent did not reach the list, so I'll just post what I've achieved by now: -- class DecoratorDummy(object): pass class InheritedDecoratorType(type): def __new__(cls, name, bases, dct): # return if its a clas

Re: Decorator metaclass

2008-05-23 Thread Carl Banks
On May 23, 11:42 am, Thomas Karolski <[EMAIL PROTECTED]> wrote: > > You will note that Decorator does not define __init__. In fact, > > object.__init__ will be called, which does nothing. If you think that > > all classes with DecoratorType as their metaclass will be a direct > > subclass of Dec

matploblib communication problem, graphics question

2008-05-23 Thread _wolf
i've had a hard time today to drill down on some infos about matplotlib of http://matplotlib.sourceforge.net/. this is an sf.net-managed project, its mailing lists are managed by gnu mailman in a pre-1994 version. still there is a sf.net standard forum interface, which however denies me to post.

function returns , but variable values has not changed in the interactive prompt

2008-05-23 Thread davidj411
if you run execfile function to run a python script and that script has variables and functions, should't those variable change in the interactive prompt too? script snippet that calls the function which should return like this return (stuffedname,bigstring, numbertimes,num_times_search_st

Python database 'frontends', what's available?

2008-05-23 Thread tinnews
I'm desperately trying to move a Microsoft Access database application (a simple accounts system I wrote myself) to Linux. Python is one of my preferred programming laguages so I wonder if there are any good Python 'frameworks' for writing database applications, in particular I need good reporting

Re: Python is slow

2008-05-23 Thread M�ta-MCI (MVP)
Bonsoir ! Perso, je pense que des précisions comme celles de Bruno sont très utiles, car elles évitent les dérives, et l'apparition de langages bâtards, et impurs (pythonesquement parlant). Non aux Pythons OGM !!! Toutefois, iles est dommage que je comprenne pas l'anglais, et donc pas

Re: Another Question

2008-05-23 Thread Gandalf
you've been very helpful but still i have only one problem. I wont the window not to be close after clicking the X button. I wont the program to stay on the toolbar thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is math.pi slightly wrong?

2008-05-23 Thread Mensanator
On May 23, 12:39 am, Andrew Lee <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On May 22, 11:32 am, "Dutton, Sam" <[EMAIL PROTECTED]> wrote: > >> I've noticed that the value of math.pi -- just entering it at the > >> interactive prompt -- is returned as 3.1415926535897931, whereas (as every >

Re: can python do some kernel stuff?

2008-05-23 Thread Jimmy
On May 24, 12:34 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jimmy schrieb: > > > > > On May 23, 11:14 pm, Jimmy <[EMAIL PROTECTED]> wrote: > >> On May 23, 5:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > >>> Jimmy schrieb: > On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]>

Re: Using MySQLdb to select into the local file

2008-05-23 Thread Nikhil
John Nagle wrote: Nikhil wrote: I am using the MySQLdb python module. I have a table named 'testing' with few columns, under the 'test' database, what is hosted on a remote mysql server. I want to run the following query to get a comma-separated information from the table LOCK TABLES foo

Re: Python is slow

2008-05-23 Thread Andrii V. Mishkovskyi
2008/5/22 cm_gui <[EMAIL PROTECTED]>: > 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 PHP, are so much faster

Re: How to print a sorted list as a multi-column table

2008-05-23 Thread Mensanator
On May 23, 10:30 am, Sverker Nilsson <[EMAIL PROTECTED]> wrote: > Hi all, > > I would like to ask about opinions about the best way to format sorted > tables of items for interactive use. I have begun to add interactive > help to Guppy/Heapy (http://guppy-pe.sourceforge.net) because it lacks > the

Re: Segmentation fault on updating a BYTEA field [psycopg2]

2008-05-23 Thread George Sakkis
On May 21, 6:32 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > I have a simple DB table that stores md5 signature pairs: > >Table "public.duplicate" > Column | Type | Modifiers > --+---+--- > sig | bytea | not null > orig_sig | bytea | not null > Indexes: > "

Re: Python is slow

2008-05-23 Thread Aaron Lance
Troll much? -- http://mail.python.org/mailman/listinfo/python-list

Re: Database Query Contains Old Data

2008-05-23 Thread Paul Boddie
On 23 Mai, 17:18, John Nagle <[EMAIL PROTECTED]> wrote: > > Exactly. Although it seems counterintutive, it's not enough > to do a COMMIT after UPDATE and INSERT operations. You also have to > do a COMMIT after a SELECT if you're going to reuse the database handle > and do another SELECT. Ot

Re: array of 64-bit ints?

2008-05-23 Thread Martin v. Löwis
> Is it possible to have an array of 64-bit-ints using the standard Python > array module? On my 64-bit architecture (AMD64, MSVC), both "int" and > "long int" are 32 bit integers. To declare 64-bit ints, one needs either > "long long int" or "size_t". However, according to the Python array

RE: webspider, regexp not working, why?

2008-05-23 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Friday, May 23, 2008 12:43 PM > To: python-list@python.org > Subject: webspider, regexp not working, why? > > url = re.compile(r"^((ht|f)tp(s?)\:\/\/|~/|/)?([\w]+:\

Re: Relationship between GUI and logic?

2008-05-23 Thread Matthew Woodcraft
John Salerno <[EMAIL PROTECTED]> wrote: > Basically, the question is this: can you write the logic behind a > program (whether it be a game, an email client, a text editor, etc.) > without having any idea of how you will implement the GUI? You probably could, but it's best not to unless you're

Re: Another Question

2008-05-23 Thread Mike Driscoll
On May 23, 12:02 pm, Gandalf <[EMAIL PROTECTED]> wrote: > On May 23, 6:25 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On May 23, 10:45 am, Gandalf <[EMAIL PROTECTED]> wrote: > > > > How can i bind function that handle the mouse clicking  window X event > > > or clicking alt+F4 > > > > th

array of 64-bit ints?

2008-05-23 Thread Stephen Vavasis
Is it possible to have an array of 64-bit-ints using the standard Python array module? On my 64-bit architecture (AMD64, MSVC), both "int" and "long int" are 32 bit integers. To declare 64-bit ints, one needs either "long long int" or "size_t". However, according to the Python array document

Re: Shell-independent *nix setup script

2008-05-23 Thread scott . hafeman
On May 22, 5:29 pm, brad <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > Is it worthwhile maintaining a production application setup script in > > Python as opposed to shell-script?   > > I do not think so. Perhaps 'in conjunction with', but not 'opposed > to'... sh is the lowest

Re: Another Question

2008-05-23 Thread Gandalf
On May 23, 6:25 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On May 23, 10:45 am, Gandalf <[EMAIL PROTECTED]> wrote: > > > How can i bind function that handle the mouse clicking window X event > > or clicking alt+F4 > > > thanks > > You really need to learn to ask good questions. Unless people d

webspider, regexp not working, why?

2008-05-23 Thread notnorwegian
url = re.compile(r"^((ht|f)tp(s?)\:\/\/|~/|/)?([\w]+:\w+@)?([a-zA-Z] {1} ([\w\-]+\.)+ ([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)? (& \w+=\w+)*)?") why isnt this url catching something like: http://www.showmedo.com/latestVideoFeed/rss2.0? tag=python" /> site = urllib.url

Re: call f(a, *b) with f(*a, **b) ?

2008-05-23 Thread bukzor
On May 23, 3:29 am, "inhahe" <[EMAIL PROTECTED]> wrote: > "inhahe" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > if we assume the constraints are that: > > 1.he has list, l > > 2.he has a dictionary, d > > 3.he wants the function to print the values in the dictionary accordi

Re: can python do some kernel stuff?

2008-05-23 Thread Diez B. Roggisch
Jimmy schrieb: On May 23, 11:14 pm, Jimmy <[EMAIL PROTECTED]> wrote: On May 23, 5:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: Jimmy schrieb: On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]> wrote: Jimmy wrote: Hi to all python now has grown to a versatile language that can acco

Re: Another Question

2008-05-23 Thread Mike Driscoll
On May 23, 10:45 am, Gandalf <[EMAIL PROTECTED]> wrote: > How can i bind function that handle the mouse clicking  window X event > or clicking alt+F4 > > thanks You really need to learn to ask good questions. Unless people dive into your previous posts, they won't know what Python GUI toolkit you

Re: call f(a, *b) with f(*a, **b) ?

2008-05-23 Thread bukzor
On May 23, 3:29 am, "inhahe" <[EMAIL PROTECTED]> wrote: > "inhahe" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > if we assume the constraints are that: > > 1.he has list, l > > 2.he has a dictionary, d > > 3.he wants the function to print the values in the dictionary accordi

Re: Relationship between GUI and logic?

2008-05-23 Thread Bruno Desthuilliers
David C. Ullrich a écrit : On Fri, 23 May 2008 09:13:50 -0400, "John Salerno" <[EMAIL PROTECTED]> wrote: "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Ever heard of the "Model/View/Controller" pattern ? Yes, I have, but I probably don't understand it well en

Re: Decorator metaclass

2008-05-23 Thread Thomas Karolski
Thanks for pointing out all those mistakes. I think I'm already starting to grasp all of the python magic going on in there. Parenthetical: I don't normally recommend this style, since it obscures the fact that you're using a custom metaclass to the user. That is something the user probably wou

Another Question

2008-05-23 Thread Gandalf
How can i bind function that handle the mouse clicking window X event or clicking alt+F4 thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow

2008-05-23 Thread Brian Blais
On May 23, 2008, at May 23:10:11 AM, Grant Edwards wrote: On 2008-05-23, RPM1 <[EMAIL PROTECTED]> wrote: Larry Bates wrote: If your Python program is slow, you have almost assuredly approached it with a wrong method or algorithm. I agree for most applications. There are however times where

Re: Producing multiple items in a list comprehension

2008-05-23 Thread Paul Hankin
On May 22, 7:21 pm, "Joel Koltner" <[EMAIL PROTECTED]> wrote: > Is there an easy way to get a list comprehension to produce a flat list of, > say, [x,2*x] for each input argument? > > E.g., I'd like to do something like: > > [ [x,2*x] for x in range(4) ] [x * i for x in xrange(4) for i in xrange(1

How to print a sorted list as a multi-column table

2008-05-23 Thread Sverker Nilsson
Hi all, I would like to ask about opinions about the best way to format sorted tables of items for interactive use. I have begun to add interactive help to Guppy/Heapy (http://guppy-pe.sourceforge.net) because it lacks the usual ways for introspection (see for example http://www.pkgcore.org/trac/p

Re: can python do some kernel stuff?

2008-05-23 Thread Jimmy
On May 23, 11:14 pm, Jimmy <[EMAIL PROTECTED]> wrote: > On May 23, 5:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > Jimmy schrieb: > > > > On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]> wrote: > > >> Jimmy wrote: > > >>> Hi to all > > >>> python now has grown to a versatile lang

Re: unittest: Calling tests in liner number order

2008-05-23 Thread Quentin Gallet-Gilles
I personally don't see any benefit in this approach. By definition, unittests should be independent, so the order argument suggests a deeper issue. What's your use case ? Quentin On Fri, May 23, 2008 at 11:36 AM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Some time ago I asked whether is would

Re: can python do some kernel stuff?

2008-05-23 Thread Jimmy
On May 23, 5:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jimmy schrieb: > > > On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]> wrote: > >> Jimmy wrote: > >>> Hi to all > >>> python now has grown to a versatile language that can > >>> accomplish tasks for many different purposes. Howeve

Re: Database Query Contains Old Data

2008-05-23 Thread John Nagle
Paul Boddie wrote: On 21 Mai, 15:22, [EMAIL PROTECTED] wrote: I did and I confirmed this by modifying the data, selecting it from the mysql command line client to verify the changes, then running the report again. If I exit the application and then start it again, everything works as expected un

Re: unittest: Calling tests in liner number order

2008-05-23 Thread John Roth
On May 23, 3:36 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Some time ago I asked whether is would be possible that unittest would > perform the test in order of appearence in the file. > > The answers seemed to be negative. Since I really would like this > behaviour I took the trouble of lookin

Re: Relationship between GUI and logic?

2008-05-23 Thread David C. Ullrich
On Fri, 23 May 2008 09:13:50 -0400, "John Salerno" <[EMAIL PROTECTED]> wrote: >"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in >message news:[EMAIL PROTECTED] >> Ever heard of the "Model/View/Controller" pattern ? > >Yes, I have, but I probably don't understand it well enough yet. For >exampl

Re: php vs python

2008-05-23 Thread Michael Fesser
.oO(Duncan Booth) >Michael Fesser <[EMAIL PROTECTED]> wrote: > >> The only little problem is that PHP doesn't have native Unicode >> support yet, which will change with PHP 6. But of course you can still >> use UTF-8 without any trouble, I do it all the time. You just have to >> keep in mind that

Re: Relationship between GUI and logic?

2008-05-23 Thread Bruno Desthuilliers
John Salerno a écrit : "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Ever heard of the "Model/View/Controller" pattern ? Yes, I have, but I probably don't understand it well enough yet. For example, I don't really know what is meant by phrases like "build

Re: Misuse of list comprehensions?

2008-05-23 Thread duncan smith
Simon Forman wrote: On May 21, 4:36 am, Bruno Desthuilliers wrote: Simon Forman a écrit : On May 20, 8:58 am, Paul McGuire <[EMAIL PROTECTED]> wrote: On May 20, 10:50 am, [EMAIL PROTECTED] wrote: You don't need all those conditionals. A set differs from a list precisely in the fact that e

Re: Code For Five Threads To Process Multiple Files?

2008-05-23 Thread tdahsu
On May 23, 12:20 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 22 May 2008 11:03:48 -0700 (PDT), [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > Ah, well, I didn't get any other responses, but here's what I've done: > >         Apparently the direct email from my

Re: Producing multiple items in a list comprehension

2008-05-23 Thread Yves Dorfsman
Peter Otten <[EMAIL PROTECTED]> wrote: > The speed gain is significant. Why should I throw away useful information if > I have it? My thinking was that it wasn't generic enough, and I was looking for a solution that would work for more generic problem. I agree, I shouldn't have used the world "e

Re: php vs python

2008-05-23 Thread Duncan Booth
Michael Fesser <[EMAIL PROTECTED]> wrote: > .oO(Duncan Booth) > >>On those rare occasions when I've helped someone who wanted advice >>I've found that my Python oriented viewpoint can be quite hard to >>translate to PHP. For example I'd suggest 'oh you just encode that as >>utf8' only to be told

Re: pyserial and file open conflict?

2008-05-23 Thread Grant Edwards
On 2008-05-23, Peter <[EMAIL PROTECTED]> wrote: > On 15 Maj, 19:37, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2008-05-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> > I have a small but rather annoying problem withpyserial. I want to >> > open a file on disk for reading and then open a

Genuine Lifetime Income!! Earn!! = 10,000 US Dollars per month without Investmen

2008-05-23 Thread cashm491
You Have Finally Found It Genuine Lifetime Income!! Earn!! à 10,000 US Dollars per month without Investment http://seniorfriendfinder.com/go/g970599-pmem Earn!! à 10,000 US Dollars per month without Investment By working only one hour per day from the cyber café or PC -- http://mail.python.org/mail

  1   2   >