Re: Help me understand this

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 23:05:37 -0800, ArdPy wrote: > Hi, > > Pls tell me whats going on in the code snippet below: > n = 10 statstr = "N = ",n type(statstr) #case1 > print statstr > ('N = ', 10) print "N = ",n

Re: Data structure and algorithms

2007-01-29 Thread Beej
On Jan 29, 10:15 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > The instructor learned his lesson: no more assignments > done in "any language I can understand" Without naming names, there was a person at my university who gained a certain amount of notoriety by implementing a file system fo

Re: Data structure and algorithms

2007-01-29 Thread Beej
On Jan 29, 1:50 pm, "azrael" <[EMAIL PROTECTED]> wrote: > thanks guys. i see that there is no way then to go back to C to > satisfy my prof and get a grade Seconding what Dennis says below, it is totally possible to use Python for this. I didn't mean to discourage you from using Python--I just w

Help me understand this

2007-01-29 Thread ArdPy
Hi, Pls tell me whats going on in the code snippet below: >>> n = 10 >>> statstr = "N = ",n >>> type(statstr) #case1 >>> print statstr ('N = ', 10) >>> print "N = ",n #case 2 N = 10 In the first case the result is printed as a tuple

Re: parent-child object design question

2007-01-29 Thread Ben Finney
"manstey" <[EMAIL PROTECTED]> writes: > I have two classes. The first one wraps around an old-style class > called oref > > Class CacheClass(object): > def __init__(self, obj): > self.__data = obj > def __getattr__(self, attr): > return getattr(self.__data, attr) I presume

Re: List Behavior when inserting new items

2007-01-29 Thread André Malo
* Paul McGuire wrote: >> py>def __init__(self, arg = []): >> py>self.__list = arg > > Please don't perpetuate this bad habit!!! "arg=[]" is evaluated at > compile time, not runtime, and will give all default-inited llists the > same underlying list. While this actually might be bad

emulate a serial port in windows (create a virtual 'com' port)

