Re: Python login screen for MariaDB db

2020-01-20 Thread ^Bart
r how and where should I replace code from the web article! ^Bart -- https://mail.python.org/mailman/listinfo/python-list

How to read/write a field in MariaDB already managed/encrypted by PHP script.

2020-01-25 Thread ^Bart
ython! :\ ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Don't understand global variables between modules

2005-02-21 Thread Bart
the last line at all. Why is my x variable 1 after having been incremented twice? Is there more than one global space? Is this backreference to the original a.py not allowed? I could use some help. Thanks Bart van Deenen a.py: - import b x=1 def inc(): global

slow sql server DB reads

2005-05-23 Thread bart
I run a python website on a IIS server. I replaced my flat file DB with SQL server, but the reads are very slow. 7 seconds for 3 querrys like these conn= adodbapi.connect( "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=xxx;Initial Catalog=dlpl;Data Source=(local)" ) c

Design problem, call function from HTML?

2005-05-30 Thread bart
This is the python way i have. imgref = 'image.py' out.write('' % (imgref) in ASP.NET u can do something like this //allready loaded data data image(){ return data.img } Is there any remote possibility u can pulloff the same in python? Now i have to process my data to di

python function in pipe

2007-04-28 Thread Bart
Hi everyone! Im using module that gives errors to stderr/stdout (generated by SWIG) Problem is that I need to parse this errors/information from module. os.popen3 looks nice but this executes command not function. Is there any solution? Best regards Bart. -- http://mail.python.org

removing module

2007-04-30 Thread Bart
vides this module ? import sys print sys.modules (is loaded?) dir(module_name) is it enough? Thanks for Help. Bart. -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: High resolution sleep (Linux)

2007-05-10 Thread Bart.
another application between each > packet is beeing sent, that's a problem. > > Anyways, what I need is high resolution sleep, not high resolution > timing. Installing a real time OS seems like overkill. > > (Yes I know, one can also send, say, 50 packets at a time, and then > sleep, send 50 more packets, and so on.) > > -- > http://mail.python.org/mailman/listinfo/python-list What about C module with usleep,nanosleep? Best regards. Bart. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Bart.
eated in the C++ side, so how would I use > > that from the python side? > > QtGui.QApplication.instance() > What I can do with this pointer? It is possible to add window to application ? It is possible to connect to application signals? Bart. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Bart.
Thursday 01 of November 2007 23:32:02 Phil Thompson napisał(a): > On Thursday 01 November 2007, Bart. wrote: > > Thursday 01 of November 2007 15:13:55 Phil Thompson napisał(a): > > > On Thursday 01 November 2007, cgrebeld wrote: > > > > Is it possible for a Qt C++

Re: PyQt with embedded python in Qt App

2007-11-01 Thread Bart.
given to you. > Know any example, please? For better understand this :) I wan't add scripting to one application wrotten with Qt. Bart. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt with embedded python in Qt App

2007-11-02 Thread Bart.
Friday 02 of November 2007 12:21:06 BlueBird napisał(a): > On Nov 2, 8:03 am, "Bart." <[EMAIL PROTECTED]> wrote: > > Friday 02 of November 2007 01:06:58 Diez B. Roggisch napisa (a): > > > > So how to pass this object into embeded python interpreter (exec

Re: Assertion for python scripts

2007-11-02 Thread Bart.
Friday 02 of November 2007 20:53:12 matthias napisał(a): > On Nov 2, 12:12 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > > On 11/2/07, matthias <[EMAIL PROTECTED]> wrote: > > > Howdy ! > > > > > > I started using the assert() stmt and found it quite useful :-) I > > > have only one problem: I

Re: Assertion for python scripts

2007-11-02 Thread Bart.
Friday 02 of November 2007 22:07:42 matthias napisał(a): > > check this: > > > > python ./assert.pyo > > Yes, I know that this works. Thanx. However, that's not what I was > going for. > > Essentially, I am targeting a build system that allows me to build > debug / release versions > of my Pytho

Re: PyQt with embedded python in Qt App

2007-11-12 Thread Bart.
Saturday 03 of November 2007 02:43:21 cgrebeld napisał(a): > http://python.pastebin.com/m18c67b3a Thank You, now I understand. Now how to extend this interpreter with Qt Application classes/objects to do some usefull things with this embeded interpreter ? Bart. -- http://mail.python.

