Re: Python based unacceptable language filter
"David Pratt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi. Is anyone aware of any python based unacceptable language filter > code to scan and detect bad language in text from uploads etc. > > Many thanks. > David Look up Spambayes - if you can filter on terms like "dear friend" you can filter on the inverse too, no? It needs samples to work with. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python based unacceptable language filter
"David Pratt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi. Thank you for the links. I am looking for something that would > function in a similar way to Yahoo's filter for it's message boards. > Perhaps I should have used the term profanity instead of unacceptable > language. I am not concerned about correcting sentence structure or > poor grammar. Yo melonfarmer, you should watch the non-profane version of Repo-Man for inspiration - ;-) PS: Sites like "The Profanisaurus" provides plenty of workarounds for most of the filters out there. -- http://mail.python.org/mailman/listinfo/python-list
Re: "no variable or argument declarations are necessary."
"bruno modulix" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > James A. Donald wrote: > > I am contemplating getting into Python, which is used by engineers I > > admire - google and Bram Cohen, but was horrified > > "horrified" ??? > > Ok, so I'll give you more reasons to be 'horrified': > - no private/protected/public access restriction - it's just a matter of > conventions ('_myvar' -> protected, '__myvar' -> private) > - no constants (here again just a convention : a name in all uppercase > is considered a constant - but nothing will prevent anyone to modify it) > - possibility to add/delete attributes to an object at runtime > - possibility to modify a class at runtime > - possibility to change the class of an object at runtime > - possibility to rebind a function name at runtime > > > If you find all this horrifying too, then hi-level dynamic languages are > not for you !-) Not to mention that since the O.P. seem to assume that the compiler will protect against deliberate subversion by evil programmers then he must be further "horrified" to learn that, although it is harder to do the above in f.ex. C++, it is not at all impossible, a carefully crafted pointer or a little devious sub-classing goes a long way. If all else fails, The humble Linker holds the Word of Power! Tampering with linking is both the easiest way to subvert code reviews, language checks and boundaries and also the hardest to discover because the tampering will be buried somewhere deep inside the build process, the part that never, ever gets reviewed because it is automated anyway and too complex entirely so nobody sane will actually mess with it once it "works" i.e. produces runnable code!. Finally, given proper permissions, one can of course re-link the binary executable, should the occasion merit. Like when one needs HIP in Telnet which is an absolute brd to build on a modern Linux box. (Somebody build that *once* in maybe 1978, I think ;-) One can replace classes in Jar archives too - possibly one can even get the Java runtime to load the "new version" of a jar archive in preference to the shipped one ... I.O.W: Superficially, the compile-time checks of Java and C++ provides some checks & boundaries but it comes at the expense of much more machinery with many more intricate movable parts than *also* can be interfered with (or broken). Python is simple and self-contained, thus it is pretty obvious - or at least not too difficult, to check what *actually* goes on with an application. If there is no trust, nothing can be done safely. If there is trust, then most of the percieved safety just get in the way of work. -- http://mail.python.org/mailman/listinfo/python-list
Re: create user message for wxPython
"James Hu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, > There are 2 wxPython application, A and B and need to exchange msg. I do not think that wx even has a mechanism for sending events between applications.? You need some other tool, like a socket, a named pibe, some windows specific event queue library (gack!), or maybe a toolkit like PYRO, SPREAD e.t.c. depending on your *reason* for needing this in the first place. I am partial to PYRO myself. ... and you do need an event loop in any case to map from: "remote event" <-> "message protocol" <-> "local event" ... at least that makes it easier to test than "raw" event's which are harder to control. -- http://mail.python.org/mailman/listinfo/python-list
Re: more than 100 capturing groups in a regex
"Joerg Schuster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello, Python regular expressions must not have more than 100 capturing groups. Really ?? I have been waiting a long time now for Python to get rid of this limitation. Ahh - The "dark side" of Open Source: If nobody cares, then you will have to do it yourself (and often people do not care because nobody had the need to go there - for good reasons). My question is: Does anyone know if the problem is going to be fixed in the next few months or so? Or is there a way to circumvent it? After a quick glean across the source code for the sre module, it appears that the only place the code mentions a limit of 100 groups is in fact the place that you quote. I suspect it is there for some historic reason - the people to ask is of course "pythonware.com" who wrote it; there may well be a good reason for the limitation. What happens if you up the limit to whatever you need? -- http://mail.python.org/mailman/listinfo/python-list
Re: more than 100 capturing groups in a regex
"Joerg Schuster" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Some people, when confronted with a problem, think "I know, > I'll use regular expressions." Now they have two problems. > --Jamie Zawinski Thanks for the citation. If my goal had been to redesign my program, I would not ask questions about regular expressions. I do not have the time to redesign my program. And knowing that my situation would be better, if I had written other code in the past, does not help me at all. Experience shows that, in any project, there is always time redo what was not made properly the first time a deadline was dreamed up. I just want to use more than 100 capturing groups. If someone told me that it is very unlikely for Python to get rid of the said limitation, I would recode part of my program in C++ using pcre. See!? There *is* Time. -- http://mail.python.org/mailman/listinfo/python-list
Re: need some advice on x y plot
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] If the x-axis is time, gnuplot will plot it correctly but it will connect *all* the datapoints and scale the x-axis so that everything will fit on the graph. Is it the autoscaling or conneting that what you think is wrong? Getting a fixed-size x-axis is a configuration option. I think one simply passes a range to the axis one wants to scale. I cannot remember exactly, how though. > one of you guys know a charting app that will do this ? or is there > some other way i could do it? RRDTool is excellent at storing & plotting time series data. It will not "connect" missing data points but has the limitation that the sample rate must be known when creating the database and generally adhered to. Missed samples are NAN's. You have to "tell" gnuplot what to plot and what not to plot. I think you can add more than one data series to the same plot, providing the "gap" where data is unavaliable. Else you have to "pad" it with zeros or some other appropriate null value. -- http://mail.python.org/mailman/listinfo/python-list
Re: python server
"linuxpld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello > > I`m writing a program (server in future) in python. > I would like to write it in such a way that I will be able to write gui > in any language and connect to my python program and use functionality > included with it. > are there any libraries that I could use? That depends on what you want and what other "goodies" you want. I liked "Python Web Modules" http://www.pythonweb.org/ a lot, mostly because I needed a decent Database interface and because you do not have to "buy" the entire framework like you do with f.ex. CORBA if you only want to use some of it. Everything runs a browser these dayz. Another possibility is to write a command-line interpreter that takes commands from a socket and returns results. All ASCII of course. ASCII is easy to debug. This is very generic, robust and easy to write test scripts for. The disadvantage is that you need a parser in the GUI and one in the Application. The huge advantage is that you completely separate the internals of the two programs from each other. Most client-server UNIX/Linux applications are written this way; i.e. this programming method survives in the wild because it is stable and it works. The RPC frameworks tend to run up on a wild hype-cycle before being generally left to maintenance programmers to sort out. Consider a "Mailbox" system, where packages of work is send to a server process and processed results are shipped back to the client process. The trick is to keep all state inside the "work packages" so the servers do not need to track anything. "MAKE" is a file-based implementation of this. OTOH: For Python <-> Python situations, the "Python Remote Objects", PYRO is not bad at all. And it does have an Event mechanism, which can be used as a "Mailbox" service. For reliable "shared memory" tasks ZOPE is good or maybe SPREAD. CORBA is overkill for everything, IMO ;-) > > I dont know if i wrote it understandably but maybe picture will explain > it: > > || > | python | > || <- module in python -> <- connection ("???") -> <-gui in > any language (java, c++, python, etc). > | server | > |---| > what could I use as "???"? http? mqseries? webservices? what are the > possibilites? > > thx for answers > linuxfan > -- http://mail.python.org/mailman/listinfo/python-list
Re: python server
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thee are many solutions. An XML-RPC server springs to mind as a > solution. There are several Python XML-RPC servers . Good Idea. Seems that those particular batteries are included with Python 2.2 and up: OP: See help on: "SimpleXMLRPCServer" and "xmlrpclib" -- http://mail.python.org/mailman/listinfo/python-list
Re: 3-dimensional plot in Python?
"questions?" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I want to make a 3d plot. x is a vector(discrete), y is also a > vector(discrete), for each pairwise x,y I have a value z(x,y)(it is not > a function, just discrete values for each pair of x,y) > > I want to show them on a two dimensional plot by showing z(x,y) with > colors. > > Thanks for any hint > SciPy is your friend: Provides interfaces to several plot engines, including gnuplot. -- http://mail.python.org/mailman/listinfo/python-list
Re: 3-dimensional plot in Python?
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Those interfaces are long since deprecated. Please use matplotlib instead. > > http://matplotlib.sf.net "Long since" being When? I recently installed SciPy and it did not say anything about "deprecated"! -- http://mail.python.org/mailman/listinfo/python-list
Re: how to bypass firewall
"Parth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello everyone, > I need some help regrading byassing firewalls.My college has internet > aces but it prevents us from dowloading music(*.mp3,*.mid,etc.)from the > net. Then Don't - The firewall, being lame as those things are, probably looks for *and logs* specific URL's and plain-text file names. So the first step is to not use things that it recognises. > I use a win xp sp2 and browse using ie 6. Is there any way how i > can dowload music on my computer using this connection. (We have a > proxy server throught which all the connections pass) So *you* must have a proxy server *outside* the firewall to do the downloading, then fetch through the firewall using some protocol that hides the content - The combine of SSL and HTTP probably *will* go through cleanly. Since this is supposedly relevant to Python, how about the proxy being Shareaza "remoted" with Pythons XML-RPC over SSH using Wx-Python as a GUI? Maybe even support streaming so all the "warez" reside on the proxy, yet the music plays where you are; it's probably the safest way. "Don't shit where you eat" - "They" come and kick the door in - but not at your place. *That* would be a neat project. PS: Once you got your proxy setup, you do not really need to go through the firewall at all. A DVD/RW goes straight through with lots of bandwith ;-) > > Thanks, > Parth Shah > -- http://mail.python.org/mailman/listinfo/python-list
Re: Data Transmission Crash Course Required
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > exchange. I am looking for a quick-n-dirty approach, upon which I can > certainly expand by further reading Python documentation. Also, if > anyone can recommend an online resource for learning more about TCP/IP > and the like (a programmer's view of it), I would be very grateful. You can sidestep the issue somewhat by using XML-RPC. The Client and the Server is part of Pythons standard libraries. -- http://mail.python.org/mailman/listinfo/python-list
Re: Accessing a database from a multithreaded application
"Alan Kemp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > Can someone suggest a better (ie, valid) strategy for this? Pass the connection to the thread as a parameter and use it to create a cursor local to the thread. You may have to create a connection per thread also - in some database implementations connections are "global" like cursors are. Cursors are throwaway things anyway. > Should I > be using a Queue to make a list of db requests/results to get accross > the thread boundary (erg, that sounds nasty)? Maybe - it is safest to limit the amount of threads/cursors/connections that can be created by people one does not know. > Should each client > thread create its own connection/cursor to the database? Would that > even work, wont there be locking issues? Yes, and maybe; one connection/cursor for each thread will always work. > > Any suggestions or pointers in the direction of more information would > be greatly appreciated. Maybe use queues to pass the requests to a pool of threads; there might be a limit to how many connection/cursors that can be created at the same time -- and some DOS tool will find it. > > Thanks for your time, > > Alan > -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Cron to run a python program
<[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > permissions just to be safe. What would cause the logging to work at a > command prompt but fail in cron? Because the environment is different; "man cron" might tell *how* it is different (I cannot because it varies with platform, distribution ... ) -- http://mail.python.org/mailman/listinfo/python-list
Re: python speed
"Krystian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > are there any future perspectives for Python to be as fast as java? Sure, if/when Python becomes as water-logged with obtruse OO-layers as Java is now. Python is faster than Java. Because Python per design generally is a thin layer of glue poured over binary C modules, it does not take very many instructions before one hits the fastest speed that the platform can go at. I would test it, then worry about it. > i would like to use Python as a language for writing games. >From the speed requirement: Is that correspondance chess by any chance?? -- http://mail.python.org/mailman/listinfo/python-list
Re: SNMPV3
"Jacek Pop³awski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Do you have any experience with Python in SNMPv3 area? SNMP suck per design and SNMPv3 suck even more by adding complexity to that design IMO. SNMPv2 sort of works well within the limits of the design of SNMP, so that is what I would use. The main difference between SNMPv2 and SNMPv3 is that v3 comes with a self-contained security system with it's own rules/tools & yet-another-set-of-credencials-to-control. If you do not need the security, SNMPv2 will work fine, and you don't need it because you will not change anything via SNMP anyway. > I just realized that pySNMP we are using supports only v1 and v2c, > development version probably supports SNMPv3 but I am unable to find any > v3-specific documentation, could you help me? Not really - I have deployed SNMPv3 in a demo network and gotten a management system based on SNMPv2 & SNMPv3 to work. This was a long lesson in how things that are broken by design will remain broken forever. So, I would not worry about it; informs, polling and probing can be done adequately with SNMPv2. Most tools do not bother with SNMPv3 either. Changing configurations by "setting" parameters cannot be made reliable with SNMP so there is no need for SNMPv3's security features (which are complicated in themselves and a real pain to manage, probably impossibly so for more than a few access levels on very few nodes). SNMPv3 Informs are the worst part: They must be authenticated, which means that the Username and engineID the trap is sent from must be registered with the Informsink or the Inform cannot be received. I.O.W: A SMURF attack on the configuration of the management station (and the manager, who has to collect/create engineID's manually). > Is there any other solution than pySNMP? Well, netconf is working it's way through IETF: http://www.ietf.org/html.charters/netconf-charter.html ;-) Netconf on top of XML-RPC would be very Pythonic. It looks like they got most things right this time - especially the parts about netconf NOT being self-contained so one can build on already-deployed and debugged protocols and standards!! -- http://mail.python.org/mailman/listinfo/python-list
Re: Using printf in a C Extension
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > > I am extending python with C and trying to debug with printf. The code > below succssfully returns the string "hello" when compiled and called, > but the "can print from in here phrase" does not reach python stdout. It should go to stdout - maybe stdout does not flush. Maybe you need '\n' to make it flush. Maybe your code broke printf. > Is there something screwy with my environment or is there some trick to > this that I don't know. Any help would be greatly appreciated! *printf* itself is screwy, much too clever: an interpreter messing with nakkid pointers on top of varargs!! Bound to blow up if the bug you are trying to find messes with any of the intricate machinery needed by printf, such as the stack. Try to locate the appropriate "debug version"s of printf available for your platform. Usually there will be several that have the name "print" in them, like "printmsg", "printerr", "printk" and so forth. They may even be macros that are #ifdef'ed in/out with "debug" compile options - so you might need to switch them on. The point of the debug variants is that they always flush to stdout/stderr - even when those are redirected - and they are designed to work even in obscure circumstances such as in the middle of an exception. The price is usually the loss of the printf formatting that nobody uses anyway (about 80% of the options ;-) and no varargs. -- http://mail.python.org/mailman/listinfo/python-list
ready-made file format for "file pibes"?
I am writing an application that does a lot of filtering of much data through a sequence of filters. After some thinking and wasting a lot of time with an object oriented design with GUI and all, I decided that the Real Way to do this is to create the filters as independent programs that take input and produce output in the good, olde UNIX way, using good olde MAKE to track what needs to be done next. Now, I need to simplify even further and leach on even more common knowledge :) so it is obvious to anyone how to extend the collection of filtering methods. Is there a Python library for defining and using a good (i.e. humanly readable), text-based format that one can use for the intermediate files? ZConfig is - as I understand it - read-only and it is difficult (for me) to completely understand what the general principles are because anything appears possible with it. I am unsure of Pyxie mainly because the documentation does not describe the "philosophy" and I would rather not hack up a parser for XML myself for my very-own-xml-format-that-no-one understands. If the experience with ZConfig is good, then maybe one can sidestep this and simply write files that can later be read by ZConfig? I need to save state between filter runs too and I would like to use the same mechanism everywhere. I also need some form of hierachi, i.e. for including information from further up the chain to know what triggered a filter so that downstream tools can get that information. Something as simple as a stansa-format (like .netrc) will probably be servicable with a little work - but if someone has already defined a better, more commonly-used format, I am all game. Any Clues?? mvh, frithiof jensen. -- http://mail.python.org/mailman/listinfo/python-list
Re: Do thread die?
"Maurice LING" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I do have another dumb question which is OT here. Say aFunc method > instantiates a SOAP server that serves forever, will it prevent bFunc > from running as a separate thread? If the SOAP server thread never sleeps or block, it will effectively stop everything else in your program by eating all the CPU time available. If it does some IO and other OS functions, probably not because it is likely to block on those - I do not know SOAPpy in detail, but it being a socket-based server it should end up in a select loop somewhere. i.e. block when no work is available. which is what you want. > For example, > > class myClass4: > def repeat(self, s): return s+s > def aFunc(self, a): > import SOAPpy > serv = SOAPpy.SOAPServer((a[0], a[1])) > serv.registerFunction(repeat) > serv.serve_forever() > def bFunc(self, b): pass > def runAll(self, a, b): > threading.Thread(target=self.aFunc, args = (a)).start() > threading.Thread(target=self.bFunc, args = (b)).start() > > if __name__=='__main__': myClass4().runAll(['localhost', 8000], 'hi') > > Will the 2nd thread (bFunc) ever run since the 1st thread is running > forever? Intuitively, I think that both threads will run but I just want > to be doubly sure, because some of my program logic depends on the 2nd > thread running while the 1st thread acts as a SOAP server or something. Both should run independently, sharing the CPU-time available for your application. Remember "main" is a thread too, so you will want "main" to hang around while your threads are running and you will want "main" to block on something also, thread.join(), time.sleep(), command line parser e.t.c. whatever is natural. -- http://mail.python.org/mailman/listinfo/python-list
Re: Help! Python either hangs or core dumps when calling C malloc
"Lil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I already double checked my C code. It runs perfectly fine in C without > any errors. Errr - It runs perfectly fine without *announcing* any errors (while gleefully urinating all over its memory space). The programming model for "C" is "*you* asked for it, you got it mate!" - so you have to "tell" the program how to debug memory by rebuilding it with f.ex. Electric Fence, or whatever memory debug lib is preferred for your box, and running that again. The tools will spot mistakes faster and more reliable than the developer who wrote the code. Use them. > So in my python program, I added a pdb.set_trace() > and step through the program and it did not dump. But when i took out > the tracing, the core dump came back. "sigh" So?? You re-jiggled the bits, so something important got thrashed this time. Run the C program trough with gdb and see what it does. It thrashes something. -- http://mail.python.org/mailman/listinfo/python-list
Re: Help! Python either hangs or core dumps when calling C malloc
"Christian Stapfer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Check your program for _uninitialized_variables_. good point. > (Just a guess: but what other side-effect than > changing the values of uninitialized variables > - and the program's timing, of course - might > the stepping through with a debugger have?) that, f.ex. with some debuggers, all application memory is conveniently zeroed so you might survive popping NOP's off the stack until you eventually hit a valid return ... I once traced through an embedded assembly program - that had been working for years - with a logic analyser to re-create the source from the old flow charts and the hundreds of patches that had been applied to the thing during "comissioning", i.e. On Site Development. I found that the "correct" program would somtimes get hit by an unitialised interupt, the CPU would land between two instructions and start executing garbage until it chrashed over something else and magically re-synchronised. Fine stuff. The reassembled program executed 40% faster without all the jump-to-patch stuff so I had to re-adjust all the timers too. -- http://mail.python.org/mailman/listinfo/python-list
Re: python open source charting solutions ?
"ionel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > i need some pointers. > so far i've tryed matplotlib ... What For, exactly? For time series, RRD-Tools (Round-Robin Database) works very well. -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for a very specific type of embedded GUI kit
"Sizer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So the question is: what non-X gui toolkit can we use that has Python > bindings and will let us use a custom display driver at the lowest level? There is a discussion of Embedded X's here: http://www.linuxdevices.com/files/elec-oct00/anderson/img0.html (metrolink seem's to be dead). http://www.microwindows.org/ maybe sourceforge knows more? -- http://mail.python.org/mailman/listinfo/python-list
Re: debian and python--any potential pitfalls?
"Brian van den Broek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The only area of computing in which I am interested and with which > he's unfamiliar is Python. He suggested I try to find out if there are > any potential issues with Debian stable and Python. Only that Python is "smeared" over several different packages - idle is packed separately f.ex. > Not knowing much about the details of linux and less about Debian, my > googling hasn't yielded much that settles things. I have found out > that stable ships with 2.3.5. I imagine it should be straightforward > to upgrade to 2.4.2. apt-get install should be about it. > Am I correct? Any other Debian/Python issues I > should know about? Sometimes I have had Debian Sarge fail miserably on the "install desktop" option. The workaround is to not install the desktop in the first configuration pass and then use apt-get intall gnome/kde/whatever. > If it matters, the laptop is fairly new (6 months) but wasn't > screaming when new, either. > > Thanks bunches, > > Brian vdB > -- http://mail.python.org/mailman/listinfo/python-list
Re: Application architecture (long post - sorry)
<[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > It would give me great satisfaction though to roll my own solution to > this Ahh - a bright young employee ready to meet the realities of corporate life, much like a bike rider meets the concrete he drives on ;-) > and then at least prove the benefits to the company, even if just > to convince them to purchase a system from a vendor, and even if that > happens i will have learnt a lot in the process. > "Company" will not give a rats arse - really, they will not!! Benefits to *management* is what this game is about; If the implementation provides "management" with good material for powerpoint slides that they can use to impress their betters and move up a notch then, obviously, some of the blessings will shine upon you too - if it causes management grief, then you will be made to suffer. "What can the project provide in the way of opportunity to Management?" is what you should look into. Opportunity for "company" is in an entirely different stratosfhere. Mere employees shall not try to second-guess the Gods. Bragging rights are allways good - but keeping the level of trouble below the upper layers of management attention level is a *much, much* better career move. *I* would certainly go for the primitive, but almost certain-to-work, Web solution rather than being clever and having to deal with the weirdness on how f.ex. sockets happen to be implemented on the mobile device and the 2 year's to obsolensence of the hardware+os (Those mobile devices *are* in general proprietary and deviant from RFC standards in unpublished but painful ways). I would also have some people that knows how to integrate with the existing Management Information System do it too. Usual business rules apply: ssume responsibility if it goes well, blame contractors if it does not. That sort of thing. ... Ignore the "cost issue" - if management think it is worth it to them they buy the project whatever the actual price or actual benefit - after all, it is only money for shareholders and tax people they spend anyway!!! And if they do not, then the work you do not have to do is the easiest. > Thanks for your replies, they are much appreciated. > Nah - probably not (I am getting too old for this business and I *still* have 20 years to go ;-) But in 20 years you will say the same. And whoever you say it to will go ahead with his own thing anyway. -- http://mail.python.org/mailman/listinfo/python-list
Re: Cross Compile Mips / Linux
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Everyone, > Should I try using a Linux based machine for the build, would that > help?? YES - The problem is that the Linux build tools generally assume that they are sitting in the target environment and therefore tries to use facilites discovered by the tools and discoveries about "endianess" and such; This is a general problem with the design of the Linux build system - the "I am on the target" assumptions are likely to be "smeared" over many applications. WindRiver (an embedded Linux provider) f.ex. makes a living off - amongst other things - providing an environment enabling Linux+applications to be reliably cross compiled! What we prefer to do is to use a "King-Size" version of the target hardware with a full set of tools and libraries to build on and then pack a file system with just the built Kernel + Application(s) for the target into an "initrd image" ( http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/initrd.html ) and have the real target download & boot that. This is because we are often doing tricky stuff with "new" CPU's where the Kernel is barely ready so we like to be sure that the bugs are in the code and not freebies provided by the cross compiler tools. ... and the latest embedded target happens to be an 8-Way Opteron card with 16 GB RAM that does not take eons to compile ;-) -- http://mail.python.org/mailman/listinfo/python-list
Re: Remote Function Call
"Mike" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I have two machines. A python program on machine 1 needs to make a > python call to a method in machine 2. What is the most efficient / fast Some Custom Mechanism: Pyro or SPREAD f.ex. > / programmer friendly way to do it? XML-RPC - the client and server is already included in Python's standard libraries! The protocol is text-based so it is easy to generate test cases for each component. > > - XML-RPC? > - Http Call? > > Thanks, > Mike > -- http://mail.python.org/mailman/listinfo/python-list
Re: ConfigParser: writes a list but reads a string?
"Terry Carroll" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It looks like ConfigParser will accept a list to be writing to the > *.ini file; but when reading it back in, it treats it as a string. ConfigParser is nasty because it does not really support type conversions but still permits writing incompatible types to the configuration - i.e. the conversions are generally one-way. It probably will croak on Floats in the same way. The "string interpolation" works in mysterious ways too. If you need ConfigParser to work then let every config item be strings and convert manually as necessary. > Is there a pythonic way to read in a list from a .INI file with > ConfigParser? Is this expected behavior for ConfigParser? Not in the way we normally use "expected" - but with ConfigParser it is to be expected ;-) > I would > not expect this conversion; rather, an exception when trying to write > the list if the list is not supported. > If you want both text format config files and types that work then use "ZConfig" instead. PS: ZConfig has no built-in way of writing a configuration - but this is not a severe limitation: If the configuration is split into a "static-", which get updated before a run and a "state-" set of files with things that are changed by the application it is easier to keep the configuration consistent anyway (it is not so hard to dump a dict into a ZConfig format). -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a maximum length of a regular expression in python?
<[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > I have a regular expression that is approximately 100k bytes. (It is > basically a list of all known norwegian postal numbers and the > corresponding place with | in between. I know this is not the intended > use for regular expressions, but it should nonetheless work. Err. No. A while back it was established in this forum that re's per design can have a maximum of 99 match groups ... I suspect that every "|" silently consumes one match group. -- http://mail.python.org/mailman/listinfo/python-list
Re: Sending Dictionary via Network
> "mumebuhi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The simplejson module is really cool and simple to use. This is great! JUST what I need for some configuration files!! Thanks for the link (die, configparse, dieee). -- http://mail.python.org/mailman/listinfo/python-list
Re: Sending Dictionary via Network
"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Frithiof Andreas Jensen wrote: > >> "mumebuhi" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> The simplejson module is really cool and simple to use. This is great! > > > > JUST what I need for some configuration files!! > > Thanks for the link (die, configparse, dieee). > > > I would personally use YAML for configuration files instead of JSON, > because it's more human-readable. But it's a matter of personal preference. Hehe: I am using YAML now. I find it readable - human ... hmm ;-) -- http://mail.python.org/mailman/listinfo/python-list
Re: Ricerca Programmatore Python
Have you considered Graphwiz with Python bindings? http://www.graphviz.org/ http://yapgvb.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list
Re: creating a new database with mysqldb
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Since the connect method of mysqldb requires a database name, it seems > like you can't use it without having a database already created. The web hotel I use create *one* database together with the account. I.O.W: I cannot create any databases; I can create/delete as many tables as I like within the database (up to the disk space that I have). This is pretty normal, I think. -- http://mail.python.org/mailman/listinfo/python-list
OT: wxPython GUI designer
"Don Taylor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I find it easy to use sizers in > wxGlade. Just gave is a spin yesterday: How does on fix the size of layout; I can only manage to get sizers to distribute space evently amongst the fields, which is *not* what I want. -- http://mail.python.org/mailman/listinfo/python-list
Re: wxPython and Linux dependencies
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Error message "cannot find wx" > > infact I have wxpython in /usr/lib/ > > I installed it using the rpms given on the wxPython website. Do I need > to set some path or something. I vaguely remember that wxWindows changed name to wxWidgets and wxPython changed convention along the way so that one should do: "include wx" and reference wx stuff as wx instead of "the old way" of: "from wxPython include *" and reference as f.ex. wxDialog: This is from memory, I cannot remember what version of wxPython the change happened - but I was bitten by it. Check the versions of wxPython on RedHat and Ubuntu - Ubuntu will almost certainly be newer than RedHat! -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Expert
"Perseo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi guys, > > we are looking for a python developer for a European project. This > project is multilangual and free it is called EuroCv and it need a > module for exporting data in PDF. A brute-force approach could be to sidestep PDF and design a template(s) in LaTex containing fields identified by strings. LaTeX can produce many formats, one of those is PDF. Then have your output module read the template, do a search & replace of the fields with values (remembering to quote the characters that LaTex will choke on and removing the codes for the blank fields) and write the finished LaTeX document to disk. (Maybe there are even templating modules in Python that will take care of this). Then compile the documents with latex, run the resulting *.dvi file through dvipdf and return a link to it. This is a "compiler pattern". You need a naming scheme to identify your file(s) but the rest is pretty old. The Python application "scons" (a make replacement) can control the "build" process - in case that you are not on a unix box - one could have "build" application periodically looking for *.tex files and compile them into *pdf whenever one is deposited in the right place. Scons support distributed builds b.t.w. > As web developer I try to create this > module but It's too complicate for me. Check out the service > www.eurocv.eu for more details. Contact us by Skype chat system our > nick is eurocv. > > Thanks > -- http://mail.python.org/mailman/listinfo/python-list
Re: Verify an e-mail-adress - syntax and dns
"Ingo Linkweiler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Bjoern Schliessmann schrieb: > > Ingo Linkweiler wrote: > > > >> b) verify an existing mailserver or DNS/MX records > > > > "Or"? That's two different things. > > > > If you don't know already: Even if you test all this, it is still > > possible that > > > > - the target mail account doesn't exist > > - the sender's IP is filtered by the server so he'll reject > > Yes, I know this. > But its still better than not checking it. > The script will be used as part auf a user registration page to avoid > dummy-inputs like "[EMAIL PROTECTED]" Why bother, you will loose anyway: For those kind of sites demanding registration for trivial usage (i.e. most sites do) I use my own domain controlled by myself - the adress is valid for the confirmation mail then, after I got what I came for (or after I found out that this site was a waste of time, which happens entirely too often), the adress is not valid anymore. Cuts down the spamvertising a lot! -- http://mail.python.org/mailman/listinfo/python-list
Re: What is the best way to "get" a web page?
something like: os.popen("wget -r3 http://juicypornpics.com";) wget understands the peculiarities of web pages so you do have to. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a maximum length of a regular expression in python?
"Bryan Olson" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > Roy Smith wrote: > Does no one care about an internal error in the regular expression > engine? Yes, but - given the example - In about the same way that I care about an internal error in my car engine after dropping a spanner into it ;-) -- http://mail.python.org/mailman/listinfo/python-list
Re: critique my code, please
"Brian Blais" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I am including at the end of this document (is it better as an attachment?) some code > for a small gui dialog. Since I am quite new to this, if anyone has any suggestions > for improvements to the code, bad coding practices, poor gui design, etc... I'd love > to hear it. The GUI is "welded" to the application. I much prefer to see a program split into a command-ling "engine" application and a (or more) "GUI", "CLI" e.t.c. interface applications that can connect to the engine and drive it. That way it is possible to script the application. -- http://mail.python.org/mailman/listinfo/python-list
Re: Another try at Python's selfishness
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Having read previous discussions on python-dev I think I'm not the only > Python programmer who doesn't particularly like python's "self" > parameter: Ok, there might be five programmers and one imam. The imam does not like anything more recent than 700 A.D ... > What do you think? > Troll! -- http://mail.python.org/mailman/listinfo/python-list
OT: Another try at Python's selfishness
"DH" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Frithiof Andreas Jensen wrote: > > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> Having read previous discussions on python-dev I think I'm not the only > >> Python programmer who doesn't particularly like python's "self" > >> parameter: > > > > Ok, there might be five programmers and one imam. The imam does not like > > anything more recent than 700 A.D ... > > > > > You Danes and your Muslim jokes :) ;-) A culture thing, that: They are now accepted as part of society, so we treat them equally to the people from Århus, Copenhagen, West-Jutland, Sout-Jutland, Bornholm and Mols (a tiny area 30 km from Århus). If we did not care for them, we would not poke fun at them occasionally. So far, I think the "integration" has really improved a lot because this affair has clearly shown that the Danish muslims are pretty much like everyone else here. The ethnic kiosks still sell Jyllands Posten, the Danish still buy groceries in ethnic shops e.t.c. Like Normal. No riots, looting and threats from hooded cowards and bullies. What we instead have learned are that the Imams - some of which have been given asylum - are blatantly lying and falsifying evidence in order to slander the country that pay their social security when the very first opportunity arises. Maybe those people should not be here in the first place. We have also learned that there is no point in getting involved in dialogue, export grants (i.e. bribes) and foreign aid money (more bribes) with dictatorships and defunct states. The effort should be directed elsewhere, where it is actually any use. Finally we can take comfort in knowing that the "lunatic segment" in the population is clearly less than 1500 out of 5,000,000 people - although the loonies do get 80% of the media coverage (like f.ex. the 300 "autonomen" that just *had* to be the only violent segment in a media-hyped "confrontational" demo with 30(!) neo-nazis, 200 muslims and about half the Danish police force present in riot gear - Great Plan Einstein; ). The TeeVee news should be relabeled "Fools Hour" - their mantra seems to be that "if you want the opinion of any large group, go seek out the village idiot and ask him". The conclusion is that the *real* threat to democracy does *not* come from the lunatic segment but from connected people with nice suits and vested interests such as the Danish Industri Association that are clearly willing to take in a used Sharia as part of a trade. They worked for Hitler too and has clearly learned nothing!! PS: If one was trying to detect fanatics of any creed, a certain indicator would be that they have absolutely no sense of humour - they suffer from a yet-to-be-described variant of autism I.M.O. -- http://mail.python.org/mailman/listinfo/python-list
Re: setting up scipy in windows
"hawkesed" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > Scipy looks like just the thing I want, if anyone has got it running on > a Windows box I would like to hear how you did it. With STANDARD Python 2.3 it installs from the Python 2.3 win 32 installers and runs. The only problem I had was that "Numeric" needs to be installed before "Scipy" or Scipy will chrash. -- http://mail.python.org/mailman/listinfo/python-list
Re: SQL Query via python
"Jeff Elkins" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Just as an fyi: > > In one weekend I have gone from knowing zip about SQL/Python to implementing > code on my personal server that emails info to family about birthdays and > such. Actually - http://www.pythonweb.org/ will handle the SQL (and many other tasks) in a much simpler way! If you do try the web.database.object examples, be aware that the docs are not entirely tracking the code; f.ex. databases have no "type" parameter; it's an "adapter" i.e. connection = web.database.connect(type="sqlite",database="object-simple.db") should be: connection = web.database.connect(adapter="sqlite",database="object-simple.db")' there are probably others - it's good to see what the parameters are in "idle" if something does not work as advertised. Overall, Pythonweb is very impressive work IMO. -- http://mail.python.org/mailman/listinfo/python-list
Re: Using python for a CAD program
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Cool. thanks for the links. I've already looked around quite a bit, > and am very hesitant to just write more shit on top of other shit. All software suck. If you think that yours will not then: a) you are a narcissist b) you are the only user c) all of the above > The > idea behind this is it's completely mine. So yes, I have a tendency to > want to reinvent a few wheels, but I think it'll give me greater > satisfaction. *I* think you bite off way too much and will waste two years and never get anything usable done. > The problem with geda, etc., is that it's taking the > unix approach -- a buncha little command line tools that somehow make a > "system", using text files as communication medium. That is because this approach actually works, it is proven in serious work, it can be tested without writing a test application of about the same complexity as the real job and it deals neatly with the users needs for automation without forcing the application to contain thick, bloated object management code for the users extensions. > I hate that, > largely because it allows the infectious spread of little files all > over your system, encourages people to write scripts from outside the > system that probably won't work for you, and exposes the user > unnecessarily to the implementation of where you keep files, > directories, blabla. Wrong on many levels: The idiot users will get into trouble no matter what you do; while the user that is smart enough to write an extension will need to deal with the implementation anyway. You, the developer, has to decide on wheather it is smarter to write your very own object manager, API's and the user/developer documentation thereoff or leave it to the operating system by simply using what is already there. > I'm more of the windows approach, where you have > one integrated environment, and any text you type is from within the > application itself, and most application-related data is hidden from > the user unless he *really* wants to get at it. I.M.O. The reason for the "integrated" windows approach is simply because that OS lacked/lacks efficient tasks, interproces communication and it does not support scripting. So each developer will end up rolling his own monolith and because all the code monkeys see this, it becomes "the way". > (disclosure: I've > never actually installed geda, but I tried icarus once and couldn't get > it to compile -- another bane of open source stuff I can't stand. The odds are great that the problem is to be found in front of the screen rather than the code. > I'm > not a CS person, so when I download something, I just want it to work, > and I don't get off trying to *make* it work...). Another reason for > doing this on my own is that I'd like a general-purpose CAD/design > framework, of which electrical/IC design is only one part. Also, I > think geda simulations are spice-based, which is batch, And this matters ... in what way exactly?? > which is sooo > your-father's buick, which I hate as much as text files... aaand > another thing is I'm very big on user-experience. "Experience" over "Functionality". I see - well, it worked for Bill. The "knowledge workers" forced to use the pretty etch-a-schetch tools are less than happy and will seek to minimise the pain by avoiding most of the alledged functionality. Last time I felt "the pain of the little used feature" was setting headers and footers in Excel - No, it does NOT work the same as in Word ("work" is perhaps a strong word). > I'd like my program > to *look* slick, like it belongs in a movie or something. I think that > means starting from scratch, since I've not seen any CAD program take > any artistic/human/psychological approach to its design. That *is* true - the problem with CAD programs are that they need the *exact* details to be entered at design time so one cannot easily schetch in them and fix the design errors later. But it does not follow that there is a need for rewriting the rendering engine or the design rules checker - you could actually achieve something by writing a tool that allow an existing CAD system to support the way designers actually work so that they use the tool up front instead of as it is now where CAD is the digitiser for a paper-based design. -- http://mail.python.org/mailman/listinfo/python-list
Re: Adding more warnings
"Thomas Dybdahl Ahle" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > Is it possible to make python warn me about those at "compile time"? No. The compiler only "knows" about it once the broken code is run. I use the standard module "unittest" to run through every single bit of Python code I write. Maybe silly, but ... I think it saves me time in the end and forces me to think more about my interfaces because one of the early symptoms of stupid design is that the test code is a real pain to write. At least Python applications tend to be compact compared with C++/Java. -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux/Python Issues
"Bruno Desthuilliers" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > [EMAIL PROTECTED] a écrit : > So, here's the basic scheme: > > - download the source tarball, preferably in /usr/local/src > - unpack it > - cd into the unpacked source directory > - *carefully* read the README, INSTALL and other relevant docs > - run ./configure with the relevant options > - run make > - run make install > > Wasn't too hard, was it ?-) It's a wee bit harder: Since he's got a package based distribution, the O.P. would do well to learn how to build source packages for that distribution otherwise he will eventually end up with a mess. The learning curve for packages is steep. For a Debian-based system the easiest way to roll custom packages is I.M.O. to use "pbuilder" so the system does not get totally polluted by build dependencies and other only-ever-used-once cruft. Pbuilder works on Ubuntu too - I have an old SUN Ultra SPARC 10 so very occasionally I need to package/rebuild src-packages some tool that is not in the distribution. > And before you say it: yes indeed, it assumes you know how to use the > command line, navigate your filesystem, copy/move things around, unpack an > archive, read a text file etc... IOW, some more 'common *n*x knowledge' > that you just can't hope to avoid learning if you want to properly use a > *n*x system. Sorry. Same story on Windows, really. People just forget how hard that was to learn. -- http://mail.python.org/mailman/listinfo/python-list
Re: Learning different languages
"Terry Hancock" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tuesday 07 March 2006 04:44 pm, Rich wrote: > I've been trying to get my kids to learn a little Python for some > time, but it hasn't been too easy for them yet. Then, out of the > blue, they want to learn Lua. > > Why? > > Simple -- Lua is the extension language for Enigma. So they want to > make new game levels ergo, they must use Lua. Motivation matters > more than ease, IMHO. :-) > > We realized recently that while teaching kids to program is hard, > teaching them to *hack* is easy. Once they learn to hack game > levels, they will learn, from the level designers, basics about > scripting and then programming, and they'll start to ask "how > can I make this easier?" > Hacking is "The Way" - I learned Z80 assembly language to cheat in Space Invaders on a Microbee conputer ;-). You can teach them some methods that make their hacking easier, like debuggers, script tools and all that. Maybe a Pyhton tool to simplify/generate skeleton code could be a devious way of getting Python involved? My son is quite proficient in using a collection of quite hairy build tools because he likes to build levels for Counter Strike Source. He has no interest in computers what so ever. -- http://mail.python.org/mailman/listinfo/python-list
Re: comparing huge files
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > thanks for the reply, > I have used another method to solve my problem. ie > 1) get the total count of the first file > 2) write this total count to basecnt eg basecnt > 3) get another file, get the total count of this file. eg filecnt > 4) if filecnt > basecnt, read in the values from file[basecnt:filecnt] > 5) if filecnt < basecnt, overwrite original basecnt and start over > again. > > basically, the problem domain is i want to get the most current records > from a log file to review after every 3 hours. so this log file will > increase or accumulate. > I did this: fp = os.popen('/usr/sbin/logtail /var/log/syslog') loglines = fp.readlines() pyparsing ... stuff from loglines ;-) Python is maybe overkill too - have "cron" call "logtail" and pibe the output whereever? PS: "logtail" is very simple, it works simply by maintaining a "bookmark" from the last read that is updated after each time the file is read (i.e. on each call). It is probably a very easy thing to implement in Python. On Linux/UNIX syslog+logutils can do a lot of work just by configuration (but you did not say you are on unix) -- http://mail.python.org/mailman/listinfo/python-list