2007-01-29 Thread Pom
Hello how can I emulate a serial port in windows? I want to intercept data sent to a 'com'port by a proprietary program. It sends statistics to a serial display, and I want that data in my python program (that display isn't needed). Is this possible? I've seen this kind of serial ports bei

parent-child object design question

2007-01-29 Thread manstey
Hi, I am having trouble designing my classes. I have two classes. The first one wraps around an old-style class called oref Class CacheClass(object): def __init__(self, obj): self.__data = obj def __getattr__(self, attr): return getattr(self.__data, attr) The second cl

Re: Ip address

2007-01-29 Thread Steve Holden
Toby A Inkster wrote: > Steve Holden wrote: > >> There is absolutely no need to know the IP address of "your router" to >> communicate with Internet devices. Either your IP layer is configured to >> know the addresses of one or more routers, or it has discovered those >> address by dynamic mean

Re: pdf to text

2007-01-29 Thread Steve Holden
tubby wrote: > Dieter Deyke wrote: >>> sout = os.popen('pdftotext "%s" - ' %f) > >> Your program above should read: >> >>sout = os.popen('pdftotext "%s" - ' % (f,)) > > What is the significance of doing it this way? It's actually just nit-picking - as long as you know f is never going to

Re: creating a dictionary

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 23:45:40 -0300, mark <[EMAIL PROTECTED]> escribió: > i have few variables and i want to create a dictionary with these > variables > such that the keys are the variable names and the corresponding values > are the variable values.how do i do this easily? > for ex: > var1='mar

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 01:58:39 -0300, NoName <[EMAIL PROTECTED]> escribió: > Perl: > @char=("A".."Z","a".."z",0..9); > do{print join("",@char[map{rand @char}(1..8)])}while(<>); > > !!generate passwords untill U press ctrl-z > > > > Python (from CookBook): > > from random import choice > import strin

Re: log parser design question

2007-01-29 Thread avidfan
On 28 Jan 2007 21:20:47 -0800, "Paul McGuire" <[EMAIL PROTECTED]> wrote: >On Jan 27, 10:43 pm, avidfan <[EMAIL PROTECTED]> wrote: >> I need to parse a log file using python and I need some advice/wisdom >> on the best way to go about it: >> >> The log file entries will consist of something like th

Re: The reliability of python threads

2007-01-29 Thread Steve Holden
Carl J. Van Arsdall wrote: > Aahz wrote: >> [snip] >> >> My response is that you're asking the wrong questions here. Our database >> server locked up hard Sunday morning, and we still have no idea why (the >> machine itself, not just the database app). I think it's more important >> to focus on w

Re: deepcopy alternative?

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 20:17:11 -0300, <"none <"@bag.python.org> escribió: > I have a very complex data structure which is basically a class object > containing (sometimes many) other class objects, What are "class objects"? instances of a given class, or a class itself? > function references, > in

Re: Off-Topic Posts

2007-01-29 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Jan 27, 1:31 pm, Jim Klein <[EMAIL PROTECTED]> wrote: >> I'm not one of the conquered races, I'm Swiss. We are the bankers to >> the conquerers. :-) > > Exactly, Honorable J Klein, (although my reference was a general one, > you have entered the thread, so I will pic

Re: Convert raw data to XML

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 23:42:07 -0300, <[EMAIL PROTECTED]> escribió: > For example the raw data is as follows > > SomeText Description>PassorFail > > without spaces or new lines. I need this to be written into an XML > file as > [same content but nicely indented] Is the file supposed to be processe

Re: interactive prompt in IDLE

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 10:16:32 -0300, Jan Kanis <[EMAIL PROTECTED]> escribió: > Hello everyone, > > I'm trying to change the interactive python prompt. According to the docs > this is done by changing sys.ps1 and sys.ps2 . That works fine when > running python interactively from a command line, bu

Re: sending a class as an argument

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 01:24:23 -0300, manstey <[EMAIL PROTECTED]> escribió: > > Our class has its attributes set as classes, as in > > MyClass.Phone.Value='34562346' > MyClass.Phone.Private=True > > Inside the MyClass definition we have a function like this: > > def MyFunc(self,clsProperty): >if

Re: Getting the output from a console command while it's been generated!

2007-01-29 Thread Gabriel Genellina
En Sun, 28 Jan 2007 23:54:03 -0300, Raúl Gómez C. <[EMAIL PROTECTED]> escribió: > I can't use the subprocess module because my app needs to be compatible > with > Python 2.3 so, is there another approach to this problem??? Any variant of popen; see the popen2 module (but read the last notes o

Python 2.5 Tkinter not configured

2007-01-29 Thread Jim
I compiled Python 2.5 from python.org and I get an error message when I try to import the Tkinter module. Python reports that there is no such module. It says my Python isn't configured for Tkinter. How do I configure it? I'm using GCC 4.1.1 to compile the tarball. Thanks for any help with this. J

Secret Technology of THERMATE and 911 Crime

2007-01-29 Thread thermate
Excellent Technology, and photos: http://stj911.org/jones/focus_on_goal.html As scientists, we look at the evidence, perform experiments, and apply the Scientific Method. The Greek method was to look at the evidence (superficially) and then try to explain things through logic and debate. The G

Re: Convert raw data to XML

2007-01-29 Thread Justin Ezequiel
On Jan 30, 10:42 am, [EMAIL PROTECTED] wrote: > For example the raw data is as follows > > SomeText Description>PassorFail > > without spaces or new lines. I need this to be written into an XML > file as > > > > > > > SomeText >

Re: error messages containing unicode

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 18:01:56 -0800, Jim wrote: > Hello, > > I'm trying to write exception-handling code that is OK in the > presence > of unicode error messages. I seem to have gotten all mixed up and > I'd > appreciate any un-mixing that anyone can give me. [snip] >>> class MyException(Exce

creating a dictionary

2007-01-29 Thread mark
i have few variables and i want to create a dictionary with these variables such that the keys are the variable names and the corresponding values are the variable values.how do i do this easily? for ex: var1='mark' var2=['1','2','3'] my_dict = create_my_dictionary(var1, var2) and my_dict is {'va

Convert raw data to XML

2007-01-29 Thread elrondrules
Hi I am running a HTTP server which receives post from a process. In my do_POST method am receiving raw data. I know that this raw data has a valid XML content and I need to convert this into an XML file. Are there any routines to do this.. if not how to write one.. For example the raw data is

Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread Hampton Din
still a stupid troll. -- http://mail.python.org/mailman/listinfo/python-list

error messages containing unicode

2007-01-29 Thread Jim
Hello, I'm trying to write exception-handling code that is OK in the presence of unicode error messages. I seem to have gotten all mixed up and I'd appreciate any un-mixing that anyone can give me. I'm used to writing code like this. class myException(Exception): pass fn='README'

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 08:38:13 -0800, Szabolcs Nagy wrote: >>> why use xrange? range is faster and simpler for small ranges That is not true. >>> import timeit >>> timeit.Timer("range(50)", "").repeat() [2.8599629402160645, 2.8296849727630615, 2.8609859943389893] >>> timeit.Timer("xrange(50)", "")

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 16:24:18 +0100, Laszlo Nagy wrote: > NoName írta: >> Hmmm.. >> In the Perl example password generates after user hit ENTER not >> continously like in Python you wrote... :) >> >> i want see various ways to generate passwords even if they some >> indirect like using BASE64 >>

Re: The reliability of python threads

2007-01-29 Thread Aahz
In article <[EMAIL PROTECTED]>, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> >> My response is that you're asking the wrong questions here. Our database >> server locked up hard Sunday morning, and we still have no idea why (the >> machine itself, not just the database app). I t

Re: set update in 2.5

2007-01-29 Thread Duncan Smith
Peter Otten wrote: > Duncan Smith wrote: > > >> In moving from 2.4 to 2.5 I find that some of my unit tests are now >>failing. I've worked out that the problem relates to the set update >>method. In 2.4 I could update a set with an iterable type derived from >>dict as the argument. I now f

Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread Michael L Torrie
On Mon, 2007-01-29 at 15:47 -0800, [EMAIL PROTECTED] wrote: > I know this is a useless gesture, but my normal tolerance for such behavior has reached an end. Please stop spamming this list with off-topic profanities. Your ramblings have nothing to do with programming in Python (this is a compute

Re: deepcopy alternative?

2007-01-29 Thread Szabolcs Nagy
> I believe the only thing stopping me from doing a deepcopy is the > function references, but I'm not sure. If so is there any way to > transform a string into a function reference(w/o eval or exec)? what's your python version? for me deepcopy(lambda:1) does not work in py2.4 but it works in py2

Bush, clean up your shit and farts before you leave - Hillary Clinton

2007-01-29 Thread thermate
But Bush was merely an ego front for the neocons ... He spoke their speeches, signed their recommendations, and ordered their wars, go and listen to Benjamin Friedman's excellent video in his very passionate voice ... http://video.google.com/videoplay?docid=3552214685532803163&q =

Another link to the audio of radio interview by Dinesh D'Souza - HILLARIOUS

2007-01-29 Thread thermate
"http://a1135.g.akamai.net/f/1135/18227/1h/ cchannel.download.akamai.com/18227/podcast/PORTLAND-OR/KPOJ-AM/ 1-23-07%20POJ-cast.mp3?CPROG=PCAST&MARKET=PORTLAND- OR&NG_FORMAT=newstalk&SITE_ID=674&STATION_ID=KPOJ- AM&PCAST_AUTHOR=AM620_KPOJ&PCAST_CAT=Talk_Radio&PCAST_TITLE=Thom_Hartma nn_Podcast" htt

Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread thermate
Listen you mother fucker VULTURE, the past cold war was with soviet block, NOW the whole world hates you ... bastard you need friends, but now with your 911 in which YOU KILLED YOUR OWN CITIZENS, you are THE MOST ODIOUS NATION ON EARTH. YOU NEED FRIENDS, your biggest perceived rival CHINA is the m

Re: Conversion of string to integer

2007-01-29 Thread John Machin
On Jan 30, 6:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jan 29, 2:55 pm, "jupiter" <[EMAIL PROTECTED]> wrote: > > > > > Hi guys, > > > I have a problem. I have a list which contains strings and numeric. > > What I want is to compare them in loop, ignore string and create > > anot

Re: Overloading assignment operator

2007-01-29 Thread Michael Spencer
J. Clifford Dyer wrote: > I think that's the first time I've actually seen someone use a Monty > Python theme for a python example, and I must say, I like it. However, > "We are all out of Wensleydale." > > Cheers, > Cliff Oh, then you clearly don't waste nearly enough time on this newsgroup ;

Re: python 2.3 module ref

2007-01-29 Thread Szabolcs Nagy
> any pointers to a 2.3 module ref? also look at: http://rgruet.free.fr/PQR2.3.html#OtherModules when coding for different python versions i can reccommend this quick ref: http://rgruet.free.fr/ (every language feature is colorcoded according to the version when it was included) -- http://m

select windows

2007-01-29 Thread Siqing Du
Hi, Is there is a way to write a program to select and switch between windows? For instance, if I have three windows: Firefox, Thunderbird, and emacs, can I run a program to bring up the desired windows, instead of click on the windows use mouse. Thanks, Du -- http://mail.python.org/mailman/li

deepcopy alternative?

2007-01-29 Thread none
I have a very complex data structure which is basically a class object containing (sometimes many) other class objects, function references, ints, floats, etc. The man for the copy module states pretty clearly that it will not copy methods or functions. I've looked around for a while (prob ju

python-list@python.org

2007-01-29 Thread Pappy
SHORT VERSION: Python File B changes sys.stdout to a file so all 'prints' are written to the file. Python file A launches python file B with os.popen("./B 2>&^1 >dev/null &"). Python B's output disappears into never-never land. LONG VERSION: I am working on a site that can kick off large-scal

Re: [Boost.Graph] graph.vertices property creates new objects

2007-01-29 Thread Szabolcs Nagy
> It seems that the vertices iterator creates new vertex objects every > time instead of iterating over the existing ones. This essentially i don't know much about bgl, but this is possible since vertices are most likely not stored as python objects inside boost > prevents, among other things, s

Re: ctypes: Setting callback functions in C libraries

2007-01-29 Thread [EMAIL PROTECTED]
I realized my wrapping was broken, fixing that below... On Jan 25, 12:47 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to wrap GNU readline withctypes(the Python readline > library doesn't support the callback interface), but I can't figure out > how to set values to a variable

Re: Overloading assignment operator

2007-01-29 Thread J. Clifford Dyer
Steven D'Aprano wrote: > On Tue, 23 Jan 2007 18:07:55 -0800, Russ wrote: > >> Achim Domma wrote: >>> Hi, >>> >>> I want to use Python to script some formulas in my application. The user >>> should be able to write something like >>> >>> A = B * C >>> >>> where A,B,C are instances of some wrapper c

Re: Bush, yank bastards kicked by india in their arse Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-29 Thread thermate
On Jan 29, 11:15 am, "Vance P. Frickey" <[EMAIL PROTECTED]> wrote: > Directorate (overseas espionage), his old employers owned > someone in just about every important government agency in > India, from the 1970s until they stopped being able to > afford paying all those bribes. But in this anglo-

Re: The reliability of python threads

2007-01-29 Thread Carl J. Van Arsdall
Hendrik van Rooyen wrote: > [snip] >> could definitely do more of them. The thing will be >> > > When I read this - I thought - probably your stuff is working > perfectly - on your test cases - you could try to send it some > random data and to see what happens - seeing as you have a test

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread NoName
WOW! :shock: in this case: while 1:i=__import__;print i('binascii').b2a_base64(i('os').urandom(6)),;raw_input() On 30 Янв., 04:06, "Szabolcs Nagy" <[EMAIL PROTECTED]> wrote: > > while > > 1:i=__import__;print''.join(i('random').choice(i('string').letters > > +'1234567890')for x in range(8)),;r

Re: Data structure and algorithms

2007-01-29 Thread azrael
thanks guys. i see that there is no way then to go back to C to satisfy my prof and get a grade -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling extension with Visual C++ Toolkit Compiler - MSVCR80.dll

2007-01-29 Thread Peter Wang
On Jan 29, 2:47 pm, [EMAIL PROTECTED] wrote: > The library seems to build correctly (producing Polygon.py and > cPolygon.pyd), but when I import it I get the following message from > python.exe: "This application has failed to start because MSVCR80.dll > was not found". I thought that this might be

We sell to everyone!!! Government, Wholesalers, Distributers, Entreprenuers.....www.martin-global.com

2007-01-29 Thread Martin Global
Martin Global is one of North America's leading importers of goods manufactured and produced throughout Asia. We are distinctively unique from other importers, as we have one of North America's largest networks linking our organization directly to thousands of manufacturers and suppliers in

We sell to everyone!!! Government, Wholesalers, Distributers, Entreprenuers.....www.martin-global.com

2007-01-29 Thread Martin Global
Martin Global is one of North America's leading importers of goods manufactured and produced throughout Asia. We are distinctively unique from other importers, as we have one of North America's largest networks linking our organization directly to thousands of manufacturers and suppliers in

Re: strip question

2007-01-29 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > hi > can someone explain strip() for these : > [code] > x='www.example.com' x.strip('cmowz.') > > 'example' > [/code] > > when i did this: > [code] > x = 'abcd,words.words' x.strip(',.') > > 'abcd,words.words' > [/code] > > it does not strip off "

Re: Compiling extension with Visual C++ Toolkit Compiler - MSVCR80.dll

2007-01-29 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > The library seems to build correctly (producing Polygon.py and > cPolygon.pyd), but when I import it I get the following message from > python.exe: "This application has failed to start because MSVCR80.dll > was not found". I thought that this might be due to Python

Re: Sourcing Python Developers

2007-01-29 Thread Kartic
Paul Rubin sayeth, on 01/29/2007 03:44 PM: > Kartic <[EMAIL PROTECTED]> writes: >> In any case, we have immediate requirements for a Pythonista with C++, >> MySQL, XML, Debian expertise. Please email resume to: > > Generally it's ok to post here to the newsgroup with Python jobs. But > you shoul

Re: List Behavior when inserting new items

2007-01-29 Thread Bruno Desthuilliers
Drew a écrit : >>What is your actual usecase? >> >>diez > > > The issue is that I don't know how long the list will eventually be. How is this an issue ? Python's lists are not fixed-sized arrays. > Essentially I'm trying to use a 2D list to hold lines that I will > eventually print to the sc

Re: Executing Javascript, then reading value

2007-01-29 Thread Melih Onvural
Thanks, let me check out this route, and then I'll post the results. Melih Onvural On Jan 29, 4:04 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 29 Jan 2007 12:44:07 -0800, Melih Onvural <[EMAIL PROTECTED]> wrote: > > >I need to execute some javascript and then read the value as part of

Re: python 2.3 module ref

2007-01-29 Thread Martin v. Löwis
David Bear schrieb: > Since redhat packages python2.3 with their distro (RHEL 4..) I was looking > for a module reference for that version. Looking at python.org I only see > current documentation. > > any pointers to a 2.3 module ref? http://www.python.org/doc/2.3/ http://www.python.org/doc/2.3/

Re: List Behavior when inserting new items

2007-01-29 Thread Drew
> > Is there any way to produce this kind of behavior easily?Hints: > >>> [None] * 5 > [None, None, None, None, None] > >>> [1, 2, 3, None] + [10] > [1, 2, 3, None, 10] > > HTH That is exactly what I was looking for. I'm actually working on some problems at http://codgolf.com. I find it helps

Re: Convert from unicode chars to HTML entities

2007-01-29 Thread Martin v. Löwis
Steven D'Aprano schrieb: > A few issues: > > (1) It doesn't seem to be reversible: > '© and many more...'.decode('latin-1') > u'© and many more...' > > What should I do instead? For reverse processing, you need to parse it with an SGML/XML parser. > (2) Are XML entities guaranteed to be t

Re: python 2.3 module ref

2007-01-29 Thread Robert Kern
David Bear wrote: > Since redhat packages python2.3 with their distro (RHEL 4..) I was looking > for a module reference for that version. Looking at python.org I only see > current documentation. > > any pointers to a 2.3 module ref? http://docs.python.org/ Click on "Locate previous versions."

Re: Executing Javascript, then reading value

2007-01-29 Thread Jean-Paul Calderone
On 29 Jan 2007 12:44:07 -0800, Melih Onvural <[EMAIL PROTECTED]> wrote: >I need to execute some javascript and then read the value as part of a >program that I am writing. I am currently doing something like this: Python doesn't include a JavaScript runtime. You might look into the stand-alone Sp

python 2.3 module ref

2007-01-29 Thread David Bear
Since redhat packages python2.3 with their distro (RHEL 4..) I was looking for a module reference for that version. Looking at python.org I only see current documentation. any pointers to a 2.3 module ref? -- David Bear -- let me buy your intellectual property, I want to own your thoughts -- --

Re: List Behavior when inserting new items

2007-01-29 Thread Bruno Desthuilliers
Drew a écrit : > I'm looking to add an element to list of items, however I'd like to > add it at a specific index greater than the current size: > > list = [1,2,3] NB: better to avoid using builtins types and functions names as identifiers. > list.insert(10,4) > > What I'd like to see is somet

Re: List Behavior when inserting new items

2007-01-29 Thread [EMAIL PROTECTED]
On Jan 29, 1:10 pm, "Drew" <[EMAIL PROTECTED]> wrote: > > What is your actual usecase? > > > diezThe issue is that I don't know how long the list will eventually be. > Essentially I'm trying to use a 2D list to hold lines that I will > eventually print to the screen. Blank elements in the list wi

Compiling extension with Visual C++ Toolkit Compiler - MSVCR80.dll

2007-01-29 Thread alexandre_irrthum
Hi there, I am trying to install a Python library with a C extension (the Polygon library) and I am having a bad time. My Python version is Python 2.4.3 - Enthought Edition 1.0.0 (#69, Aug 2 2006, 12:09:59) [MSC v.1310 32 bit (Intel)] on Windows XP Pro. I have dutifully followed the instructi

Re: Sourcing Python Developers

2007-01-29 Thread Paul Rubin
Kartic <[EMAIL PROTECTED]> writes: > In any case, we have immediate requirements for a Pythonista with C++, > MySQL, XML, Debian expertise. Please email resume to: Generally it's ok to post here to the newsgroup with Python jobs. But you should describe the specific openings you're trying to fill

Executing Javascript, then reading value

2007-01-29 Thread Melih Onvural
I need to execute some javascript and then read the value as part of a program that I am writing. I am currently doing something like this: import htmllib, urllib, formatter class myparser(htmllib.HTMLParser): insave = 0 def start_div(self, attrs): for i in attrs:

Re: Python does not play well with others

2007-01-29 Thread Bruno Desthuilliers
John Nagle a écrit : (snip) >My main concern is with glue code to major packages. The connections > to OpenSSL, MySQL, and Apache (i.e. mod_python) all exist, but have major > weaknesses. Neither MySQLdb nor mod_python are part of the Python's standard lib AFAIK. > If you're doing web app

Re: List Behavior when inserting new items

2007-01-29 Thread Paul McGuire
> py>def __init__(self, arg = []): > py>self.__list = arg Please don't perpetuate this bad habit!!! "arg=[]" is evaluated at compile time, not runtime, and will give all default-inited llists the same underlying list. The correct idiom is: def __init__(self, arg = None):

Re: SQL connecting

2007-01-29 Thread Scripter47
John Nagle skrev: > Scripter47 wrote: >> Hey >> >> It got a problem with python to connect to my SQL DBs, that's installed >> on my apache server. how do i connect to sql? Gettting data? Insert into >> it? > > You need a third-party open source package called "MySQLdb". > >

Re: Conversion of string to integer

2007-01-29 Thread [EMAIL PROTECTED]
On Jan 29, 2:55 pm, "jupiter" <[EMAIL PROTECTED]> wrote: > Hi guys, > > I have a problem. I have a list which contains strings and numeric. > What I want is to compare them in loop, ignore string and create > another list of numeric values. > > I tried int() and decimal() but without success. > >

Re: SQL connecting

2007-01-29 Thread John Nagle
Scripter47 wrote: > Hey > > It got a problem with python to connect to my SQL DBs, that's installed > on my apache server. how do i connect to sql? Gettting data? Insert into > it? You need a third-party open source package called "MySQLdb". John Nagl

Re: List Behavior when inserting new items

2007-01-29 Thread [EMAIL PROTECTED]
On Jan 29, 7:57 pm, "Drew" <[EMAIL PROTECTED]> wrote: > I'm looking to add an element to list of items, however I'd like to > add it at a specific index greater than the current size: > > list = [1,2,3] > list.insert(10,4) > > What I'd like to see is something like: > > [1,2,3,,4] > > However I

Re: Conversion of string to integer

2007-01-29 Thread Adam
On Jan 29, 1:55 pm, "jupiter" <[EMAIL PROTECTED]> wrote: > Hi guys, > > I have a problem. I have a list which contains strings and numeric. > What I want is to compare them in loop, ignore string and create > another list of numeric values. You can iterate over the list and use the type() funct

Re: Bush, yank bastards kicked by india in their arse Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-29 Thread Vance P. Frickey
Hawk wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > you are such a dork. > > India has been a Russian satellite for years and years. > Who has been > running their schools? Not the British. According to Oleg Kalugin, former head of the KGB's First Directorate (overse

SQL connecting

2007-01-29 Thread Scripter47
Hey It got a problem with python to connect to my SQL DBs, that's installed on my apache server. how do i connect to sql? Gettting data? Insert into it? it is a localserver with php if that means something here is a *REALLY* dirty solution that a have used: [CODE] from urllib import * # sql quer

Re: List Behavior when inserting new items

2007-01-29 Thread Drew
> What is your actual usecase? > > diez The issue is that I don't know how long the list will eventually be. Essentially I'm trying to use a 2D list to hold lines that I will eventually print to the screen. Blank elements in the list will be printed as spaces. I suppose every time I add an elem

Re: wxPython StatusBar Help

2007-01-29 Thread Frank Niessink
2007/1/29, herve <[EMAIL PROTECTED]>: Does anybody know how to change the foreground colors in a wx.StatusBar wx.StatusBar is a subclass of wx.Window so SetForegroundColour should work... Cheers, Frank PS: In general, wxPython related questions are best asked on the wxPython-users mailing

Re: List Behavior when inserting new items

2007-01-29 Thread Diez B. Roggisch
Drew schrieb: > I'm looking to add an element to list of items, however I'd like to > add it at a specific index greater than the current size: > > list = [1,2,3] > list.insert(10,4) > > What I'd like to see is something like: > > [1,2,3,,4] > > However I see: > > [1,2,3,4] > > Is there

Re: Sourcing Python Developers

2007-01-29 Thread Kartic
Current requirements in US only. Kartic sayeth, on 01/29/2007 01:56 PM: > Hello, > > My company has quite a few opening involving python expertise. We are > always looking for python resources (and find it difficult filling these > positions, might I add). Is there any place to find developers

List Behavior when inserting new items

2007-01-29 Thread Drew
I'm looking to add an element to list of items, however I'd like to add it at a specific index greater than the current size: list = [1,2,3] list.insert(10,4) What I'd like to see is something like: [1,2,3,,4] However I see: [1,2,3,4] Is there any way to produce this kind of behavior eas

Sourcing Python Developers

2007-01-29 Thread Kartic
Hello, My company has quite a few opening involving python expertise. We are always looking for python resources (and find it difficult filling these positions, might I add). Is there any place to find developers' resumes (like finding jobs from http://python.org/community/jobs/)? If any one k

[Boost.Graph] graph.vertices property creates new objects

2007-01-29 Thread George Sakkis
I've just started toying with the python bindings of BGL and I'm puzzled from the following: >>> from boost.graph import Graph >>> g = Graph() >>> v = g.add_vertex() >>> g.vertices.next() == v True >>> g.vertices.next() is v False It seems that the vertices iterator creates new vertex objects ev

Re: Data structure and algorithms

2007-01-29 Thread Beej
On Jan 28, 2:56 pm, "azrael" <[EMAIL PROTECTED]> wrote: > class Node: > def __init__(self, cargo=None, next=None): > self.cargo = cargo > self.next = next This is OK for the node itself, but maybe you should try writing a LinkedList class that you use: class LinkedList(object): de

Re: Can I undecorate a function?

2007-01-29 Thread Steve Holden
Matthew Wilson wrote: > The decorator as_string returns the decorated function's value as > string. In some instances I want to access just the function f, > though, and catch the values before they've been decorated. > > Is this possible? > > def as_string(f): > def anon(*args, **kwargs): >

Re: Python does not play well with others

2007-01-29 Thread Skip Montanaro
> Andy Dustman, the author of the package is quite responsive to requests > raised in the mysql-python forums on SourceForge > (http://sourceforge.net/forum/?group_id=22307). If you have problems with > MySQLdb, bring them up there. I'm sure Andy will respond. I apologize in advance for beating

Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread Frank Arthur
Islamist bastard <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > FBI spook bastard that speaks french also > > On Jan 29, 8:13 am, "Hampton Din" <[EMAIL PROTECTED]> wrote: >> stupid troll > > -- http://mail.pytho

Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread Frank Arthur
Real funny? Holocaust Deniers Convention in Iran? Sick, sick Islamists! <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > http://a1135.g.akamai.net/f/1135/18227/1h/cchannel.download.akamai.com/ > 18227/podcast/PORTLAND-OR/KPOJ-AM/1-23-07%20POJ-cast.mp3? -- http://mail.python.org/m

Re: Can I undecorate a function?

2007-01-29 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Matt> In some instances I want to access just the function f, though, > Matt> and catch the values before they've been decorated. > > def f(x): > return x * x > > @as_string > def fs(x): > return f(x) or just fs = as_string(f) Kent > > Call the one y

Re: next berlin python-group meeting fr., 2.2.

2007-01-29 Thread Stephan Diehl
Stephan Diehl wrote: > http://starship.python.net/cgi-bin/mailman/listinfo/python-berlin argghhh, wrong link. please try http://starship.python.net/mailman/listinfo/python-berlin -- http://mail.python.org/mailman/listinfo/python-list

next berlin python-group meeting fr., 2.2.

2007-01-29 Thread Stephan Diehl
after a long (veeeyy) long time, I'm pleased to announce our next python meeting in berlin. time: friday 2.2. 7pm place:Cafe & Restaurant UNENDLICH Boetzowstrasse 14 10407 Berlin (Prenzlauer Berg "Boetzowviertel") This is a fun meeting without offical talks. If you haven't done so already, su

Re: Can I undecorate a function?

2007-01-29 Thread Diez B. Roggisch
Matthew Wilson wrote: > The decorator as_string returns the decorated function's value as > string. In some instances I want to access just the function f, > though, and catch the values before they've been decorated. > > Is this possible? > > def as_string(f): > def anon(*args, **kwargs):

Re: Can I undecorate a function?

2007-01-29 Thread skip
Matt> In some instances I want to access just the function f, though, Matt> and catch the values before they've been decorated. def f(x): return x * x @as_string def fs(x): return f(x) Call the one you want. Skip -- http://mail.python.org/mailman/listinfo/python-list

Can I undecorate a function?

2007-01-29 Thread Matthew Wilson
The decorator as_string returns the decorated function's value as string. In some instances I want to access just the function f, though, and catch the values before they've been decorated. Is this possible? def as_string(f): def anon(*args, **kwargs): y = f(*args, **kwargs)

Possible security hole in SSL - was Random Passwords Generation

2007-01-29 Thread John Nagle
Paul Rubin wrote: > "Szabolcs Nagy" <[EMAIL PROTECTED]> writes: > >>file('/dev/urandom').read(6).encode('base64') >>(oneliner and without import sa op requested) > > > Nice, though Un*x dependent (os.urandom is supposed to be portable). Uh oh. I was looking at the Python "SSL" code recentl

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Szabolcs Nagy
> while > 1:i=__import__;print''.join(i('random').choice(i('string').letters > +'1234567890')for x in range(8)),;raw_input() > while 1:i=__import__;r='random';print''.join(i(r).choice(i('string').letters +'1234567890')for x in`r`),;raw_input() even shorter: range -> `'random'` :) -- http://m

Re: stop script w/o exiting interpreter

2007-01-29 Thread Garrick . Peterson
> I want, and the script will stop executing at that line and will > return to the interactive interpreter, as I wish. May I recommend wrapping your main program in a function definition? Such as: main(): # Bulk of your code (use a macro to indent it faster) if __name__ == "__main__":

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Szabolcs Nagy
> If you really want a hack, here it is: > > while 1:print > ''.join(__import__('random').choice(__import__('string').letters+'1234567890') > for x in xrange(8)),;n=raw_input() > > This is a one-liner (though mail transmission may split it up), no > import statements. If someone can come up with an

  1   2   >