Embedded Program Icon (wxPython)

2008-11-29 Thread Bart
est of the world. Any suggestions are welcome! Regards, Bart import wx import cStringIO import base64 def getImageStream(): img_b64 = \ """iVBORw0KGgoNSUhEUgAAACAgCAYAAABzenr0BHNCSVQICAgIfAhkiTlJREFUWIXNl2FyhCAMhV +0B/NmCzfrHkxff+zSik0

Re: Embedded Program Icon (wxPython)

2008-11-29 Thread Bart
On Nov 29, 10:14 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Nov 29, 2:30 pm, Bart <[EMAIL PROTECTED]> wrote: > > > > > Dear members, > > It's not (yet) easy to find my way through the bunch of info scattered > > over the internet to find out

os.path.normpath question

2010-06-07 Thread Bart
I'm using this and ran across backslash issues in one of my paths. archpath = os.path.normpath('E:\foo\FTP\HLS\archive') was translating to: E:\lsfprod\law\uch_interfaces\FTP\HLSrchive which caused me to start using the 'raw' declaration before the path string like this: archpat

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread Bart!
On Tue, 29 Jun 2010 19:58:13 +0200, Thomas 'PointedEars' Lahn wrote: >UltimatePatriot crossposted twice over 4 off-topic newsgroups without >Followup-To, replying to an obvious troll: Whoopie fucking doo, you fucking netkkkop wanna be Usenet PUTZ! Your kill file edit announcement post is

changing dicts in a threaded environment ?

2012-11-27 Thread Bart Thate
a select.select for queues ? I want to pass a dict to a thead and then have a watcher on the dicts state if result have arrived. For what i am making dicts are the basis of everything, json dumpable so the state op the object can be saved or send over the wire as well. Thnx for your time and ener

Re: changing dicts in a threaded environment ?

2012-11-29 Thread Bart Thate
d to hear what you and all the others reading this are thinking. Bart, thinking of "what if i stored the JSON in git ?" and "would mercurial then not be better" haha p.s. code is not in a "good shape" yet, it is just that i would take too long for me to respond a

JSON logging ?

2012-12-11 Thread Bart Thate
Is it possible to change hooks or something to let the logging SocketServer stuff handle JSON instead of pickle ? I am thinking of sending my JSON dict data through the logging system to remote. A default standard way to send stuff back and forth would be welcome here. pickle uses eval still ? o

The Prototype Master

2012-12-12 Thread Bart Thate
*PROTOTYPE MASTER* they call me the prototype master over here. I dive into the unkown and get some code working in a problem domain i dont know. As fast as possible i need to write code that 1) is running 2) does something in that domain This all so i can learn from all that went wrong. so i can

Re: JSON logging ?

2012-12-12 Thread Bart Thate
ote, as better phrased maybe .. where can i hook my (changed) makeLogRecord into ? Thnx for the reply dude, helps me enormously ;] Bart On Wed, Dec 12, 2012 at 6:33 PM, Chris Rebert wrote: > On Dec 11, 2012 7:33 AM, "Bart Thate" wrote: > > > > pickle uses eval still ? o

Re: JSON logging ?

2012-12-12 Thread Bart Thate
unning over DCC CHAT ... On Wed, Dec 12, 2012 at 8:17 PM, Bart Thate wrote: > Thanks for your reply Chris, > > good to be updated on the pickle stuff, too bad it is still not safe for > use. But hee i prefer JSON above pickle anyways so ;] > > As to using the logging packag

context aware execution

2012-12-19 Thread Bart Thate
determine the context of my caller and adapt the functionality accordingly. thnx, Bart -- http://mail.python.org/mailman/listinfo/python-list

Re: context aware execution

2012-12-19 Thread Bart Thate
Thanks for your response Chris ! Ha ! the job of the mad man is todo the things the are not "advisable" and see what gives. Like why it is not advisable and, if possible, their are ways to achieve things that are previously overseen. i already do a lot of travelling of the callstack to see from

GOZERBOT 1.0.1 FINAL

2012-01-23 Thread Bart Thate
GOZERBOT 1.0.1 FINAL released ;] last bugs kinked out (i hope) and lots of docs updates (see http://gozerbot.org) downloadable at http://gozerbot.googlecode.com or use "easy_install gozerbot" or run "hg clone http://gozerbot.googlecode.com/hg mybot" Below a cool animation of the GOZERBOT code re

JSONBOT 0.84.4 RELEASE available

2012-03-24 Thread Bart Thate
*JSONBOT 0.84.4 RELEASE* available ! #IRC #XMPP #chatbot #WWW #Python #RSS #relay get it at: http://code.google.com/p/jsonbot/downloads/list documentation is at http://jsonbot.org *About JSONBOT:* JSONBOT is a chatbot that can take commands and react to events on the network it is conn

JSONBOT 0.7.1 released

2011-06-09 Thread Bart Thate
://jsonbot.googlecode.com Have fun playing with it! Bart About JSONBOT: JSONBOT is a remote event-driven framework for building bots that talk JSON to each other over XMPP. This distribution provides bots built on this framework for console, IRC, XMPP and Convore for the shell and WWW and XMPP for the

GOZERBOT 0.9.2 RELEASED

2011-06-23 Thread Bart Thate
version from http://gozerbot.googlecode.com. For those who want to have a look at the future check http://jsonbot.org Well thats new from a happy camper that suddenly finds his path ahead. Grtx, Bart -- http://mail.python.org/mailman/listinfo/python-list

help with DLL or path issue trying to use cx_Freeze

2011-08-06 Thread Bart Manchester
Im trying to use the most basic of cx_Freeze in a dos window and I receive the following error (see below). I suspect I have some kind of path issue, but am at a loss as to how to proceed. I am trying to execute this in the Scripts directory and have both the cxfreeze bat and also the .py file

help with DLL or path issue trying to use cx_Freeze

2011-08-07 Thread Bart Manchester
I suspect this may have gone out before I was a member, and thus potentially not be received - apologies if this did go out please ignore this second attempt if it did. --- Im trying to use the most basic of cx_Freeze in a dos window and I receive the following error (see below). I

ANNOUNCING GOZERBOT 0.9.3 BETA1

2011-08-09 Thread Bart Thate
Hi world and every living thing on it ! I just want to give a headsup to the fact that i released the first beta of GOZERBOT 0.9.3. This release brings in a lot of bug fixes, so please try it out ;] Download is at http://gozerbot.googlecode.com, please if you find problems with the bot file a tic

List comprehension timing difference.

2011-09-01 Thread Bart Kastermans
In the following code I create the graph with vertices sgb-words.txt (the file of 5 letter words from the stanford graphbase), and an edge if two words differ by one letter. The two methods I wrote seem to me to likely perform the same computations, the list comprehension is faster though (281

Re: List comprehension timing difference.

2011-09-02 Thread Bart Kastermans
MRAB writes: > On 02/09/2011 01:35, Bart Kastermans wrote: >> graph = [[a,b] for a in data for b in data if d(a,b) ==1 and a< b] >> graph2 = [] >> for i in range (0, len(data)): >> for j in range(0,len(data)): >> if d(data[i],data[j]) ==

Re: List comprehension timing difference.

2011-09-02 Thread Bart Kastermans
t...@thsu.org writes: > On Sep 2, 9:54 am, Bart Kastermans wrote: >> if d(a,b) == 1 and a < b: > > It will probably be faster if you reverse the evaluation order of that > expression. > > if a > That way the d() function is called less than half the time. Of cours

Tkinter label height to fit content

2011-09-03 Thread Bart Kastermans
I have a label into which I am going to put content of different sizes. I would like to know how high I need to make the label so that I can size the window so it can stay the same for the different content sizes. I have a strategy, but it seems more complicated then it should be. I want to set a

Re: Tkinter label height to fit content

2011-09-04 Thread Bart Kastermans
rantingrick writes: > On Sep 3, 5:15 pm, Bart Kastermans wrote: > >> Any suggestions? > > Yeah, have you considered using the "linespace()" method of tk.Font > objects to calculate the height? Although i must say it "feels" as if > your doing so

Re: Tkinter label height to fit content

2011-09-06 Thread Bart Kastermans
I build on the suggestion by rantingrick, but took it in a bit different direction. I now have working code that performs reasonable. The reason for the class lines (as opposed to just a function) is b/c font.measure appears not that fast. So I want to remember between different calls to lines.

Re: Tkinter label height to fit content

2011-09-06 Thread Bart Kastermans
rantingrick writes: > Hmm, i can replace all that code with this... Because I stupidly forgot to repeat the original problem I had, and my code doesn't show it (and doesn't show the correct use of the function I wrote). The code shows that I now know how to compute the number of lines and item

Re: Tkinter label height to fit content

2011-09-06 Thread Bart Kastermans
rantingrick writes: > On Sep 6, 5:00 pm, Bart Kastermans wrote: >> rantingrick writes: >> > Hmm, i can replace all that code with this... >> >> Because I stupidly forgot to repeat the original problem I had, and my >> code doesn't show it (and doesn

JSONBOT 0.7 RELEASED

2011-05-01 Thread Bart Thate
install" or "easy_install -U jsb" when you do want to install the bot globaly. Debian packages are on their way, but might still take time as the ftpmeisters need to approve ;] Thats it ! hope you enjoy this version of JSONBOT ;] Bart -- http://mail.python.org/mailman/listinfo/python-list

BOTLIB #31 released - https://pypi.python.org/pypi/botlib

2017-10-14 Thread Bart Thate
objects are stored as json string in files on the fs. db iteration over stored objects. timestamp time based filenames gives logging capabilities future future sensors should provide entry to the logger. install === Clone the source: :: bart

ANN: OB - framework to program bots

2018-06-27 Thread Bart Thate
Hello comp.lang.python, I am Bart Thate, a 50 year old programming schizofrenic. I like to annouce version 4 of OB, a pure python3 package you can use to program bots. OB has a “no-clause MIT license” that should be the most liberal license you can get at the year 2018. I am looking for

Re: OT: Phases of the moon [was Re: A Moronicity of Guido van Rossum]

2005-10-01 Thread Bart Lateur
tually "tomorrow". As a similar example: I've been told by various women independently, that "there are more babies born near a full moon." So... is there a correlation between insanity and babies being born? :) -- Bart. -- http://mail.python.org/mailman/listinfo/python-list

Python 3.3.2 Shell Message

2013-11-07 Thread Bart Montgomery
I just starting out and am using the Python For Kids book. I have an 2.4 GHz Intel Core 2 Duo iMac running OS X 10.6.8, and I’m getting this message when I open IDLE: Warning: The version of Tcl/Tk (8.5.7) in use may be unstable. Visit http://www.python.org/download/mac/tclt

Python 3.3.2 Shell Message‏

2013-11-07 Thread Bart Montgomery
My thanks to Ned Deily for his timely response. IDLE is now stable, and I’m at the next step which is to run the file I created called hello.py. I get this message from the shell: Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24) [GCC 4.2.1 (Apple Inc. build 5666) (d

GOZERBOT 0.99.0 RELEASED

2011-10-04 Thread Bart Thate
Hello world and everybody ! i'm pleased to announce the release of GOZERBOT 0.99.0, the first in a series of releases that are supposed to lead to a proper 1.0 release for GOZERBOT. The intention is to get a 1.0 version of GOZERBOT available for users that still use this bot, got almost 2000 downl

JSONBOT 0.80.3 RELEASED

2011-11-21 Thread Bart Thate
Hello world !! I released JSONBOT 0.80.3 .. the first in the 0.80 series ;] about ~ JSONBOT is a chatbot that can take commands and react to events on the network it is connected to (IRC, XMPP, WEB mostely). Push functionality is also provided (think RSS feeds to your IRC channel or XMPP co

GOZERBOT 1.0 RELEASED

2012-01-18 Thread Bart Thate
I am proud ! Version 1.0 of GOZERBOT is here in the world. 7 years of evolutionary code development. The eagle has landed, the egg is layed See http://gozerbot.org - WELCOME TO GOZERBOT — GOZERBOT v1.0.1 FINAL documentation WELCOME TO GOZERBOT¶. I am pleased to present to you version 1.0 of GOZ

Which KDE IDE for Python?

2006-08-04 Thread Bart Ogryczak
Hi, Rigth now I'm using two IDEs for Python, KDevelop and Eric. Both have drawbacks. KDevelop is a multilanguage IDE, and doesn't really have anything special for Python. There's no Python debugger, no PyDOC integration, it's class browser doesn't display attributes. On the other side there's Eric,

Re: Which KDE IDE for Python?

2006-08-04 Thread Bart Ogryczak
Diez B. Roggisch wrote: > Bart Ogryczak schrieb: > > Hi, > > Rigth now I'm using two IDEs for Python, KDevelop and Eric. Both have > > drawbacks. KDevelop is a multilanguage IDE, and doesn't really have > > anything special for Python. There's no Pytho

sharing persisten cache between modules

2006-10-23 Thread Bart Ogryczak
Hi, I´ve got a problem creating persistent cache, that would be shared between modules. There a supermodule, which calls submodules. I´d like submodules to use cache created in the supermodule. The only way I see right now, is to pass it as function argument, but that would require a change in API,

Re: sharing persisten cache between modules

2006-10-23 Thread Bart Ogryczak
Fredrik Lundh wrote: > Bart Ogryczak wrote: > > > I´ve got a problem creating persistent cache, that would be shared > > between modules. There a supermodule, which calls submodules. I´d like > > submodules to use cache created in the supermodule. The only way I see >

Re: sharing persisten cache between modules

2006-10-24 Thread Bart Ogryczak
Dennis Lee Bieber wrote: > f-i-* creates local names initially bound to the objects inside a > module, but any "assignment" to such a name later results in the name > being rebound to the new object -- disconnecting from the original. Great! That was it. Thank you! :-) -- http://mail.python.org

pickle and infinity

2006-11-29 Thread Bart Ogryczak
Hello, I´ve got this problem with pickle, it seems it doesn´t handle correctly infinite values (nor does Python return overflow/underflow error). What could I do about it? Example code: >>> x = 1e310 #actually it would be a result of calculations >>> type(x) >>> x 1.#INF >>> import pickle >>> pic

Re: pickle and infinity

2006-11-29 Thread Bart Ogryczak
To make things more interesting -- Solaris version: >>> x = 1e310 >>> x Infinity >>> import pickle >>> pickle.dumps(x) 'FInfinity\n.' >>> pickle.loads(_) Infinity >>> pickle.dumps(x,1) [...] SystemError: frexp() result out of range -- http://mail.python.org/mailman/listinfo/python-list

Re: How to refer to Python?

2006-11-29 Thread Bart Ogryczak
Sebastian Bassi wrote: > I am writing a paper where I refer to Python. Is there a paper that I > can refer the reader to? Or just use the Python web page as a > reference? I´d refer to "The Python Language Reference Manual", Guido Van Rossum, Fred L., Jr. Drake Network Theory Ltd (September 2003)

Re: pickle and infinity

2006-11-29 Thread Bart Ogryczak
Fredrik Lundh wrote: > Bart Ogryczak wrote: > > > I´ve got this problem with pickle, it seems it doesn´t handle > > correctly infinite values (nor does Python return overflow/underflow > > error). > > Python 2.X relies on the C library to serialize floats, an

Re: pickle and infinity

2006-11-30 Thread Bart Ogryczak
Grant Edwards wrote: > On 2006-11-29, Bart Ogryczak <[EMAIL PROTECTED]> wrote: > > > > Fredrik Lundh wrote: > >> Bart Ogryczak wrote: > >> > >> > I´ve got this problem with pickle, it seems it doesn´t handle > >> > correctly infinite

suppresing error pop-ups in Win32 app

2006-12-05 Thread Bart Ogryczak
Hi, I'm developing mixed Python/C app which runs on WinNT server. When something fails in Python, that´s not a problem, prints a traceback to the log and thats it. When something fails within the C code, the error message window pops up. To kill it I´ve got to access server with VNC. I´ve tried to

Re: lists and dictionaries

2007-07-12 Thread Bart Ogryczak
On 11 jul, 21:08, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > I have a list of dictionaries. > e.g. > [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'}, > {'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'}, > {'index': 0, 'transport': 'tcp', 'service_do

Re: lists and dictionaries

2007-07-12 Thread Bart Ogryczak
On 12 jul, 04:49, anethema <[EMAIL PROTECTED]> wrote: > > li = [ {'index': 0, 'transport': 'udp', 'service_domain': > > 'dp0.example.com'}, > > {'index': 1, 'transport': 'udp', 'service_domain': > > 'dp1.example.com'}, > > {'index': 0, 'transport': 'tcp', 'service_domain': > > 'dp0

Re: Lists in classes

2007-07-12 Thread Bart Ogryczak
On 12 jul, 17:23, Jeremy Lynch <[EMAIL PROTECTED]> wrote: > Hello, > > Learning python from a c++ background. Very confused about this: > > > class jeremy: > list=[] > def additem(self): > self.list.append("hi") > return > > temp

Re: Lists in classes

2007-07-12 Thread Bart Ogryczak
On 12 jul, 17:23, Jeremy Lynch <[EMAIL PROTECTED]> wrote: > Hello, > > Learning python from a c++ background. Very confused about this: > > > class jeremy: > list=[] You've defined list (very bad choice of a name, BTW), as a class variable. To declare is as instance variable

Re: Any Good tools to create CSV Files?

2007-04-29 Thread Bart Willems
Carsten Haese wrote: > You mean something like the csv module that is part of Python's standard > library? > import csv help(csv) You have to admit, the module name is not really intuitive... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: I have a chance to do somting diffrent way not Python ?!

2007-04-29 Thread Bart Willems
aybe for the warning that you should not try to write java or c++ code in Python. So, if there is anything that seems to me missing, consider a different approach in your code (a good example is the switch statement...) Best regards, Bart -- http://mail.python.org/mailman/listinfo/python-list

Re: if __name__ == 'main': & passing an arg to a class object

2007-04-29 Thread Bart Willems
gtb wrote: > appear at the end of many examples I see. Is this to cause a .class > file to be generated? This might be obvious, but no one else mentioned it: the Python interpreter cannot execute code that it hasn't compiled yet, which is why the "if __name__ ..." code is always at the end of the

Re: Any Good tools to create CSV Files?

2007-04-29 Thread Bart Willems
Aahz wrote: > In all fairness, the csv module is new in Python 2.3, and I'm sure I'm > not the only person still using Python 2.2 for production. That is true, on the other hand, Reportlab is made for at least Python 2.4, "although it will work with 2.3" - so he has 2.3 at least :) -- http://mail

Re: Chart drawing tool in python

2007-04-29 Thread Bart Willems
[EMAIL PROTECTED] wrote: > Hi, > > In Perl, there is a GD module to draw custom chart. > http://www-128.ibm.com/developerworks/opensource/library/os-perlgdchart/?ca=dgr-lnxw01Perl-GD-Charts > Can you please tell me if there is an equivalent library in python? Did you take a look at reportlab? (ht

Re: python win32com excel problem

2007-05-01 Thread Bart Willems
codes for number formatting as required. I usually pick "#,##0.00" to display numbers with two decimals and thousands seperators. Cheers, Bart -- http://mail.python.org/mailman/listinfo/python-list

Re: python win32com excel problem

2007-05-01 Thread Bart Willems
Bart Willems wrote: > Autofit is a method. Also, columns are a method of a worksheet - try: > xlApp.Worksheets.Columns("C:K").Autofit() Silly me. That is of course xlApp.Activesheet.Columns("C:K").Autofit() On a sidenote, you can refer to a worksheet with xlApp

Re: Why stay with lisp when there are python and perl?

2007-05-07 Thread Bart Willems
Xah Lee wrote: > blah blah blah blah blah lisp blah blah blah > blah blah lisp blah blah. Blah blah? Blah blah! > blah blah blah blah blah; > 1) Blah lisp. > 2) Blah blah. > 3) Blah lisp blah. > blah blah blah blah blah. Blah blah lisp! Blah lisp! > Blah lisp! Blah! Blah blah blah! Lisp bla

Re: programmatically define a new variable on the fly

2007-08-10 Thread Bart Ogryczak
On 10 ago, 00:11, Lee Sander <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to define a new variable which is not predefined by me. > For example, > I want to create an array called "X%s" where "%s" is to be determined > based on the data I am processing. So, for example, if I the file > I'm rea

Re: sentance containg the string or symbol Ω

2007-08-23 Thread Bart Ogryczak
On 23 ago, 13:20, yadin <[EMAIL PROTECTED]> wrote: > how can i print a sentance containg the string or symbol Ω in python > and also lambda? Well, you can use this dictionary to find out its unicode code point: from htmlentitydefs import name2codepoint unichr(name2codepoint['Omega']) u'\u03a9' uni

Re: How to Read Bytes from a file

2007-03-05 Thread Bart Ogryczak
On Mar 5, 10:51 am, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > >>>>> "Bart Ogryczak" <[EMAIL PROTECTED]> (BO) wrote: > >BO> Any system with 8-bit bytes, which would mean any system made after > >BO> 1965. I'm not aware of a

Re: Dictionary of Dictionaries

2007-03-05 Thread Bart Ogryczak
On Mar 5, 11:22 am, [EMAIL PROTECTED] wrote: > messagesReceived = dict.fromkeys(("one","two"), {}) This creates two references to just *one* instance of empty dictionary. I'd do it like: messagesReceived = dict([(key, {}) for key in ("one","two")]) -- http://mail.python.org/mailman/listinfo/p

Re: How to check whether file is open or not

2007-03-08 Thread Bart Ogryczak
On Mar 7, 6:28 am, "Ros" <[EMAIL PROTECTED]> wrote: > There are 10 files in the folder. I wish to process all the files one > by one. But if the files are open or some processing is going on them > then I do not want to disturb that process. In that case I would > ignore processing that particular

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Bart Ogryczak
On Mar 9, 3:30 pm, Lou Pecora <[EMAIL PROTECTED]> wrote: > Then mymodule is imported only once, but each module has access to it > through the module name (mod1 and mod2) and the alias MM (mod3). Is > that right? Yes, it is. > I was concerned about multiple imports and efficiency. If the module

Re: opinion needed

2007-03-09 Thread Bart Ogryczak
On Mar 9, 4:27 pm, "azrael" <[EMAIL PROTECTED]> wrote: > id like to hear your opinion about something. > I just started using Prolog yesterday and i have my doubts about it, > but it seems to me something like object oriented. so i wanted to ask > you how usefull prolog is. It's very useful for "L

Re: Python-list Digest, Vol 42, Issue 117

2007-03-09 Thread Bart Willems
I'm sorry, but what's wrong with: radix = [ [] ] * 256 Cheers, Bart "John" writes: >> For my code of radix sort, I need to initialize 256 buckets. My code looks a >> little clumsy: >> >> radix=[[]] >> for i in range(255): >> radix

Re: any better code to initalize a list of lists?

2007-03-11 Thread Bart Willems
Donald Fredkin wrote: > John wrote: > >> For my code of radix sort, I need to initialize 256 buckets. My code >> looks a little clumsy: >> >> radix=[[]] >> for i in range(255): >>radix.append([]) >> >> any better code to initalize this list? > > radix = [[[]]*256][0] > No I fell for that on

Re: Communicating with a DLL under Linux

2007-03-13 Thread Bart Ogryczak
On Mar 13, 5:59 pm, Mikael Olofsson <[EMAIL PROTECTED]> wrote: > If the vendor claims that the DLL is for Windows, is it > reasonable to assume that it can be made to work under Linux, from > Python, that is? No. It's reasonable to assume, that there is no *easy* way to get Win32's DLL working und

Re: Problem I have with a while loop/boolean/or

2007-03-13 Thread Bart Willems
John McMonagle wrote: > Try it a different way: > > while True: > hint = raw_input("\nAre you stuck? y/n: ") > hint = hint.lower() > if hint != 'y' and hint != 'n': > print "Please answer y or n" > continue > else: > break > if hint == 'y': > do_your_hin

Re: Technical Answer - Protecting code in python

2007-03-21 Thread Bart Ogryczak
On Mar 21, 2:36 pm, "flit" <[EMAIL PROTECTED]> wrote: > Now the technical question: > > 1 - There is a way to make some program in python and protects it? I > am not talking about ultra hard-core protection, just a simple one > that will stop 90% script kiddies. Freeze. That should be hard enough

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-21 Thread Bart Ogryczak
On Mar 21, 3:38 pm, "dmitrey" <[EMAIL PROTECTED]> wrote: > Hi all, > I looked to the PEPs & didn't find a proposition to remove brackets & > commas for to make Python func call syntax caml- or tcl- like: instead > of > result = myfun(param1, myfun2(param5, param8), param3) > just make possible usin

Re: Technical Answer - Protecting code in python

2007-03-21 Thread Bart Willems
Steven D'Aprano wrote: > Protect it from what? Viruses? Terrorists? The corrupt government? Your > ex-wife cutting it up with scissors? People who want to copy it? People > who will look at your code and laugh at you for being a bad programmer? > > Until you tell us what you are trying to protect

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-22 Thread Bart Willems
that many arguments to start with. Regards, Bart -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing __doc__

2007-03-22 Thread Bart Ogryczak
On Mar 21, 8:47 pm, "gtb" <[EMAIL PROTECTED]> wrote: > Greetings, > > Don't know the daily limit for dumb questions so I will ask one or > more. > > In a function I can use the statement n = > sys._getframe().f_code.co_name to get the name of the current > function. Given that I can get the name ho

Re: Technical Answer - Protecting code in python

2007-03-22 Thread Bart Willems
Aaah, *now* we're getting somewhere... :-) >> All he wants is something that turns 'readable, >> changeable python' into 'unreadable, immutable python'. > > chown scriptuser script.py # a unique user > chmod a-rwx script.py > chmod u+rx script.py > > I believe that fully meets the functional r

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Bart Ogryczak
On Mar 26, 3:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > OK... > I've been told that Both Fortran and Python are easy to read, and are > quite useful in creating scientific apps for the number crunching, but > then Python is a tad slower than Fortran because of its a high level > langua

Re: PyPy 1.0: JIT compilers for free and more

2007-03-29 Thread Bart Ogryczak
On 28 mar, 23:36, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Carl Friedrich Bolz napisa³(a): > > > Welcome to the PyPy 1.0 release - a milestone integrating the results > > of four years of research, engineering, management and sprinting > > efforts, concluding the 28 months phase of EU co-funding! >

Re: How to get the demension of a video file?

2007-03-30 Thread Bart Ogryczak
On Mar 30, 11:56 am, "seppl43" <[EMAIL PROTECTED]> wrote: > Hello there, > > does anybody know, how to get the dimension values (width/height) of a > quicktime (.mov) and/or a avi-file? > Is there perhaps a module which can do this job? Identify from ImageMagick. There is a Python binding (PythonM

Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Bart Willems
> > Even better: pick one entry of your choice from > > http://images.google.com/images?q=%22don%27t+feed+the+troll%22 > > > Michele OMG and here I am thinking that Ken Rockwell's site is full of crap. This one's worse... Does the guy have a job? Or a life? -- http://mail.python.org/mailman/

Re: reverse engineering Excel spreadsheet

2007-04-02 Thread Bart Willems
g for you - writing code against Excel without knowledge of that data will mean that you'll be writing 100 lines of Python code (for instance, to parse formulas) to do something that could have been done in 5 lines of Visual Basic code (or Python for that matter, but I can make a better

Re: Why NOT only one class per file?

2007-04-06 Thread Bart Willems
Steven D'Aprano wrote: > On Wed, 04 Apr 2007 14:23:19 -0700, Chris Lasher wrote: > >> A friend of mine with a programming background in Java and Perl places >> each class in its own separate file in . I informed him that keeping >> all related classes together in a single file is more in the Pytho

Re: tuples are useless???

2007-04-08 Thread Bart Willems
a tuple (I've never needed it): class IndexTuple(tuple): def index(n): # your code goes here would be sufficient, wouldn't it? Best regards, Bart -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple integer comparison problem

2007-04-14 Thread Bart Willems
> if points > 89 and points <= 100: > return "A" > elif points > 89 and points <= 89: > return "B" > elif points > 69 and points <= 79: > return "C" > elif points > 59 and points <= 69: > return "D" > else: > return "F" The previous poste

That might be the case for more complex objects...

2007-04-14 Thread Bart Willems
Dennis Lee Bieber wrote: > On 14 Apr 2007 06:35:34 -0700, "jamadagni" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > In Python, the "variable" NAME does NOT define storage; unlike most > other classical languages where the "variable name" is a storage > address, and the

<    1   2   3   >