Re: Spamming PyPI with stupid packages

2012-01-01 Thread Alexander Kapps
Uh oh, should I really send this? ... Yes. Yes, I should! Sorry, I cannot resists. allow everyone to do "import girlfriend" I'm betting on a joke, like antigravity only significantly less funny and more sexist. Absolutely not funny. I hope that someday people will understand that sexism i

Re: Python education survey

2011-12-31 Thread Alexander Kapps
On 01.01.2012 03:36, Grant Edwards wrote: On 2011-12-31, Alexander Kapps wrote: On 31.12.2011 19:23, Roy Smith wrote: Why do I waste my time reading your pretentious self-important nonsense? http://xkcd.com/386/ ;) Why ROFLMAO when double-plus funny works just as well? xkcd/386 has

Re: python curses wrapper

2011-12-31 Thread Alexander Kapps
On 31.12.2011 20:34, Alexander Kapps wrote: On 31.12.2011 20:24, Mag Gam wrote: Hello, I have been struggling reseting the terminal when I try to do KeyboardInterrupt exception therefore I read the documentation for curses.wrapper and it seems to take care of it for me, http://docs.python.org

Re: python curses wrapper

2011-12-31 Thread Alexander Kapps
On 31.12.2011 20:24, Mag Gam wrote: Hello, I have been struggling reseting the terminal when I try to do KeyboardInterrupt exception therefore I read the documentation for curses.wrapper and it seems to take care of it for me, http://docs.python.org/library/curses.html#curses.wrapper. Can someo

Re: .format vs. %

2011-12-31 Thread Alexander Kapps
On 31.12.2011 19:44, davidfx wrote: Thanks for your response. I know the following code is not going to be correct but I want to show you what I was thinking. formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) What is the .format version of this concept? formatter = "{0} {1} {2} {3}

Re: Python education survey

2011-12-31 Thread Alexander Kapps
On 31.12.2011 19:23, Roy Smith wrote: Why do I waste my time reading your pretentious self-important nonsense? http://xkcd.com/386/ ;) Why ROFLMAO when double-plus funny works just as well? xkcd/386 has been the excuse for replying to RR for ages and I still don't understand why he gets

Re: Text Processing

2011-12-20 Thread Alexander Kapps
On 20.12.2011 22:04, Nick Dokos wrote: I have a text file containing such data ; ABC --- -2.0100e-018.000e-028.000e-05 -2.e-010.000e+00 4.800e-04 -1.9900e-014.000e-021.600e-04

Re: Help about Xlib Library in Python

2011-12-17 Thread Alexander Kapps
On 16.12.2011 05:55, 阮铮 wrote: Hi, A question about Xlib Library in Python troubled me for several days and I finally found this email list. I hope someone could answer my question. I think it is easy for experienced user. I would like to write a small script to response my mouse click in root

Re: Pragmatics of the standard is() function

