Re: Opinion on Pyrex
Carl wrote: > I have recently started to use Pyrex and am amazed by it's useability. > > Are there any alternatives to Pyrex? > > One thing that I haven't figured out is how to embed pure C/C++ source > code into Pyrex. For example, if you have a bunch of C files that you want > to use together with some Python code snippets, how do you practically > achieve this using Pyrex? I have come to the conclusion that it is not > possible without some rewriting and adaptation (translation) of available > C source code (if you don't want to compile and link all your C source > into a statical or dynamical library). > > Carl I'm not sure exactly where you're having problems, but that's what extern cdef's are for. Then you can add the source modules to setup.py, just like you do with the pyrex source. You'll probably gather by now that you're building with distutils, not pyrexc. I've done this on Windows, haven't tried in on other platforms. Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie question: string replace
Diez B. Roggisch wrote:
> [EMAIL PROTECTED] wrote:
> > I have a config file with the following contents:
> > service A = {
> > params {
> > dir = "c:\test",
> > username = "test",
> > password = "test"
> > }
> > }
> >
> > I want to find username and replace the value with another value. I
> > don't know what the username value in advance though. How to do it in
> > python?
>
> Could be done using regular expressions. Ususally for such tasks one
> would prefer pythons string manipulation functions, but if you want to
> preserve whitespace, I think a rex is in order here:
>
>
> import re, sys
>
>
> new_name = "foobar"
>
> rex = re.compile(r'(^.*username *=[^"]*")([^"]*)(".*$)')
> for line in sys.stdin:
> m = rex.match(line)
> if m is not None:
> line = "%s%s%s\n" % (m.group(1), new_name, m.group(3))
> sys.stdout.write(line)
>
>
>
> use with
>
> python script.py < config_in > config_out
>
> Regards,
>
> Diez
--
http://mail.python.org/mailman/listinfo/python-list
Re: python guy ide
ionel wrote: > i'm looking for a clean gui for python with a visual editor of some sort > any sugestions (i know of wxPython but i want to find out if there are > other alternatives) > and it's on win32 :P > Eric? http://www.die-offenbachs.de/detlev/eric3.html -- http://mail.python.org/mailman/listinfo/python-list
Re: shutil.move has a mind of its own
I don't know if this is the problem or, not, but: shutil.move( "C:\omg.txt" , "C:\folder\subdir" ) Needs to have some special handling for the backslashes. Either: shutil.move( r"C:\omg.txt" , r"C:\folder\subdir" ) or: shutil.move( "C:\\omg.txt" , "C:\\folder\\subdir" ) -Don Daniel Bickett wrote: > Hello, > > I'm writing an application in my pastime that moves files around to > achieve various ends -- the specifics aren't particularly important. > The shutil module was chosen as the means simply because that is what > google and chm searches returned most often. > > My problem has to do with shutil.move actually putting the files where > I ask it to. Citing code wouldn't serve any purpose, because I am > using the function in the most straight forward manner, ex: > > shutil.move( "C:\omg.txt" , "C:\folder\subdir" ) > > In my script, rather than a file being moved to the desired location, > it is, rather, moved to the current working directory (in this case, > my desktop -- without any exceptions, mind you). As it happens, the > desired locations are system folders (running windows xp, the folders > are as follows: C:\WINDOWS, C:\WINDOWS\SYSTEM, C:\WINDOWS\SYSTEM32). > To see if this factor was causing the problem, I tried it using the > interpreter, and found it to be flawless. > > My question boils down to this: What factors could possibly cause > shutil.move to fail to move a file to the desired location, choosing > instead to place it in the cwd (without raising any exceptions)? > > Thank you for your time, > > Daniel Bickett > > P.S. I know I said I didn't need to post code, but I will anyway. You > never know :) > > http://rafb.net/paste/results/FcwlEw86.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Programmers Contest: Fit pictures on a page
Chung Leong wrote: > Isn't that an NP-complete problem or am I crazy? It is NP complete. Its known as the "cutting stock problem" (aka "Knapsack problem"). Here's a Wikipedia page that describes it: http://en.wikipedia.org/wiki/Cutting_stock_problem There are commerical applications available that "solve" the problem in 2D for use in the woodworking industry (among others). This is generally done to minimize waste when cutting down panels (plywood, etc) into smaller pieces for cabinets, etc. -Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Programmers Contest: Fit pictures on a page
[EMAIL PROTECTED] wrote: > > > Chung Leong wrote: >> Isn't that an NP-complete problem or am I crazy? > > That makes it a more realistic challange, doesn't it? > > Suppose it was something simple, like calculating a > minimal spanning tree. Every program would produce the > same output. What kind of contest would that be? I was thinking maybe you could use a genetic algorithm, where the fitness function would caluclate the amount of waste. I'm not very familar with how to implement this sort of thing, though. -Don -- http://mail.python.org/mailman/listinfo/python-list
Re: f*cking re module
jwaixs wrote: > To reply to the last part of the discussion and esspecially to Gustavo > Niemeyer, I really apriciate the way in which I had been answered. And > I won't have any questions about the re module that I had before I post > this threat. > > I was frustration and should, probebly, not post this frustration. But > it was never my purpous to ask something stupid or asking it arrogant. > > The python re module is, in my opinion, a non beginner user friendly > module. And it's not meant for beginning python programmers. I don't > have any experience with perl or related script/programming languages > like python. (I prefer to do things in c) So the re module is > completely new for me. > > If I upset someones clean mind posting a "stupid" and "arrogant" > question, I'm sorry and won't post my frustrasion on this usenet group > anymore. > > But thank you for all your help about the re module, > > Noud Aldenhoven I would recommend that you give Kodos a try: http://kodos.sourceforge.net/ Doesn't make the re syntax any easier, but I find that it allows you to more quickly develop workable code. -Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Invoking GUI for app running in background with a keypress
Mathias Dahl wrote: > Jeremy Moles <[EMAIL PROTECTED]> writes: > >> If you want to get crazy you can poll() on one of the evdev nodes >> (/dev/input/event*) and behave accordingly. I do this in a C application >> we use to do the exact same thing you're talking about. >> >> Each successful read from the device returns a 16-byte input_event >> struct (or similar, I'm going from memory here) that represents a key >> action. >> >> A google search returned this: >> >> http://svn.navi.cx/misc/trunk/python/evdev/evdev.py > > Thanks for the pointer. That sounds crazy indeed! Maybe a bit too > crazy (low-level) for me... :) > > I tested the code very briefly: > > $ python evdev.py /dev/input/event0 > > Traceback (most recent call last): >File "evdev.py", line 549, in ? > demo() >File "evdev.py", line 35, in demo > dev = Device(sys.argv[1]) >File "evdev.py", line 91, in __init__ > self.fd = os.open(filename, os.O_RDWR | os.O_NONBLOCK) > OSError: [Errno 13] Permission denied: '/dev/input/event0' > > Loggin in (su:ing) as root solves that problem but I'm not sure I want > to require the user being root to be able to run my program. > > Anyway, thanks again for the hint! > > /Mathias Could you make the script setuid? http://nob.cs.ucdavis.edu/~bishop/secprog/ -Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Comparing 2 similar strings?
William Park wrote: > How do you compare 2 strings, and determine how much they are "close" to > each other? Eg. > aqwerty > qwertyb > are similar to each other, except for first/last char. But, how do I > quantify that? > > I guess you can say for the above 2 strings that > - at max, 6 chars out of 7 are same sequence --> 85% max > > But, for > qawerty > qwerbty > max correlation is > - 3 chars out of 7 are the same sequence --> 42% max > > (Crossposted to 3 of my favourite newsgroup.) > http://www.personal.psu.edu/staff/i/u/iua1/python/apse/ http://www.nist.gov/dads/HTML/editDistance.html -- http://mail.python.org/mailman/listinfo/python-list
Re: os independent way of seeing if an executable is on the path?
Steven Bethard wrote:
> This has probably been answered before, but my Google skills have failed
> me so far...
>
> Is there an os independent way of checking to see if a particular
> executable is on the path? Basically what I want to do is run code like:
> i, o, e = os.popen3(executable_name)
> but I'd like to give an informative error if 'executable_name' doesn't
> refer to an executable on the path.
>
> The idea is to differentiate between errors generated by not being able
> to run the program, and errors generated while running the program. The
> former is a probably a configuration error by my user, the second is
> probably a logic error in my code (or perhaps an error on the executable
> I'm calling).
>
> In Windows, I can read the error file, and get something like:
> "'' is not recognized as an internal or external
> command,\noperable program or batch file.\n"
> and I'm sure I could parse this, but this seems fragile, and clearly os
> dependent.
>
> It's not crucial that I use os.popen3 as long as I have access to the
> input, output and error files. I played around with subprocess for a
> while, but couldn't see any way to do this using that module either.
>
> Thanks for the help,
>
> STeVe
I wrote this 'which' function for Linux, but I think if you changed the ':'
character, it would work on Windows (I think its a ';' on Windows, but I
can't remember):
def which( command ):
path = os.getenv( 'PATH' ).split( ':' )
found_path = ''
for p in path:
try:
files = os.listdir( p )
except:
continue
else:
if command in files:
found_path = p
break
return found_path
-Don
--
http://mail.python.org/mailman/listinfo/python-list
Re: MoinMoin WikiName and python regexes
Ara.T.Howard wrote: > > hi- > > i know nada about python so please forgive me if this is way off base. > i'm trying to fix a bug in MoinMoin whereby > >WordsWithTwoCapsInARowLike > ^^ > ^^ > ^^ > > do not become WikiNames. this is because the the wikiname pattern is > basically > [snip] PHPWiki has the same "feature", BTW. (Sorry, couldn't get MoinMoin to work on Sourceforge, had to use PHPWiki). -Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Python in Games (was RE: [Stackless] Python in Games)
Irmen de Jong wrote: > Patrick Down wrote: >> My understanding is that the upcoming Civilization IV will have python >> scripting. >> > > Also, alledgedly the new BattleField II uses Python in a way... > because I heard that you had to comment out a certain line > in a certain .py file to remove the time limit of the demo :-) > > --Irmen http://developers.slashdot.org/article.pl?sid=05/02/11/1439230&tid=156&tid=204 -Don -- http://mail.python.org/mailman/listinfo/python-list
Reg Ex help
I have a string from a clearcase cleartool ls command. /main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT from /main/parallel_branch_1/release_branch_1.0/4 I want to write a regex that gives me the branch the file was checkedout on ,in this case - 'dbg_for_python' Also if there is a better way than using regex, please let me know. Thanks in advance, Don -- http://mail.python.org/mailman/listinfo/python-list
Which version
Hi, I'm a reasonably experienced in other languages and have just decided to get my feet wet with Python. But I'm using FC6 which has v2.4.4 installed, is this good enough to start out with or am I likely to encounter bugs that have been fixed in later versions. Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Which version
Eric,Fredrik, Many thanks for your prompt advice, it was a 'better safe than sorry' type of question. Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Question on for loop
I'm interested to know why you're trying this as well. Is this something that would be helped by creating a class and then dynamically creating instances of that class? Something like... class Fruit: def __init__(self, name): self.name = name for fruit in ['banana', 'apple', 'mango']: varName = Fruit(fruit) # do stuff with varName On Thursday, January 3, 2013 2:04:03 PM UTC-6, [email protected] wrote: > Dear Group, > > If I take a list like the following: > > > > fruits = ['banana', 'apple', 'mango'] > > for fruit in fruits: > >print 'Current fruit :', fruit > > > > Now, > > if I want variables like var1,var2,var3 be assigned to them, we may take, > > var1=banana, > > var2=apple, > > var3=mango > > > > but can we do something to assign the variables dynamically I was thinking > > of > > var_series=['var1','var2','var3'] > > for var in var_series: > > for fruit in fruits: > >print var,fruits > > > > If any one can kindly suggest. > > > > Regards, > > Subhabrata > > > > NB: Apology for some alignment mistakes,etc. -- http://mail.python.org/mailman/listinfo/python-list
How to install Python.h on FreeBSD 10.0-RELEASE?
The installed python packages are shown below. Searches lead me to believe that a PTH option make play a role. $ uname -v FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 [email protected]:/usr/obj/usr/src/sys/GENERIC $ pkg info | grep python py27-dnspython-1.14.0 DNS toolkit for Python py27-notify-0.1.1_11 python bindings for libnotify py27-telepathy-python-0.15.19_1 Python bindings for the Telepathy framework python-2.7_2,2 The "meta-port" for the default version of Python interpreter python2-2_3The "meta-port" for version 2 of the Python interpreter python27-2.7.12Interpreted object-oriented programming language python3-3_3The "meta-port" for version 3 of the Python interpreter python34-3.4.5 Interpreted object-oriented programming language $ cd /usr/ports/lang/python $ make config ===> No options to configure ------- Thank you, -- Don Kuenz KB7RPU There be triple ways to take, of the eagle or the snake, Or the way of a man with a maid; But the seetest way to me is a ship's upon the sea In the heel of the Northeast Trade. - Kipling -- https://mail.python.org/mailman/listinfo/python-list
Re: How to install Python.h on FreeBSD 10.3-RELEASE?
In article you wrote: > In article <[email protected]>, Don Kuenz wrote: >> >>The installed python packages are shown below. Searches lead me to >>believe that a PTH option make play a role. >> >> >>$ uname -v >>FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 >>[email protected]:/usr/obj/usr/src/sys/GENERIC >> >>$ pkg info | grep python >>py27-dnspython-1.14.0 DNS toolkit for Python >>py27-notify-0.1.1_11 python bindings for libnotify >>py27-telepathy-python-0.15.19_1 Python bindings for the Telepathy framework >>python-2.7_2,2 The "meta-port" for the default version >>of Python interpreter >>python2-2_3The "meta-port" for version 2 of the >>Python interpreter >>python27-2.7.12Interpreted object-oriented programming >>language >>python3-3_3The "meta-port" for version 3 of the >>Python interpreter >>python34-3.4.5 Interpreted object-oriented programming >>language >> >>$ cd /usr/ports/lang/python >>$ make config >>===> No options to configure >> >>--- >> > > Why not upgrade to 10.2 ? A newer host is loaded with 10.3. It uses identical python packages. It seems that FreeBSD python has been neglected for years. $ uname -v FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 02:10:02 UTC 2016 [email protected] g:/usr/obj/usr/src/sys/GENERIC $ pkg info | grep python py27-dnspython-1.12.0 DNS toolkit for Python py27-notify-0.1.1_11 python bindings for libnotify py27-telepathy-python-0.15.19_1 Python bindings for the Telepathy framework python-2.7_2,2 The "meta-port" for the default version of Python interpreter python2-2_3The "meta-port" for version 2 of the Python interpreter python27-2.7.12Interpreted object-oriented programming language python3-3_3 The "meta-port" for version 3 of the Python interpreter python34-3.4.5 Interpreted object-oriented programming language Thank you, -- Don Kuenz KB7RPU It's easier to mend neglect than to quicken love. - Saint Jerome -- https://mail.python.org/mailman/listinfo/python-list
Re: How to install Python.h on FreeBSD 10.3-RELEASE?
It turns out that the question isn't "How to install Python.h?" The question is "Why doesn't make find Python.h?" # uname -v FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 # cd / # find . -name 'Python.h' /usr/local/include/python2.7/Python.h /usr/local/include/python3.4m/Python.h $ uname -v FreeBSD 10.3-RELEASE-p7 #0: Thu Aug 11 18:38:15 UTC 2016 # cd / # find . -name 'Python.h' /usr/local/include/python2.7/Python.h /usr/local/include/python3.4m/Python.h Making all in src/cpython make all-am depbase=`echo data_arc.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh In file included from data_arc.c:19:0: data.h:22:20: fatal error: Python.h: No such file or directory #include ^ compilation terminated. *** Error code 1 It seems that a symbolic link may be needed. Fortunately the developer is working with me on this problem. He may know the best way to proceed. Thank you, -- Don Kuenz KB7RPU Science is built up with facts, as a house is with stones. But a collection of facts is no more a science than a heap of stones is a house. - Poincare -- https://mail.python.org/mailman/listinfo/python-list
Re: How to install Python.h on FreeBSD 10.3-RELEASE?
The Doctor wrote: > In article <[email protected]>, Don Kuenz wrote: >> >>It turns out that the question isn't "How to install Python.h?" The >>question is "Why doesn't make find Python.h?" >> >> >> >># uname -v >>FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 >> >># cd / >># find . -name 'Python.h' >>/usr/local/include/python2.7/Python.h >>/usr/local/include/python3.4m/Python.h >> >> >> >>It seems that a symbolic link may be needed. Fortunately the developer >>is working with me on this problem. He may know the best way to proceed. > > Which version of Python do you wish to use? It's best for me to know how to use either version. It's OK if each version is mutually exclusive. Thank you, -- Don Kuenz KB7RPU Every tool carries with it the spirit by which it has been created. - Heisenberg -- https://mail.python.org/mailman/listinfo/python-list
newbie
Purchased the book python-basics-2020-05-18.pdf a few days ago. To direct my learning I have a project in mind as per below; Just started learning python 3.8. At 76 I will be a bit slow but fortunately decades ago l learnt pascal. I am not asking programming help just guidance toward package(s) I may need. My aim is to write a program that simulates croquet - 2 balls colliding with the strikers (cue) ball going into the hoop (pocket), not the target ball. I want to be able to move the balls around and draw trajectory lines to evaluate different positions. Is there a package for this or maybe one to draw and one to move? Any help much appreciated. -- Regards, Don Edwards I aim to live forever - or die in the attempt. So far so good! Perth Western Australia -- https://mail.python.org/mailman/listinfo/python-list
In Python language, what is (void) referring to?
void...? -- https://mail.python.org/mailman/listinfo/python-list
Re: wxPython GUI designer
aum wrote: > On Sun, 18 Jun 2006 13:09:08 -0700, diffuser78 wrote: > >> I am newbie learning wxPython. I tried using GUI designer called >> wxGlade. When it generated code I couldnt get the same level of >> flexibility as writing the code by oneself. >> >> Any view on what you think about using GUI designer tools. >> >> Every help is appreciated. > > I use wxGlade all the time, and find it's great. My only complaint is that > there are some controls it doesn't know about, such as wx.HtmlWindow, and > I have to add these controls in wxGlade as 'custom' controls. But to me, > that's pretty minor. > > To get the best out of wxGlade, you really need to subclass the classes > that wxGlade generates. Don't look to wxGlade to write your app for you. > It's there for gui structure (the 'view'), and it's up to you to flesh out > the 'controller' side. > > So I'd recommend you persist with wxGlade - subclass all the classes that > wxGlade generates, and add your own methods to handle events, set up the > gui as you want, and (in some rare cases) do some extra initial bindings. > > I typically set wxGlade to generate a file called 'myapp_ui.py', and I > write my own 'myapp.py', in which I 'import myapp_ui', then subclass the > wxGlade-generated classes in 'myapp_ui'. > > Works a treat for me, and saves a lot of time compared to hand-coding the > GUI. > I second this approach to using wxGlade, it works really well although I have not seen it documented anywhere. I am not sure if 'aum' meant this, but I let wxGlade generate the event methods for me in 'myapp_ui.py' and then override them in 'myapp.py'. You have full control over the code in your own 'myapp.py' and you rarely have to mess with 'myapp_ui.py' so you can let wxGlade keep control of that file. wxGlade does not support GridBag sizers, which is a shame, but otherwise its support for sizers is good. I find it easy to use sizers in wxGlade. Pythoncard does not yet support sizers and I have never been able to get Boa's sizers to work consistently. wxGlade is a bit flaky on Windows but if you save often then it is OK. I was unsure about it at first, but now I like wxGlade's notion of not being a full-up IDE as it lets me choose the rest of the tool chain. wxGlade will play happily with anything: vim, emacs, Eclipse/Pydev, etc... Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: wxPython GUI designer
Frithiof Andreas Jensen wrote: > 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. > Use spacers. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: help a newbie with a IDE/book combination
kilnhead wrote: > I have used spe and pyscripter on windows. I currently use Eclipse and > this it is the best of the lot in terms of functionality. However, it > does take some effort to get comfortable with. I only wish it had a GUI > builder for python. > I have found that wxGlade plays nicely with Eclipse/Pydev extensions. Eclipse recognizes when wxGlade modifies a .py file and reloads it if you have it open for editing. The Pydev debugger works (for me) with wxGlade (wxPython) applications. wxGlade does not try to impose a project file structure so Eclipse can manage all of the files, just create wxGlade's files in the Eclipse project folder and refresh the project to get Eclipse to recognise them. I have not tried it but I think that you can launch wxGlade from within Eclipse as an 'External Tool'. I find it easy enough just to have both Eclipse and wxGlade running at the same time. Don. -- http://mail.python.org/mailman/listinfo/python-list
pyparsing listAllMatches problem
hello,
I'm using pyparsing and trying to parse something like:
test="""Q(x,y,z):-Bloo(x,"Mitsis",y),Foo(y,z,1243),y>28,x<12,x>3"""
and also have all comparison predicates in a separate list apart from the
parse tree. So my grammar has this line in it:
Comparison_Predicate = Group(variable + oneOf("< >")
+ integer).setResultsName("pred",listAllMatches=True)
but it doesn't work at all... only the last comp.pred. gets in the pred
attribute...
here's the full listing:
from pyparsing import Literal, Word, nums, Group, Dict, alphas,
quotedString, oneOf, delimitedList, removeQuotes, alphanums
lbrack = Literal("(").suppress()
rbrack = Literal(")").suppress()
integer = Word( nums )
variable = Word( alphas, max=1 )
relation_body_item = variable | integer |
quotedString.setParseAction(removeQuotes)
relation_name = Word( alphas+"_", alphanums+"_" )
relation_body = lbrack + Group(delimitedList(relation_body_item)) + rbrack
Goal = Dict(Group( relation_name + relation_body ))
Comparison_Predicate = Group(variable + oneOf("< >")
+ integer).setResultsName("pred",listAllMatches=True)
Query = Goal.setResultsName("head") + ":-" + delimitedList(Goal |
Comparison_Predicate)
test="""Q(x,y,z):-Bloo(x,"Mitsis",y),Foo(y,z,1243),y>28,x<12,x>3"""
print Query.parseString(test).pred
P.S. another weird thing is that, depending on if I setResultsName("head")
in the first Goal match, the first Goal, gets inside an extra list!What I
mean is that the parsed token without setResultsName("head") is this:
['Q', ['x', 'y', 'z']]
and with setResultsName("head") is this:
[['Q', ['x', 'y', 'z']]]
--
Χρησιμοποιώ κάποια δόση υπερβολής...
--
http://mail.python.org/mailman/listinfo/python-list
Re: pyparsing listAllMatches problem
On Sat, 09 Sep 2006 20:46:29 +0300, Paul McGuire
<[EMAIL PROTECTED]> wrote:
> Thanks for posting this test case. This is a bug in pyparsing. I'll
> have a
> fix ready shortly.
>
> -- Paul
Ur welcome, I hope you find the bug and squash it :). I temporalily solved
my problem (in case anyone else has it) by changing another definition and
including a second call to setResultsName.
I modified the Goal definition from
Goal = Dict(Group( relation_name + relation_body ))
to
Goal = Dict(Group( relation_name + relation_body
)).setResultsName("glist",listAllMatches=True)
if an extra .setResultsName("glist",listAllMatches=True) is added, then
both calls to setResultsName (in Goal and Comparison_Predicate) suddenly
work as planned! weird huh? I don't think this generally works, but it's
worth a try until the bug is fixed...
--
Χρησιμοποιώ κάποια δόση υπερβολής...
--
http://mail.python.org/mailman/listinfo/python-list
Newbie question: Multiple installations of Python on Windows machines
I have Python 2.4.2 installed on a Windows XP machine. There is an application that I want to use that refuses to install unless I have Python 2.3.x installed. (The only way that I can install this is to use it's .exe installer) Can I install two versions of Python on Windows, and if so is there something I should do to make sure that the right version is used at the right time? (2.3.x with this one package, and 2.4.2 with everything else). Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie question: Multiple installations of Python on Windows machines
Fuzzyman wrote: > A lot of 'exe' installers are special types of zip archvies. You might > be able to open it using winzip or winrar and do a manual install. Interesting suggestion that would never have occured to me. One of the unzippers I tried (IZArc) did show me a directory of the contents, but it would still not let me extract the files. > Another alternative is to use the free VMWare player to create a fresh > windows install that will run in a window. You can then install Python > 2.3 and your application and extract the files you need to see if you > can make it work under Python 2.4. So I tried this and copied the files from my virtual machine to the site-packages folder on my real Python 2.4 machine, I then ran into there being a compiled extension. > > If the application contains compiled extensions then they won't be > portable from Python 2.3 to Python 2.4 - however the application will > almost certainly run with Movable Python 2.3 (which won't interfere at > all with your Python 2.4 install). > >http://www.voidspace.org.uk/python/movpy/ I could use a virtual machine with 2.3 installed, but neither option appeals to me right now as I want to use the rest of my Python installed stuff (and Eclipse Pydev) stuff - which is why I wanted to continue with Python 2.4 in the first place. I have got a copy of the C source for the extension, can anybody give me/point me a cookbook recipe for making my own version of the extension that will play with 2.4? This is for Windows XP and I don't currently have a C compiler installed. > Fuzzyman Some great suggestions. Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie question: Multiple installations of Python on Windows machines
Fuzzyman wrote: > > It means installing a compiler (but I don't see a way around that) - > but this worked for me : > > http://www.vrplumber.com/programming/mstoolkit/index.html > > So long as the module can be installed with distutils, the instuctions > there will work for you. Hefty download though. > Oh, I was not expecting something like this. I wonder if anyone has tried the newish free Visual Studio 2005 Visual C++ Express insatll instead of all of the stuff that this link calls for plus mods to distutils. I suppose that it would too much to hope for. Ah well. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: PyDev/Eclipse Help
Greg Lindstrom wrote: > I am running Python 2.4 on Windows XP "Professional" and Eclipse 3.1. I > would like to take a look at PyDev on Eclipse and downloaded the PyDev > (1.0.2?) via the Help->SotwareUpdates->FindAndInstall wizard. Then then > go to create a Python Project with File->New->Project and then select > Pydev->Pydev Project and get an Error Dialog stating: "The selected > wizard could not be started. Reason: Plug-in org.python.pydev was > unable to load class > org.python.pydev.ui.wazards.project.PythonProjectWizard." Can any of > you wizards tell me what this means (well, OK, I *know* it means I can't > load PythonProjectWizard, but you get my drift, right?). > > Thanks for your help...see yo in Dallas! > --greg > > I don't know the answer, but you might get one from the Pydev forum http://sourceforge.net/forum/forum.php?forum_id=293649 Don. -- http://mail.python.org/mailman/listinfo/python-list
Use of __slots__
Hi: I am puzzled about the following piece of code which attempts to create a class that can be used as record or struct with a limited set of allowed attributes that can be set into an instance of the class. class RecordClass(object): __slots__ = ["foo"] def __init__(self, args): print "Initial slots = ", RecordClass.__slots__ RecordClass.__slots__ = list(args) print "Final slots = ", RecordClass.__slots__ pass def new_record(slotlist): return RecordClass(slotlist) if __name__ == "__main__": record1 = new_record(["age", "name", "job"]) record1.age = 27 record1.name = 'Fred' record1.job = 'Plumber' record1.salary = 5 When executed I get: Initial slots = ['foo'] Final slots = ['age', 'name', 'job'] Traceback (most recent call last): File "D:\ProgrammingProjects\JustForTesting\recordclasses.py", line 37, in ? record1.age = 27 AttributeError: 'RecordClass' object has no attribute 'age' I don't understand why I cannot set an attribute 'age' into record1. Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Use of __slots__
Steve Juranich wrote: > I might be a little confused about a couple of things (I'm sure many will > correct me if I'm not), but as I understand it the __slots__ attribute is a > class-attribute, which means it cannot be modified by an instance of the > class (think of a "static" class member, if you know C++). > Interesting, actually I was only doing this while noodling around trying to learn Python. Does Python have the notion of static class attributes? Just what was going on when I redefined my __slots__ attribute? It looks as if __slots__ is something really special, or I am managing to hide the original __slots__ value in my __init__ method but not really overriding its effect. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Use of __slots__
Alex Martelli wrote: > meant for extremely RARE use, and only by very advanced programmers who > fully know what they're doing Yea, from the table of my memory I ’ll wipe away all trivial fond records of __slots__ (Bet you wish Mark Lutz had not mentioned it in Learning Python ...) Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever separated from the love of God in a place called Hell. The Holy Bible descibes Hell as a place of eternal torment, suffering, pain and agony for all those who have rejected Jesus Christ. The good news is that you can avoid Hell by allowing Jesus Christ to save you today. Only then will you have true peace in your life knowing that no matter what happens you are on your way to Heaven. by [email protected]
The truth is, Jesus should never have torn down the fig tree. He got so pissed off at the fig tree for not having figs, even though it wasn't fig season. This was not the action of someone who has even a little truth and light. Imagine if Jesus came back now. I'd hate to see his road rage. -- http://mail.python.org/mailman/listinfo/python-list
Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever sepa
> > I suppose he could point at what he saw and wither it. > Jesus would then give a sermon from the mount: Let the Puritans wear fig leaves over their eyes! -- http://mail.python.org/mailman/listinfo/python-list
Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever separated from the love of God in a place called Hell. The Holy Bible descibes Hell as a place of eternal torment, suffering, pain and agony for all those who have rejected Jesus Christ. The good news is that you can avoid Hell by allowing Jesus Christ to save you today. Only then will you have true peace in your life knowing that no matter what happens you are on your way to Heaven. by [email protected]
>> > > Who is this Jesus you are talking about? Does he know Python or > something? What do fig trees have to do with Python and/or Jesus? Bertand Russell said it best: Then there is the curious story of the fig tree, which always rather puzzled me. You remember what happened about the fig tree. "He was hungry; and seeing a fig tree afar off having leaves, He came if haply He might find anything thereon; and when He came to it He found nothing but leaves, for the time of figs was not yet. And Jesus answered and said unto it: 'No man eat fruit of thee hereafter for ever' . . . and Peter . . . saith unto Him: 'Master, behold the fig tree which thou cursedst is withered away.'" This is a very curious story, because it was not the right time of year for figs, and you really could not blame the tree. I cannot myself feel that either in the matter of wisdom or in the matter of virtue -- http://mail.python.org/mailman/listinfo/python-list
Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever separated from the love of God in a place called Hell. The Holy Bible descibes Hell as a place of eternal torment, suffering, pain and agony for all those who have rejected Jesus Christ. The good news is that you can be sure you are going to Heaven when this life is over if you allow Jesus Christ to save you today. Do not wait until later to be saved because you do not know exactly when you will die. [ Posted by: [email protected] on May 14, 2005 ] [ 2:52:09 pm ]
> http://www.gotquestions.org/sinners-prayer.html << I saw this site on a > search directory. Great Resource! > C'mon, this is the 21st century. Nobody believes that silly story about God having a son anymore. Think about it. The original story is always the best. The sequel is always a commercial rip-off. Frankenstein was literature. Son of Frankenstein was silly. God impregnates a virgin woman and gives birth to a half man/half god, who can walk on water and turn water into wine, but who can't defend himself very well at all from the Romans. This story may have sold in the past, but not now. We've become too sophisticated for this kind of fantasy. -- http://mail.python.org/mailman/listinfo/python-list
Re: space saving retitle of thread
On Mon, 16 May 2005 14:30:07 UTC, "Johnny Gentile" <[EMAIL PROTECTED]> wrote: > And this is OK w/ Google? > most assurredly not. the google police will come to your house and shake it until all the electrons fall out, and you can no longer connect to the internet you Have Been Warned -- -don hindenach- donh at audiosys dot com -- http://mail.python.org/mailman/listinfo/python-list
Killing threads during development.
I've been developing with external multi-threaded libraries recently. I find it difficult to use the Python prompt to experiment with these libraries because there isn't any way to just shutdown all threads and try things again. If I try to exit the prompt with background threads running, then Python hangs and I have to kill the process to exit. Ctrl C won't do it. Is there some way to brutally kill all background threads? Just for development purposes? Note: This isn't an insurmountable problem. If I write test scripts and run them from the command line I can still kill them easily. I just find it frustrating not be to able to explore interactively while working with a new library. -- http://mail.python.org/mailman/listinfo/python-list
Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?
Ask yourself WHY havn't I seen this footage before? **** "Don, why havent you seen this footage before?" he asked himself, self- referentially in the best tradition of Douglas R. Hofstadter. 'Er, because I haven't seen it before?" Don responded in a tautological fashion. (uproarius laughter ensues) -- http://mail.python.org/mailman/listinfo/python-list
Basic GUI
I'm writing a simple GUI that: ..gets info via telnet protocol (and sends) ..gets info via http (and sends) ..gets user-info from (currently) ...Tkinter Text windoze ...Tkinter buttons and such ..displays info in various Tkinter windoze ...graphic AND text... I can accomplish all of these functions individually and now seem to need to set up multi-processes to combine 'em. Back in my C days, I'd have used fork/exec to do so, but I'm confused by the number of modules available in Python. Is there a "best" for portability and simplicity? (Or am I on the wrong track here?) I could solve my problems with the following psuedo-code made into real code: import blah t = blah.fork(runthisprogram.py) #OK still in main t.sendinfo(info) info = t.receiveinfo() #runthisprogram.py def sendinfobacktopapa(): ? eventhere def getinfofrompapa(): ? eventhere It seems to me that propagating events *may* be the best way to communicate. I'm wide open, including to non-multi-process solutions. Thanks for your comments, I searched old posts for a while, various other Python info-sources, and couldn't find an answer. -- don -- http://mail.python.org/mailman/listinfo/python-list
Re: 911 was a RACIST crime by YANK BASTARDS against all other NATIONS Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?
911's primary utility was that, inadvertently, it sparked off the formation of the global brain: The Social Superorganism and its Global Brain http://pespmc1.vub.ac.be/SUPORGLI.html Have a nice Monday, all. - Don -- http://mail.python.org/mailman/listinfo/python-list
Re: ANNOUNCE: wxPython 2.8.6.0
Robin Dunn wrote: > Announcing > -- > > The 2.8.6.0 release of wxPython is now available for download at > http://wxpython.org/download.php. This release is mostly about fixing > a number of bugs and inconsistencies in wxWidgets and wxPython. This raises a policy question for me. I'm currently on 2.8.3, not having had any clear need to upgrade for a while. Is there any reason why I shouldn't continue to track the releases, but not upgrade to them until I need something specific (a fix for a bug, a new feature I want, ...)? For example, if I don't upgrade to 2.8.x.y when it comes out, might I have trouble in the future upgrading to 2.8.x+9.w? BTW, since I haven't said it recently: thanks again for a really useful product and support forum for it! -- Don Dwiggins Advanced Publishing Technology -- http://mail.python.org/mailman/listinfo/python-list
How to do transparent (opaque) windows from Python
I want to build an application in Python that can show an opaque window so that you can still see and type into any window that it covers. Sort of like a software mylar transparency sheet placed over the screen. I need to be able to type 'through' the transparency into the underlying application, focus remains on the underlying window. My application is assisted typing, but I can envisage other uses such as on-screen rulers. While I would like this to be multi-platform, I need it in MS-Windows. Does anyone know of any Python packages that can do this type of thing? Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: PyDev 1.3.9 code compleition trouble
Vyacheslav Maslov wrote: > I use Pydev 1.3.9 and notice issue related to code completion. I give an > ...stuff deleted... > proposed also as well. Why this doesn't work? You will have better luck asking this question on the Pydev forum: http://sourceforge.net/forum/forum.php?forum_id=293649 The SF forum is also mirrored on gmane as: gmane.comp.ide.eclipse.plugins.pydev.user Fabio provides an _amazing_ level of support for Pydev on this forum, I don't think he ever sleeps. Don. -- http://mail.python.org/mailman/listinfo/python-list
How to change IP Address by Python program on Win Platform
is there software available to change or hide my ip add? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list
Re: lambda functions ?
Maybe you would like a generator: >>> def f(n): ... while True: ... n += 1 ... yield n ... >>> a = f(5) >>> >>> a.next() 6 >>> a.next() 7 >>> a.next() 8 >>> a.next() 9 >>> On 2/5/07, Maxim Veksler <[EMAIL PROTECTED]> wrote: > Hello, > I'm new on this list and in python. > > It seems python has some interesting concept of "ad hoc" function > which I'm trying to understand without much success. > > Take the following code for example: > > """ > >>> def make_incrementor(n): > ... return lambda x: x + n > ... > >>> f = make_incrementor(42) > >>> f(0) > 42 > >>> f(1) > 43 > """ > > I really don't understand whats going on here. > On the first instantiating of the object "f" where does "x" gets it's > value? Or is it evaluated as 0? ie "x: 0 + 42" > > And what is the "f" object? An integer? a pointer? an Object? > I'm coming from the C world... > > Could some please try (if even possible) to implement the above code > without using "lambda" I believe it would help me grasp this a bit > faster then. > > Thank you, > Maxim. > > > -- > Cheers, > Maxim Veksler > > "Free as in Freedom" - Do u GNU ? > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: string.find for case insensitive search
lower() is also deprecated :) oh well On 7 Feb 2007 21:06:08 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Johny" <[EMAIL PROTECTED]> wrote: > > > Is there a good way how to use string.find function to find a > > substring if I need to you case insensitive substring? > > s.lower().find(substring.lower()) > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: string.find for case insensitive search
string.find is deprecated as per the official python documentation. take a look at the "re" module On 7 Feb 2007 12:53:36 -0800, Johny <[EMAIL PROTECTED]> wrote: > Is there a good way how to use string.find function to find a > substring if I need to you case insensitive substring? > Thanks for reply > LL > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: string.find for case insensitive search
My apologies, I confused the built-in "str" with the module "string". I was reading from the section of the 2.4.4 docs called: 4.1.4 Deprecated string functions On 2/7/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Don Morrison wrote: > > lower() is also deprecated :) oh well > > The string method .lower() is not deprecated. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
Re: string.find for case insensitive search
> Don Morrison wrote: > > string.find is deprecated as per the official python documentation. > > > but the str.find() method isn't. > > > take a look at the "re" module > > > A possibility. > > regards > Steve Thank you everyone. :) Johny did say "string.find" in his message, not "str.find", but continue to proceed with flogging. thank you! -- http://mail.python.org/mailman/listinfo/python-list
Generating pdf files in epydoc on Windows
Does anyone know what is needed to install to get epydoc to generate pdf files on Windows. Besides epydoc itself of course. Maybe there is a more appropriate forum to ask newbie questions about epydoc? Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Generating pdf files in epydoc on Windows
Duncan Smith wrote: > As I remember, LaTeX and ghostscript. Thanks. OK, I have these installed now, but apparently epydoc can't find them and I don't know how to teach it to find them. Error: latex failed: [Errno 2] The system cannot find the file specified epydoc does creates some .tex files when I ask it for .pdf o/p. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Testers please
martien friedeman wrote: > I have written this tool that allows you to look at runtime data and > code at the same time. > And now I need people to test it. > > The easiest way to see what I mean is to look at some videos: > http://codeinvestigator.googlepages.com/codeinvestigator_videos > > It requires Apache and Sqlite. > > It works for me with a Firefox browser on Linux. > ODB, the Omniscient Debugger, for Java does the same sort of thing and more. http://www.lambdacs.com/debugger/ODBDescription.html I would love to have one of these for Python. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Help Required for Choosing Programming Language
[EMAIL PROTECTED] wrote: > I am VB6 programmer and wants to start new programming language but i > am unable to deciced. > > i have read about Python, Ruby and Visual C++. but i want to go > through with GUI based programming language like VB.net > By 'GUI based programming language' I think that you mean an integrated development environment that includes a visual designer that allows you to layout your GUI and that generates a skeleton application for you to complete. If this is so then the nearest thing that I have found is Boa Constructor, although you will need to know more about the underlying windowing system (wxPython) than you would when using VB.net in Visual Studio. Another system worth a close look is Pythoncard. Other folks have already mentioned Dabo, but this is probably too early in its development for your needs. As an alternative, you can make your own choice of editor/IDE and use a stand-alone visual designer for your GUI. I like Pydev/Eclipse for an IDE and wxGlade for the visual designer. Again, you will need to learn something about wxPython if you want avoid lots of frustration - Robin Dunn's book 'wxPython in Action' is good. There are probably similar toolkits available for combinations of Python and other windowing systems (Tkinter, Qt). Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Found a product for running Python-based websites off CDROM -have anybody tried it?
David Wishnie wrote: > Hello, > > Recently I've found a product that allows to create CDs or DVDs with > mod_python -based websites > (and CGI python of course) so that apache-based webserver, python and > mod_python are run directly > off CD on Windows, MacOS X and Linux at the same time (also it seems > to support perl, java, > php and mysql + SQLite as databases). > > http://www.stunnix.com/prod/aws/overview.shtml > > Have anybody tried it? I'm considering to use it for several projects. > > Thanks, > David > That is an expensive product ($789) especially considering it mostly consists of FOSS pieces. I found XAMPP, a FOSS, that is almost the same thing: http://portableapps.com/apps/development/xampp and this thread for getting mod_python running (scroll down a bit to the second post): http://www.apachefriends.org/f/viewtopic.php?t=21169&highlight=python I have not tried this yet. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.
On 11/13/07 5:03 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 13:37:13 +0100, Hendrik Maryns > <[EMAIL PROTECTED]> wrote: > >> ||__|| | Please do | >> / O O\__ NOT > > Do NOT tell folks what to do in Usenet, dipshit. Notice the "please do not.." That means it is a request, not a demand. A demand is if I said to you "Quit making such absolutely stupid posts," which by the way, is a good idea. Or I might say "Try to understand a post before you post comments, dipship." See the difference, dipshit? -- http://mail.python.org/mailman/listinfo/python-list
Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.
On 11/13/07 5:05 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 16:18:58 +0100, Richard G Riley > <[EMAIL PROTECTED]> wrote: > >> Your ascii art, while pretty, convinces no one ... > > > It's pretty goddamned retarded, actually... as was the post itself. You're both beyond reaching rationally. Now. Please don't feed the trolls, trolls. -- http://mail.python.org/mailman/listinfo/python-list
Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.
On 11/13/07 8:04 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 17:43:01 -0800, Don Bowey <[EMAIL PROTECTED]> wrote: > >> On 11/13/07 5:05 PM, in article [EMAIL PROTECTED], >> "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: >> >>> On Tue, 13 Nov 2007 16:18:58 +0100, Richard G Riley >>> <[EMAIL PROTECTED]> wrote: >>> >>>> Your ascii art, while pretty, convinces no one ... >>> >>> >>> It's pretty goddamned retarded, actually... as was the post itself. >> >> You're both beyond reaching rationally. >> >> Now. Please don't feed the trolls, trolls. >> >> > FUCK OFF, BOWEY BOY! > > What part of "DO NOT TELL OTHERS WHAT TO DO IN USENET" do you not > understand, you retarded FUCK!? Well, dim-boy, you did it again. I said Please, so it was a request. If I *told* you to do something, I might say "Go to hell," Notice that I did not ask you to do that; I commanded it. Work on it. You might figure it out. -- http://mail.python.org/mailman/listinfo/python-list
Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.
On 11/13/07 8:03 PM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 17:40:30 -0800, Don Bowey <[EMAIL PROTECTED]> wrote: > >> On 11/13/07 5:03 PM, in article [EMAIL PROTECTED], >> "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: >> >>> On Tue, 13 Nov 2007 13:37:13 +0100, Hendrik Maryns >>> <[EMAIL PROTECTED]> wrote: >>> >>>> ||__|| | Please do | >>>> / O O\__ NOT >>> >>> Do NOT tell folks what to do in Usenet, dipshit. >> >> >> Notice the "please do not.." That means it is a request, not a demand. >> >> A demand is if I said to you "Quit making such absolutely stupid posts," >> which by the way, is a good idea. >> >> Or I might say "Try to understand a post before you post comments, dipship." >> >> See the difference, dipshit? > > Dipship? > > Bowey boy... You are out of your league. So fuck off. Wrong again. I'm way out of *your* pitiful league. -- http://mail.python.org/mailman/listinfo/python-list
Re: A JEW hacker in California admits distributing malware that let him steal usernames and passwords for Paypal accounts.
On 11/14/07 3:30 AM, in article [EMAIL PROTECTED], "ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote: > On Tue, 13 Nov 2007 20:32:10 -0800, Don Bowey <[EMAIL PROTECTED]> wrote: > >> Notice that I... > > acted like a total retard... again. > > Good job, retard boy. No problem. I'm glad I could help, paleo-boy. -- http://mail.python.org/mailman/listinfo/python-list
A defense for bracket-less code
Found in a style guide (http://www.artlogic.com/careers/styleguide.html)
---
Another case where "unnecessary" braces should be used is when writing
an empty while loop:
while (*p++ = *q++)
{
// this loop intentionally left empty...
}
instead of the form that is more commonly found:
while (*p++ = *q++);
By prohibiting this common loop format, we can easily check for cases
where legal (but wrong) code like:
int i = 0;
while (i++ < kLoopLimit);
{
myBuffer[i] = 0;
}
performs a loop with no body, then executes the intended body of the
loop exactly once. Python programmers can stop chuckling now.
---
Don.
--
http://mail.python.org/mailman/listinfo/python-list
Re: Using a browser as a GUI: which Python package
John J. Lee wrote: > "André" <[EMAIL PROTECTED]> writes: > [...] > >>I would like to use a browser (e.g. Firefox) as a simple GUI >>"framework". Note that this is to be done on a single user machine, so >>the question of sandboxing is not really relevant here. > > [...] > >>My ultimate goal would be to port the main features of two >>wxPython-based apps I wrote (rur-ple and Lightning Compiler, both found >>at https://sourceforge.net/project/showfiles.php?group_id=125834) >>within a standard browser. > > > If you can stick to Firefox, you might find XUL useful. There are > various different styles of development that use XUL and Python -- a > bit of Googling and reading should find them. > Bear in mind that I don't know what I am talking about, but I stumbled across 'ZK' the other day put it on my list of thinkgs to check out. It provides a range of XUL and XHTML widgets, see: http://zk1.sourceforge.net/ Has anyone tried this? I would really like to find a GUI toolkit that allowed me to program XUL in Firefox using Python. ZK is not quite that, but it looks close. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: which windows python to use?
Robert Kern wrote: > In what way? Does the mingw gcc that we distribute interfere with Cygwin's > gcc? Robert: Which C compiler will you be using for the Enthought 2.4 Windows release? Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: which windows python to use?
Robert Kern wrote: >>Which C compiler will you be using for the Enthought 2.4 Windows release? > > > Define "using". We build Python with whatever compiler the official build is > compiled with. In this case, MSVC 7., I think . For this release, we > will ship the latest available gcc available for mingw. Some of the extension > modules will be built with this gcc. > I meant to build Python itself. I asked because I was interested in trying your Traits package but could not use it with Python 2.4. I don't have MSVC 7 and I was intimidated by the prospect of building the CTraits extension with either the free MS toolkit or mingw and munging the dlls to conform to the MSVC 7 formats. I just wondered if Enthought's distro for Windows was gcc-based. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Why not Ruby?
Richard Riley wrote on Thu, 01 Jan 2009: > Tim Greer writes: >> That poster has a frequent habit of cross posting to multiple, irrelevant >> news groups. There's no rhyme or reason to it. > > No rhyme nor reason? It's quite clear, to me, why. How is a comparison > article not relevant when he is trying to stimulate discussion about > alternative languages for modern development? Sometimes crossposting can be useful. But you ought to at least be aware of some of the possible drawbacks, e.g. expressed here: http://www.nhplace.com/kent/PFAQ/cross-posting.html In particular, the usual hope by the poster is that the content is relevant to the union of people in the different groups, but the actual experience is that it is often relevant only to the intersection of such people. And, moreover, that a long cross-posted thread on controversial topics often winds up with people talking at cross-purposes past each other, because they don't share enough common values to have a useful conversation. In particular, the poster that started this thread is well known for adding far more noise than signal to any discussion, and for showing no interest in the greater good of any of the communities, but only in his own glorification. You labor under the delusion that there is at least good intent here, and the poster ought to receive the benefit of the doubt. Long prior experience shows that this hope is misplaced. -- Don _______ Don Geddis http://don.geddis.org/ [email protected] The only purpose for which power can be rightfully exercised over any member of a civilized community, against his will, is to prevent harm to others. His own good, either physical or moral, is not a sufficient warrant. -- John Stuart Mill, _On Liberty_ -- http://mail.python.org/mailman/listinfo/python-list
error: (10035, 'The socket operation...
IDLE internal error in runcode()
Traceback (most recent call last):
File "C:\PYTHON25\lib\idlelib\rpc.py", line 235, in asyncqueue
self.putmessage((seq, request))
File "C:\PYTHON25\lib\idlelib\rpc.py", line 332, in putmessage
n = self.sock.send(s[:BUFSIZE])
error: (10035, 'The socket operation could not complete without
blocking')
Does this look familiar to anyone? I can't figure out what to do
about it. Python 2.5, windoze. I get it when I execute a Tkinter op
that works elsewhere.
changing this:
t = self.b.create_text(
(point.baseX + 1)*self.checkerSize/2 + fudge,
y + fudge,
text = str(point.occupied),
width = self.checkerSize)
to
t = self.b.create_text(
(point.baseX + 1)*self.checkerSize/2 + fudge,
y + fudge,
text = str(point.occupied),
font=("Times", str(self.checkerSize/2), "bold"),
width = self.checkerSize)
for example. The same code works fine elsewhere. I thought I'd ask
here before I try (no clue) increasing BUFSIZE in rpc.py? I'm not
crazy about tinkering with code I have no clue about..
--
don
--
http://mail.python.org/mailman/listinfo/python-list
Re: ANN: Python GUI development using XULRunner
On Sep 16, 8:29 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > I've put together a tutorial that shows off how to build a GUI > application using XULRunner (same architectural components as Firefox > uses) that can be used in conjunction with the Python programming language. > > The tutorial covers how to build a Python/XULRunner GUI > application:http://pyxpcomext.mozdev.org/no_wrap/tutorials/pyxulrunner/python_xul... > > The details in this tutorial covers the initial setup to full > packaging/deployment, mostly targeting a Windows/Linux platform (MacOSX > is possible with a few deviations, I have tried to cover these > deviations where applicable). > > Feedback is welcome. > > Cheers, > Todd I get to the "Running" step and run into "Couldn't load XPCOM." Does this work on x86_64? Or have I made a rookie mistake? xulapp1$ ls app docs installer pyxpcom_gui_app xulapp1$ cd pyxpcom_gui_app/ pyxpcom_gui_app$ ls application.ini components extensions pyxpcom_gui_app chrome defaultspylib xulrunner pyxpcom_gui_app$ ./pyxpcom_gui_app Couldn't load XPCOM. -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: Python GUI development using XULRunner
Oh, and Google's single sign-on sucks eggs :-| -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: Python GUI development using XULRunner
On Sep 17, 5:53 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Sep 17, 1:21 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > >> Don Spaulding wrote: > >>> On Sep 16, 8:29 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > >>>> I've put together a tutorial that shows off how to build a GUI > >>>> application using XULRunner (same architectural components as Firefox > >>>> uses) that can be used in conjunction with the Python programming > >>>> language. > >>>> The tutorial covers how to build a Python/XULRunner GUI > >>>> application:http://pyxpcomext.mozdev.org/no_wrap/tutorials/pyxulrunner/python_xul... > >>> I get to the "Running" step and run into "Couldn't load XPCOM." > >>> Does this work on x86_64? Or have I made a rookie mistake? > >> Hi Don, > > >> A good question. Mozilla only provide 32-bit XulRunner applications by > >> default, you you'll need to install the necessary 32-bit compatability > >> libraries on your Linux machine, i.e. for Ubuntu it's something like: > >> sudo apt-get install ia32-libs ia32-libs-gtk > > >> Then you should be able to run the example. You can check the > >> dependencies using something the following commands, there should be no > >> missing dependencies: > >> $ cd pyxpcom_gui_app/xulrunner > >> $ LD_LIBRARY_PATH=. ldd ./xulrunner-bin > > >> It is possible to use a 64-bit version, but you'll need to compile this > >> yourself (or find somewhere that provides these x86_64 versions). Note > >> that the PythonExt project does not offer Python bindings for x86_64 > >> either (it's on my todo list), you can compile the PythonExt part > >> yourself as well if you need a 64-bit version. > > >> Cheers, > >> Todd > > > Interesting, I'm running Ubuntu Intrepid here, and have both ia32-libs > > and ia32-libs-gtk installed. > > > ldd shows that I'm missing the following libs, even though the proper > > packages are installed, and the files show up in /usr/lib. > > > libxcb-render-util.so.0 => not found > > libxcb-render.so.0 => not found > > > There's also /usr/lib/libxcb-render.so.0.0.0 and the same for render- > > util, so I wonder if that could be part of the problem? > > > Don > > Hi Don, > > I'm thinking there may be additional 32-bit packages necessary then (I'm > not sure which package). > > Not sure about Ubuntu 8.10 (it's still alpha). I'm using a Ubuntu 8.04 > x86_64 machine and my dependencies list the following for the latest > 32-bit build of XulRunner: > > $ LD_LIBRARY_PATH=. ldd ./xulrunner-bin | grep libxcb > libxcb-xlib.so.0 => /usr/lib32/libxcb-xlib.so.0 (0xf6493000) > libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf647b000) > > Cheers, > Todd No worries Todd, it is alpha. It was a very recent bug in the 8.10 ia32-libs package, which is now fixed :-D Thanks for the excellent writeup, BTW! I've been wondering what was involved in doing this for a while, it just never made it up my priority list to figure out. Again, thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: Python IDE: great headache....
Sullivan WxPyQtKinter wrote: > IDLE is no longer satisfactory for me. Other IDEs make me very > confused. Really do not know which one to use. > > I use WinXP sp2 for current development. > > So far as I know, Eclipse + PyDev + PyDev Extension is perfect for > source code editing. Since I am really not sure how to use the debugger > module, I really do not know how to add watch to variables etc. Anyone > knows if this platform is a good one? > > I hope that an IDE should be featured with: > 1. Grammar Colored highlights. > 2. Manage project in a tree view or something alike, ie, a project file > navigator. > 3. Code collapse and folding. > 4. Code auto-completion: especially prompting function parameters when > I am typing a function previously defined by myself. Like the one in > Visual Studio series. > 5. Debugging: Breakpoints, conditional pause. watch for variables.step > into, over and out of a function. > What about other IDEs? Since I do not need GUI development. More over, > the free-of-charge IDE is highly preferred. > 6.Indentation management like in IDLE: press ctrl+[/] to modify the > identation of a line or a block. > Sullivan: Eclipse + Pydev does most, if not all, of your list - I am not sure what you mean by conditional pause - plus a whole lot more. One feature in particular that I don't think that I could live without is "Local History" which automatically maintains a series of revisions of each file whenever it is saved. This is coupled with a really nice built-in visual diff that allows you to look back on what changes you have made and restore them selectively. It is a bit like a built-in SVN or CVS system (which Eclipse also has) but at a very fine granularity and completely automatically. It allows you to be very agressive in making changes to files because it is so easy to wind the the clock back. I like Eclipse, but lots of folks on the Python groups seem to hate it with a passion. I think that the problem is that there are a lot of Eclipse concepts and terminology that you need to know before you can use it at all - it is puzzling to use right out of the box. This is compounded by the fact that the Eclipse documentation and tutorials are aimed at the Java programmer, and even so it still seems to be hard for Java programmers to get started in Eclipse. So it is even more difficult for Pythoneers. If you have used Eclipse for doing some Java work then Eclipse + Pydev is a snap, except that you keep looking for some of the wonderful features from the Java Editor that are not yet implemented in Pydev. If you have not used Eclipse for Java then you are likely to give up before you have discovered what it can do for you. If you install Eclipse and try to use it without reading the Workbench User Guide then you are not going to get anywhere. The one major missing Python feature in Pydev is an integrated Python Shell. Fabio has implemented a sort of shell in the debugger that allows you to enter Python statements in the console when you are stopped at a breakpoint - which is really nice. But you cannot use this in the traditional way to develop Python scripts. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python IDE: great headache....
Joel Hedlund wrote: >> If you install Eclipse and try to use it without reading the >> Workbench User Guide then you are not going to get anywhere. > > > Woah, easy now! I never read any "Workbench User Guide" and I'm doing > just fine with PyDev. Fabio Zadrozny (PyDev developer) wrote an > excellent startup guide for python programmers that includes > installing and basic editing: > > http://www.fabioz.com/pydev/manual_101_root.html > > It's all I ever read and it was enough for me to get going with > Eclipse + PyDev within 15 minutes on a WinXP machine. > Sorry to offend, I was just extrapoloating from personal experience. When I was looking for a Java IDE I tried IntelliJ Idea, Netbeans and Eclipse in that order. I found that I could use Idea and Netbeans without reading the manuals, but I could not get going with Eclipse until I read the Workbench User Guide and got the hang of perspectives and views. Even installing it the first time seemed to be a mystery. It is not difficult at all, just different. In retrospect, I don't know why I found it puzzling but I have met others who have had the same experience. It has improved a lot recently, but even the Eclipse web-site was hard to navigate. I think that a lot of the puzzlement comes from the fact that the Eclipse folks present Eclipse not as an IDE, but as a framework where one of the applications happens to be an IDE. Don. -- http://mail.python.org/mailman/listinfo/python-list
Printable string for 'self'
Is there a way to discover the original string form of the instance that is represented by self in a method? For example, if I have: fred = C() fred.meth(27) then I would like meth to be able to print something like: about to call meth(fred, 27) or about to call fred.meth(27) instead of: about to call meth(<__main__.C instance at 0x00A9D238>, 27) Thanks in advance, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Printable string for 'self'
Michael Spencer wrote: > > > In general, this requires exhaustive search of name bindings e.g.,: > > >>> def get_names_of(obj, ns): > ... return [name for name, value in ns.iteritems() if value is obj] > ... > >>> class A(object): > ... def global_names_bound_to_me(self): > ... return get_names_of(self, globals()) > ... > >>> a = A() > >>> a.global_names_bound_to_me() > ['a'] > >>> b = a > >>> a.global_names_bound_to_me() > ['a', 'b'] > >>> > Ah, ok. But, as you show in the example, this technique does not let me figure out which of 'a' or 'b' was used to qualify global_names_bound_to_me(). And if I call my method: A().qualify global_names_bound_to_me() then I get an empty list back. Is what I want to do not possible without referring back to the source? Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Printable string for 'self'
Fredrik Lundh wrote: > objects don't have names in Python, and the source is not part of > the running program. > > have you read this ? > > http://effbot.org/zone/python-objects.htm I have now. Thank you very much. "objects don't have names in Python": It appears from the code that Michael posted that objects can discover the names that are bound to themselves. Is this true in general? If so, then I guess it does not matter which name I use as long as it is bound to the object. "the source is not part of the running program" : Ok, but in my case I would have the source that corresponds to the running program available to me and the inspect module does appear to provide enough information for me to find the corresponding piece of the source code. Is there something wrong with using the inspect module for this sort of work? My overall intent is to try to build something that can record interactions against an object so that they can be replayed later for testing and debugging. I had in mind to generate the recording as a sequence of Python statements. I would like to do this without modifying the source of the target class. At the moment this is just a project to help me learn Python, although it would nice if it did yield something useful. Is there anything around that already does this sort of thing? Cheers, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Printable string for 'self'
Fredrik Lundh wrote: > Q. How can my code discover the name of an object? > > A. The same way as you get the name of that cat you found on your > porch: the cat itself cannot tell you its name, and it doesn't really > care -- so the only way to find out what it's called is to ask all your > neighbours if it's their cat... and don't be surprised if you'll find that > it's known by many names, or no name at all! > > from: > > > http://www.python.org/doc/faq/programming.html#how-can-my-code-discover-the-name-of-an-object > > (fwiw, the current crop of stray cats in my neighbourhood are known > as "sune" and "the big fat red one") I see. "This is a project on which we have been working for the last three centuries since the lamasery was founded, in fact. It is somewhat alien to your way of thought, so I hope you will listen with an open mind while I explain it." "Naturally." "It is really quite simple. We have been compiling a list which shall contain all the possible names of God." - From "The Nine Billion Names of God" by Arthur C. Clarke. http://www.geocities.com/rojodos/docs/90.htm > no, as long as you're aware that you're doing introspection, and that your > code won't run in all Python environments. Yes, it is introspection for a testing tool - not for production code. Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Debugger / IDE ??
Christoph Zwerschke wrote: > [EMAIL PROTECTED] wrote: > >>I like the Pyscripter, is there any Linux version or something of it. > > > Sorry, I forgot to mention that there is a snag in it. Since PyScripter > is based on Python for Delphi, it is available for Windows only. > Is there a free or low-cost version of Delphi for Windows available anywhere? Pyscripter looks interesting but when I went to the Borland site to find out about the cost of Delphi I went into catatonic shock. They can't be serious. Then I read on Wikipedia that "On February 8th, 2006, Borland announced that it was looking for a buyer for its IDE and Database line of products, which included Delphi, to concentrate on its Application Lifecycle Management line." So I guess it is at the end of its life, at least with Borland. Maybe they will FOSS it? Nah... Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.5 Schedule
[EMAIL PROTECTED] wrote: > For more details about the plan for Python 2.5, see: > > http://www.python.org/doc/peps/pep-0356/ > I hope that this is not considered too off topic, but what compiler is going to be used for the MSW version of 2.5? If it is going to the MS Visual Studio 2005 compiler then will it be possible to use the 'free' Visual C++ 2005 Express Edition to build extensions? Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.5 Schedule
Scott David Daniels wrote: > I think there will be no compiler switching for a while. The previous > switch from VC 6 was in part because there was no longer any legal way > to get a VC 6.0 compiler. This round at least is sticking with the same > compiler as Python 2.4 (VC 7.0). > Scott: Admittedly I did not spend long looking at the MS web-site, but I could not find anywhere where I could buy a Visual Studio C++ compiler earlier than the 2005 edition - and then at breathtaking prices. Amazon's second tier retailers carry a very few new and used editions, but Amazon only carries the 2005 edition, so ... Even if you can find Visual .NET 2003 somewhere, somehow today then will it still be available throughout the lifetime of Python 2.5? Erm... MinGW? Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.5 Schedule
Ravi Teja wrote: > http://msdn.microsoft.com/visualc/vctoolkit2003/ > Free. > True, but 'The Microsoft Toolkit Compiler doesn't come out-of-the-box with everything you need to compile extensions.' see: http://www.vrplumber.com/programming/mstoolkit/ If you are going ahead with the VC 7.1 Toolkit compiler then is distutils going be modified to support it? Do you think that the 7.1 toolkit compiler will be available a year from now? MS could replace it with a VC 8.0 version of the toolkit compiler. Don. -- http://mail.python.org/mailman/listinfo/python-list
Re: MVC in Python for web app dev
[EMAIL PROTECTED] wrote:
> I'm aware that Pylons is trying to
> compete with Rails in the near future but I'm just not clear on how
> directly they are trying to compete...will Pylons have the same
> generation functions and other time saving goodies that RoR has or am I
> barking up the wrong tree?
>
Thanks for the reference to Pylon:
http://pylonshq.com/
I had not heard of it before and it looks promising.
Have you asked your questions ('the same generation functions and other
time saving goodies') of the Pylon folks?
Don.
--
http://mail.python.org/mailman/listinfo/python-list
Re: "Strong typing vs. strong testing"
Keith Thompson wrote on Thu, 30 Sep 2010: > RG writes: >> You're missing a lot of context. I'm not trying to criticize C, just to >> refute a false claim that was made about it. > Can you cite the article that made this false claim, and exactly what > the false claim was? http://groups.google.com/group/comp.lang.lisp/msg/431925448da59481 Message-ID: <0497e39d-6bd1-429d-a86f-f4c89babe...@u31g2000pru.googlegroups.com> From: TheFlyingDutchman Newsgroups: comp.lang.lisp [...] in C I can have a function maximum(int a, int b) that will always work. Never blow up, and never give an invalid answer. If someone tries to call it incorrectly it is a compile error. [...] _______ Don Geddis http://don.geddis.org/ [email protected] -- http://mail.python.org/mailman/listinfo/python-list