2011-11-26 Thread Alexander Kapps
On 26.11.2011 22:20, candide wrote: You already got answers for the "is" vs. "==" difference. I'd like to add the following. In which cases should we use the is() function ? "is" is not a function, It's an operator, just like == or +. is() function makes comparaison of (abstract represent

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-25 Thread Alexander Kapps
On 25.11.2011 05:49, Dennis Lee Bieber wrote: On Fri, 25 Nov 2011 01:32:08 +0100, Alexander Kapps declaimed the following in gmane.comp.python.general: The main difference here is, that Linux makes it easy to seperate administrative accounts from end-user accounts, So does Win7

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-24 Thread Alexander Kapps
On 25.11.2011 01:04, Steven D'Aprano wrote: So by your reasoning, that's at least 20 ways to infect my Linux system. I never realised just how insecure Linux must be! Yes, there are 20+ ways to "infect" your (and mine) Linux system. You cannot trust *any* kind of 3rd party code. Period. Hav

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-24 Thread Alexander Kapps
On 25.11.2011 00:18, Alexander Kapps wrote: Do you get an "Edit with IDLE" then? And even if not. Why are you so obsessive about IDLE? I mean, seriously, IDLE is just a bare-level if-nothing-else-is-available editor/IDE. It's better than notepad, OK. I really don't b

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-24 Thread Alexander Kapps
On 24.11.2011 22:22, W. eWatson wrote: Whoops, I thought I was replying to Matt Meyers just above you. Above who? As said by somebody already, most people use a mail-client (Thunderbird/Outlook) or a Usenet client to read this forum. Google Groups is (In My Opinion at least) just crap (and s

Re: Usefulness of the "not in" operator

2011-10-15 Thread Alexander Kapps
On 10.10.2011 19:29, Nobody wrote: On Sun, 09 Oct 2011 02:25:27 +0200, Alexander Kapps wrote: Even if it's off-topic, could you add some similar explanations for Church numerals (maybe Lambda calculus it isn't too much?) The Church numeral for N is a function of two arguments whi

Re: Loop through a dict changing keys

2011-10-15 Thread Alexander Kapps
On 15.10.2011 20:00, Gnarlodious wrote: What is the best way (Python 3) to loop through dict keys, examine the string, change them if needed, and save the changes to the same dict? So for input like this: {'Mobile': 'string', 'context': '', 'order': '7', 'time': 'True'} I want to booleanize 'Tr

Re: hi can someone help please key bind

2011-10-15 Thread Alexander Kapps
On 15.10.2011 19:30, Gary wrote: Hi im trying to use key bind on Tkinter to call this function def Start(): for i in range(60,-1,-1): ent['text'] = i time.sleep(1) root.update() ent['text'] = 'Time Out!' root.update() i know the function is ok as i have assigned a button and i calls the functio

Re: Usefulness of the "not in" operator

2011-10-10 Thread Alexander Kapps
On 08.10.2011 18:08, Steven D'Aprano wrote: Let's define the boolean values and operators using just two functions: [SNIP] Have you just explained Church booleans in an understandable language? Awesome. I still have to chew on this, but I think this is the first time where I might understan

Re: Usefulness of the "not in" operator

2011-10-08 Thread Alexander Kapps
On 09.10.2011 01:35, Tim Roberts wrote: Roy Smith wrote: In article<4e906108$0$27980$426a3...@news.free.fr>, candide wrote: After browsing source code, I realize that parenthesis are not necessary ("not" has higher precedence than "in"). Here's my take on parenthesis: If you need to look

Re: TK + MVC

2011-10-02 Thread Alexander Kapps
On 02.10.2011 04:40, Gregory Ewing wrote: Alexander Kapps wrote: But I think a simple (and quick 'n' dirty) Tk MVC example can look like this: The Controller doesn't seem to add any value in that example. You might as well connect the Model and Views directly to each other.

Re: TK + MVC

2011-10-02 Thread Alexander Kapps
On 03.10.2011 00:15, Emeka wrote: Greg, Do you have an example where the Controller is connected? What do you mean? In my example, the Controller *is* connected (to both the View and the Model.) -- http://mail.python.org/mailman/listinfo/python-list

Re: TK + MVC

2011-10-01 Thread Alexander Kapps
On 01.10.2011 14:41, Emeka wrote: Hello All, I need a basic example where MVC pattern is used with Python TK. I'm still not 100% sure if I really understand the MVC pattern. Some say the view and the model must not interact directly, some say the view must not access the controller (but the

Re: strange results

2011-09-17 Thread Alexander Kapps
On 17.09.2011 01:09, Fig wrote: I took out all of the color commands that were in the shape functions and all of the features to the 'draw_house' function showed showed up. I started putting the color commands back into the shape functions and have no problems with some of them but when I put the

Re: I think I found 2 undocumented string format codes.

2011-08-24 Thread Alexander Kapps
On 24.08.2011 22:45, Bill wrote: My google-fu has failed me in finding info on %h and %l string formatting codes. '%h' %'hello' exceptions.ValueError: incomplete format '%l' %'hello' exceptions.ValueError: incomplete format Does anyone know what doing a "complete format" means? See http

Re: Linux : create a user if not exists

2011-08-16 Thread Alexander Kapps
On 16.08.2011 16:57, smain kahlouch wrote: Ok than you. You're right but it doesn't help me : I replaced it : >>> def finduser(user): ... if pwd.getpwnam(user): ... print user, "user exists" ... return True ... return False ... >>> finduser('realuser') realuser

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread Alexander Kapps
On 29.07.2011 21:30, Carl Banks wrote: It's not even fullproof on Unix. '/home//h1122/bin///ghi/'.split('/') ['','home','','bin','','','ghi',''] The whole point of the os.path functions are to take care of whatever oddities there are in the path system. When you use string manipulation to m

Re: list comprehension to do os.path.split_all ?

2011-07-28 Thread Alexander Kapps
On 28.07.2011 22:44, Ian Kelly wrote: On Thu, Jul 28, 2011 at 2:18 PM, gry wrote: [python 2.7] I have a (linux) pathname that I'd like to split completely into a list of components, e.g.: '/home/gyoung/hacks/pathhack/foo.py' -->['home', 'gyoung', 'hacks', 'pathhack', 'foo.py'] os.path.

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Alexander Kapps
On 10.07.2011 02:26, John Salerno wrote: I have a script that does some stuff that I want to run every day for maybe a week, or a month. So far I've been good about running it every night, but is there some way (using Python, of course) that I can make it automatically run at a set time each nigh

Re: why the following python program does not face any concurrency problems without synchronize mechanism?

2011-07-09 Thread Alexander Kapps
On 09.07.2011 22:45, smith jack wrote: from threading import Thread def calc(start, end): total = 0; for i in range(start, end + 1): total += i; print '--result:', total return total t = Thread(target=calc, args=(1,100)) t.start() I have run thi

Re: regular expression i'm going crazy

2011-05-16 Thread Alexander Kapps
On 16.05.2011 18:25, Tracubik wrote: pls help me fixing this: import re s = "linka la baba" re_s = re.compile(r'(link|l)a' , re.IGNORECASE) print re_s.findall(s) output: ['link', 'l'] why? As the docs say: "If one or more groups are present in the pattern, return a list of groups;" http

Re: turn monitor off and on

2011-05-14 Thread Alexander Kapps
On 14.05.2011 09:29, harrismh777 wrote: harrismh777 wrote: def turnOnMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1) Wonder what the equivalent of this is in Linux... ? Probably xset dpms force {on,off,...} -- h

Re: PyGTK notebook: get current page

2011-05-07 Thread Alexander Kapps
On 07.05.2011 17:04, Tracubik wrote: Hi all! I've made a simple PyGTK program. It's a window with a notebook, the notebook have 2 pages When changing page, i'ld like to get the id of current page. I've coded it, but i can get only the previously open page, not the current one. This is not a big

Re: [OT] Disable creation of pyc files in DrPython

2011-04-20 Thread Alexander Kapps
On 20.04.2011 15:21, craf wrote: Hi. I wonder if anyone uses Python DrPython as editor. I need to know if you can disable the creation of Pyc files created by the program. In the Geany editor you can add the parameter -B, but not if it can in this editor. I don't know DrPython, but Python itse

Re: ipython: Multiple commands on the same line and newlines

2011-04-17 Thread Alexander Kapps
On 17.04.2011 20:40, Phil Winder wrote: Ok, thanks all. It's a little disappointing, but I guess that you always have to work in a different way when you move to a new language. Andrea's %edit method is probably the best compromise, but this now means that I will have to learn all the (obscure) s

Re: Incompatible _sqlite3.so

2011-03-27 Thread Alexander Kapps
On 28.03.2011 00:21, Tim Johnson wrote: Python 2.6: http://www.slax.org/modules.php?action=detail&id=3118 That module is *not* trusted. See the warning? It's just not verified by the Slax developers. That doesn't mean it's not trusted. It's the same as with Ubuntu packages from the Unive

Re: Incompatible _sqlite3.so

2011-03-27 Thread Alexander Kapps
On 27.03.2011 23:24, Tim Johnson wrote: I have python 2.6.5 on my main workstation with ubuntu 10.04. I am attempting to set up a temporary test platform on an asus netbook with slax running from an SD card. I have installed a python 2.7 module on the slax OS. (I can't find a python 2.6.5 module

Re: install excel xlwt in ubuntu 9

2011-03-19 Thread Alexander Kapps
On 19.03.2011 07:29, ratna PB wrote: Hey friends i tried a lot to install excel xlwt in ubuntu 9 but failed please help me before i get full fraustrated... What have you tried and how did it failed? On 9.10, simply do (you might need to enable the universe repository in Synaptic first): $ s

Re: Reading/Writing files

2011-03-18 Thread Alexander Kapps
On 18.03.2011 22:33, Jon Herman wrote: Hello all, I am pretty new to Python and am trying to write data to a file. However, I seem to be misunderstanding how to do so. For starters, I'm not even sure where Python is looking for these files or storing them. The directories I have added to my PYTH

Re: class error

2011-03-18 Thread Alexander Kapps
On 18.03.2011 21:13, monkeys paw wrote: I have the following file: FileInfo.py: import UserDict After this import statement, the name "UserDict" refers to the module. class FileInfo(UserDict): Here you are trying to subclass the module. What you need instead is: class FileInfo(UserDict.U

Re: os.path.walk() to get full path of all files

2011-03-16 Thread Alexander Kapps
On 16.03.2011 22:00, dude wrote: awesome, that worked. I'm not sure how the magic is working with your underscores there, but it's doing what I need. thanks. The underscore is no magic here. It's just a conventional variable name, saying "I m unused". One could also write: for root, UNUSE

Re: OT: processes, terminals and file descriptors on *nix

2011-03-16 Thread Alexander Kapps
On 13.03.2011 01:50, Nobody wrote: I don't have any links. If you want to understand the core Unix API, the best reference I know of is Stevens ("Advanced Programming in the Unix Environment", by W. Richard Stevens). Unfortunately, it's not cheap. In spite of the title, it doesn't assume any pr

Re: os.path.walk() to get full path of all files

2011-03-16 Thread Alexander Kapps
On 16.03.2011 20:41, dude wrote: My goal is create a list of absolute paths for all files in a given directory (any number of levels deep). root dir1 file1 file2 dir2 file3 dir3 -dir4 --file4 file5 So the above woul

OT: processes, terminals and file descriptors on *nix (was: Re: attach to process by pid?)

2011-03-11 Thread Alexander Kapps
On 11.03.2011 03:18, Nobody wrote: On Thu, 10 Mar 2011 23:55:51 +0100, Alexander Kapps wrote: I think he wants to attach to another process's stdin/stdout and read/write from/to them. I don't know if this is possible but it would be a great addition for psutil. It's not ev

Re: attach to process by pid?

2011-03-10 Thread Alexander Kapps
On 10.03.2011 23:25, Nobody wrote: On Thu, 10 Mar 2011 20:22:11 +0100, Giampaolo Rodolà wrote: I think he wants to attach to another process's stdin/stdout and read/write from/to them. I don't know if this is possible but it would be a great addition for psutil. It's not even a meaningful con

Re: Tk MouseWheel Support

2011-03-10 Thread Alexander Kapps
On 10.03.2011 21:28, Richard Holmes wrote: I am trying to use the mouse wheel to scroll a list box, but I'm not getting the event. When I bind "" to the listbox I get the event and I'm able to scroll using yview_scroll. I've tried binding "MouseWheel" and"", and I've also tried"" and "" even thou

Re: Problems of Symbol Congestion in Computer Languages

2011-02-21 Thread Alexander Kapps
On 22.02.2011 00:34, Westley Martínez wrote: On Mon, 2011-02-21 at 11:28 -0800, rantingrick wrote: The ascii char "i" would suffice. However some languages fell it necessary to create an ongoing tutorial of the language. Sure French and Latin can sound "pretty", however if all you seek is "pre

Re: Python Tutorial on Multithreading

2011-02-21 Thread Alexander Kapps
On 21.02.2011 23:30, KevinSimonson wrote: I've been teaching myself Python from the tutorial routed at "http:// www.tutorialspoint.com/python/index.htm". It's worked out pretty well, but when I copied its multithreading example from the bottom of the page at "http://www.tutorialspoint.com/python

Re: Best way to gain root privileges

2011-02-18 Thread Alexander Kapps
On 18.02.2011 15:42, GSO wrote: I note that policykit was created by redhat, and that RHEL6 does not include gksudo in with its gnome for some odd reason. Don't know if this helps you, but at least for CentOS 5.4, gksudo is available in the gksu package from rpmforge. -- http://mail.python.o

Re: Best way to gain root privileges

2011-02-18 Thread Alexander Kapps
On 18.02.2011 15:22, Adam Skutt wrote: On Feb 18, 9:04 am, Ricardo Aráoz wrote: Many a time I have wanted to allow access to certain privileges to a user but *only* through a program. As far as security is concerned it would be enough that only root has permission to give the said program run

Re: Archiving Modules

2011-02-18 Thread Alexander Kapps
On 18.02.2011 19:51, Westley Martínez wrote: On Fri, 2011-02-18 at 04:55 -0800, peter wrote: On Feb 17, 9:55 pm, Jorgen Grahn wrote: RAR is a proprietary format, which complicates things. For example, Linux distributions like Debian cannot distribute software which handles it. If Python inc

Re: Best way to gain root privileges

2011-02-16 Thread Alexander Kapps
On 17.02.2011 01:00, GSO wrote: OK, thanks for the tips. gksu* does not seem to be included with RHEL6 Desktop (though there is a package called beesu) On RHEL try consolehelper/userhelper instead which need additional configuration. The philosophy at the end of the day I think is do your

Re: Best way to gain root privileges

2011-02-16 Thread Alexander Kapps
On 16.02.2011 23:02, Ian Kelly wrote: On Wed, Feb 16, 2011 at 2:29 PM, Daniel Mahoney wrote: On Wed, 16 Feb 2011 21:26:26 +, GSO wrote: I'm sure this question is as old as time, but what is the best way to gain root privileges? (Am using Python 2.6.5, pygtk2 v2.16, Gtk v2.18.9, on RHEL6.

Re: newbie question about PYTHONPATH

2011-02-15 Thread Alexander Kapps
On 15.02.2011 19:12, Panupat Chongstitwattana wrote: Panupat, please don't top-post, it messes the the natural order of the discussion. Thanks. I think the command line should look something along this line export PYTHONPATH=$HOME/foo/prog/learning_python/: with a colon at the end. Nope,

Re: file find skips first letter

2011-02-15 Thread Alexander Kapps
On 15.02.2011 19:32, Wanderer wrote: I'm using code def getFiles(self, fileBase): """return a list of the filenames in a director containing a base word """ allFiles = os.listdir(self.resultDir) baseFiles = [] for f in allFiles: if

Re: How to create an entry in the "Program menu" of Windows?

2011-02-01 Thread Alexander Kapps
On 01.02.2011 22:43, Diesel wrote: Hi, I'd like to add menu entry in the Program Menu as part of the installation of an application. Is it possible to do that from Python? Any examples or link? I have not been able to find anything with google... thanks in advance s/ AFAIK, the startmenu e

Re: WxPython versus Tkinter.

2011-01-27 Thread Alexander Kapps
On 27.01.2011 19:33, rantingrick wrote: Please don't use the lower accessibility percentage to prop up the low Linux percentage in an attempt to win your argument. Because healthy Linux users ARE NOT equal to handicapped people! Please don't put words into my mouth, idiot. And read my complete

Re: Return Statement

2011-01-26 Thread Alexander Kapps
On 26.01.2011 21:26, sl33k_ wrote: How does "return True" and "return False" affect the execution of the calling function? If only affects the calling function if you use the return value: def foo(): return True def bar1(): foo() # nothing difference, whether foo() returns True or Fal

Re: WxPython versus Tkinter.

2011-01-26 Thread Alexander Kapps
On 26.01.2011 18:04, Octavian Rasnita wrote: From: "Littlefield, Tyler" with JAWS because it is the most used screen reader. Get off your me soapbox. Jaws is not the most used. NVDA is taking over, quite fast, and lots of people have totally switched to mac or Vinux Lots of people means an in

Re: WxPython versus Tkinter.

2011-01-24 Thread Alexander Kapps
There are two completely different issues here: 1. Tyler's/Octavian's very valid (but AFAICT now somewhat over-expressed) point that Tk/Tkinter isn't accessible. I accept this, but don't see any point against Tk(inter) in this per se. Tk(inter) could be advanced to support screen readers and

Re: Short circuting

2011-01-21 Thread Alexander Kapps
On 22.01.2011 01:10, Alexander Kapps wrote: On 22.01.2011 00:33, Ed Connell wrote: Hi, Consider the following please: (re_section, re_name, etc are previously compiled patterns) result1 = re_section.search(line); result2 = re_name.search(line); result3 = re_data1.search(line); result4

Re: Short circuting

2011-01-21 Thread Alexander Kapps
On 22.01.2011 00:33, Ed Connell wrote: Hi, Consider the following please: (re_section, re_name, etc are previously compiled patterns) result1 = re_section.search(line); result2 = re_name.search(line); result3 = re_data1.se

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Alexander Kapps
On 18.01.2011 21:23, Octavian Rasnita wrote: From: "Alexander Kapps" Tkinter causes damage? Very bad damage? What are you talking about? I am talking about the fact that Python promotes Tkinter, and many beginners will start using it, and they will start creating applications wi

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Alexander Kapps
On 18.01.2011 09:58, Octavian Rasnita wrote: > From: "Alexander Kapps" >> On 17.01.2011 21:04, Octavian Rasnita wrote: >>> I say probably not considering the availability of 3rd party >>> downloads. What say you, Python community? >> >>

Re: UTF-8 question from Dive into Python 3

2011-01-17 Thread Alexander Kapps
On 17.01.2011 23:19, carlo wrote: Is it true UTF-8 does not have any "big-endian/little-endian" issue because of its encoding method? And if it is true, why Mark (and everyone does) writes about UTF-8 with and without BOM some chapters later? What would be the BOM purpose then? Can't answer yo

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Alexander Kapps
On 17.01.2011 21:04, Octavian Rasnita wrote: I say probably not considering the availability of 3rd party downloads. What say you, Python community? Available as 3rd party downloads: XML,HTML,... HTTP,FTP,SMTP,POP,IMAP/... MD5,SHA,... zip,bzip,... and so on and so on and so on. Remove them a

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Alexander Kapps
On 30.12.2010 00:58, rantingrick preached: Tkinter: The good, the bad, and the ugly! - An expose by rantingrick You are seriously starting to sound like Xah Lee. our beloved dictator (Mr. Van Rossum) had the foresight to include a simplistic GUI tool

Re: stuck with Pexpect script need help!!

2010-12-12 Thread Alexander Kapps
On 12.12.2010 17:06, Emile van Sebille wrote: On 12/10/2010 10:02 PM Darshak Bavishi said... Pexpect is intended for UNIX-like operating systems.""") Can we use pexpect from windows host machine ?! I expect not... Emile According to [1] you might get it working with the Cygwin port o

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-11 Thread Alexander Kapps
On 11.12.2010 22:38, Stef Mientki wrote: On 11-12-2010 17:24, Martin Kaspar wrote: Hello commnity i am new to Python and to Beatiful Soup also! It is told to be a great tool to parse and extract content. So here i am...: I want to take the content of a-tag of a table in a html document. For ex

Re: Program, Application, and Software

2010-11-18 Thread Alexander Kapps
On 19.11.2010 01:26, MRAB wrote: On 19/11/2010 00:07, Steven D'Aprano wrote: On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can be executed. IOW Py

Re: Raw Unicode docstring

2010-11-17 Thread Alexander Kapps
On 17.11.2010 06:14, John Machin wrote: On Nov 17, 9:34 am, Alexander Kapps wrote: >>> ur"Scheißt\nderBär\nim Wald?" Nicht ohne eine Genehmigung von der Umwelt Erhaltung Abteilung. The typical response around here is "Ja, aber nur wenn er Klopapier da

Re: Program, Application, and Software

2010-11-17 Thread Alexander Kapps
On 17.11.2010 19:38, Boštjan Mejak wrote: What is the difference between a program, an application, and software? Program: A sequence of one or more instructions (even 'print "hello"' is a valid Python program) Application: Usually a large(er), complex program Software: The parts of a compu

Re: Is Unladen Swallow dead?

2010-11-17 Thread Alexander Kapps
On 17.11.2010 23:09, John Nagle wrote: On 11/17/2010 12:49 PM, John Ladasky wrote: On Nov 16, 2:30 pm, laspi wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty Python reference: "http://www.mtholyoke.edu/~ebarnes/python/dead-parrot.htm"; Thank y

Re: Raw Unicode docstring

2010-11-16 Thread Alexander Kapps
On 16.11.2010 22:56, Boštjan Mejak wrote: Hello, how does one write a raw unicode docstring? If I have backslashes in the docstring, I must tuck an 'r' in front of it, like this: r"""This is a raw docstring.""" If I have foreign letters in the docstring, I must tuck a 'u' in front of it, like t

Re: pylint -- should I just ignore it sometimes?

2010-10-19 Thread Alexander Kapps
On 20.10.2010 00:36, Seebs wrote: On 2010-10-19, Martin P. Hellwig wrote: Well, as with all styles IMHO, if there is a _good_ reason to break it, then by all means do, but you might want to consider putting in a comment why you did that and add the #pylint: disable-msg= on that line. If that is

Re: pylint -- should I just ignore it sometimes?

2010-10-19 Thread Alexander Kapps
On 19.10.2010 21:57, Seebs wrote: So, I'm messing around with pylint. Quite a lot of what it says is quite reasonable, makes sense to me, and all that. There's a few exceptions. One: I am a big, big, fan of idiomatic short names where appropriate. For instance: catch, e: I don't want

Re: Help with paths

2010-10-18 Thread Alexander Kapps
On 18.10.2010 23:24, Devin M wrote: Hello, I am using os.path to get the absolute paths of a few directories that some python files are in. FIlePath = os.path.dirname(os.path.realpath(__file__)) which returns a path similar to /home/devinm/project/files Now I want to get the directory above this

Re: accessing a text file

2010-09-05 Thread Alexander Kapps
Baba wrote: level: beginner how can i access the contents of a text file in Python? i would like to compare a string (word) with the content of a text file (word_list). i want to see if word is in word_list. let's assume the TXT file is stored in the same directory as the PY file. def is_valid

Re: Python libs on Windows ME

2010-08-31 Thread Alexander Kapps
hexusne...@gmail.com wrote: On Aug 31, 2:04 pm, Thomas Jollans wrote: On Tuesday 31 August 2010, it occurred to hexusne...@gmail.com to exclaim: I'm not guessing that this is a problem on Windows 98, but on Windows ME modules in /Lib don't seem to load. Examples include site.py and os.py whi

Re: Python libs on Windows ME

2010-08-31 Thread Alexander Kapps
Thomas Jollans wrote: I would use another os like Linux or Windows 2000, but this particular computer can't even seem to handle even the most minimal graphical Linux distributions. Really? I'm sure you can get Linux on there somehow. It might not be trivial, but it should definitely be possib

Re: Fw: sendmail error

2010-08-31 Thread Alexander Kapps
Chris Withers wrote: Alexander Kapps wrote: Instead you want something like: except smtplib.SMTPException, msg print "eroare: " + msg Err, that's still concatenating a string and an exception object. OUCH! What a stupid error. Thanks for correction. :-) What *would* w

Re: Fw: sendmail error

2010-08-31 Thread Alexander Kapps
sandric ionut wrote: Three things: When quoting code, do it exactly, and without wordwrap in your mail program. There are so many typos in that code sample that it's useless, presumably because you didn't use copy/paste The code was COPY and PASTE -> presume wrong When quoting an

Re: String substitution VS proper mysql escaping

2010-08-30 Thread Alexander Kapps
Nik the Greek wrote: cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' , a_tuple ) and cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' , (a_tuple) ) are both syntactically correct right? buw what about c

Re: Overload print

2010-08-25 Thread Alexander Kapps
Ross Williamson wrote: Hi All Is there anyway in a class to overload the print function? In Python <= 2.x "print" is a statement and thus can't be "overloaded". That's exactly the reason, why Python 3 has turned "print" into a function. class foo_class(): def __print__(self):

Re: split string into multi-character "letters"

2010-08-25 Thread Alexander Kapps
Jed wrote: Hi, I'm seeking help with a fairly simple string processing task. I've simplified what I'm actually doing into a hypothetical equivalent. Suppose I want to take a word in Spanish, and divide it into individual letters. The problem is that there are a few 2-character combinations that

Re: simple python deployment tool

2010-07-08 Thread Alexander Kapps
King wrote: On Jul 8, 2:21 pm, Alexander Kapps wrote: King wrote: Hi, I am writing a python package deployment tool for linux based platforms. I have tried various existing tool sets but none of them is up to the mark and they have their own issues. Initially I'll start with simple app

Re: simple python deployment tool

2010-07-08 Thread Alexander Kapps
King wrote: Hi, I am writing a python package deployment tool for linux based platforms. I have tried various existing tool sets but none of them is up to the mark and they have their own issues. Initially I'll start with simple approach. I'm sorry, but your approach is not going to work. The

Re: Python 2.7 released

2010-07-05 Thread Alexander Kapps
Martineau wrote: Perhaps it's hidden somewhere, but I couldn't find the .chm help file in the python-2.7.msi file using 7-zip, nor saw anything that looked like a Doc folder embedded within it -- so I doubt installing it on a Windows machine would work any better. I don't know much about the .

[OT] Football was: Python dynamic attribute creation

2010-06-28 Thread Alexander Kapps
Mark Lawrence wrote: On 28/06/2010 20:23, Alexander Kapps wrote: UHHM! Forget it. This of course doesn't work with setattr too. My stupidness. :-( Don't worry too much, looks like your nation's football is much better than your settattr knowledge. I very much appreciate

Re: Python dynamic attribute creation

2010-06-28 Thread Alexander Kapps
Alexander Kapps wrote: Bruno Desthuilliers wrote: Alexander Kapps a écrit : (snip) While I personally don't agree with this proposal (but I understand why some people might want it), I can see a reason. When disallowing direct attribute creation, those typos that seem to catch newco

Re: Python dynamic attribute creation

2010-06-28 Thread Alexander Kapps
Bruno Desthuilliers wrote: Alexander Kapps a écrit : (snip) While I personally don't agree with this proposal (but I understand why some people might want it), I can see a reason. When disallowing direct attribute creation, those typos that seem to catch newcommers won't happen any

Re: Python dynamic attribute creation

2010-06-26 Thread Alexander Kapps
Stephen Hansen wrote: On 6/26/10 9:01 AM, Alexander Kapps wrote: While I personally don't agree with this proposal (but I understand why some people might want it), I can see a reason. When disallowing direct attribute creation, those typos that seem to catch newcommers won't happ

Re: Python dynamic attribute creation

2010-06-26 Thread Alexander Kapps
Ixokai wrote: In what possible way is: setattr(foo, 'new_attr', 'blah') getattr(foo, 'new_attr') delattr(foo, 'new_attr') Better then: foo.new_attr = 'blah' foo.new_attr del foo.new_attr I don't understand what your argument is or problem is with the regular syntax,

Re: Python eCommerce, small webshop

2010-03-12 Thread Alexander Kapps
Sorry, Emile for the private post, one beer too much and the wrong button... ;-) Emile van Sebille wrote: > On 3/12/2010 5:02 PM Alexander Kapps said... >> Hello everybody! >> >> I have to set up a small webshop for used books, CDs, DVD, and stuff and >> did'

Python eCommerce, small webshop

2010-03-12 Thread Alexander Kapps
Hello everybody! I have to set up a small webshop for used books, CDs, DVD, and stuff and did't find anything realy usefull on google. I'm pretty skilled with Python and would strongly prefer a Python based Shop but all I've found are in early stage, unmaintained or too limited. I've look

Python eCommerce, small webshop

2010-03-12 Thread Alexander Kapps
Hello everybody! I have to set up a small webshop for used books, CDs, DVD, and stuff and did't find anything realy usefull on google. I'm pretty skilled with Python and would strongly prefer a Python based Shop but all I've found are in early stage, unmaintained or too limited. I've look