Re: JUST GOT HACKED

2013-10-02 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 02.10.2013 13:03, schrieb Νίκος: I have to make some money and that needs for some reason to happen now as we speak, so i have no alternative than to hop into a car and learn to drive during the process, hoping i will not bang-smash the car.

Re: I haev fixed it

2013-10-01 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 01.10.2013 13:06, schrieb Νίκος: But it seems you don't want to provide an explanation although i think you might have a theory. You need a theory? 1) Your password(s) is/are leaked (see the URL referenced somewhere before, and IIRC you also

Re: I haev fixed it

2013-10-01 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 01.10.2013 14:06, schrieb Νίκος: i know about the link you mentioned and i have deleted the source code from there. Guess what: Google keeps a cache. See here:

Re: Tryign to send mail via a python script by using the local MTA

2013-09-17 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 17.09.2013 01:41, schrieb Steven D'Aprano: I cannot fathom for the life of me a legitimate reason for your website to use a fake IP address and hostname when sending email. In addition to that: it's amazing that Nikos thinks TCP will still work

Re: Tryign to send mail via a python script by using the local MTA

2013-09-17 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 17.09.2013 13:55, schrieb Joel Goldstick: At least if you want to add to this nonsense, read each of the (several?) dozen entries. Actually, I have read each of the troll cycles (just as I read much of clp, although I haven't participated much

Re: Having both if() and for() statements in one liner

2013-09-17 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 17.09.2013 15:21, schrieb Ferrous Cranus: ... there must be written on soem way. You've already given yourself the answer in the initial post. The Python way to write this is: if person == George: for times in range(5): ... Why not

Re: Tryign to send mail via a python script by using the local MTA

2013-09-16 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 16.09.2013 13:21, schrieb Denis McMahon: If he's trying to prove communication works, he might be better off using a message subject of test and a message body of this is a test message. Generally, he might be best off if he didn't use

Re: Tryign to send mail via a python script by using the local MTA

2013-09-16 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 16.09.2013 13:37, schrieb Ferrous Cranus: What i want now is to be able to alter the hostname of my server so the mails wont indicate that they derive from superhost.gr as they aare now sen in the mail headers. There is no way to do that, as

Re: Tryign to send mail via a python script by using the local MTA

2013-09-16 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 16.09.2013 14:11, schrieb Ferrous Cranus: But even so, if we alter for example the hostname of our server to a different name then wouldn't Google use that to identify the server thus protecting the real identity(hostname that is) of the server

Re: Cannot form correctly the FORM part of the header when sending mail

2013-09-04 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 03.09.2013 09:48, schrieb Ferrous Cranus: Si there a workaround for that please? Yes, use/setup your own mailserver. Google will not allow you to send as (i.e., From:) an arbitrary address besides the one you've authenticated as. - -- - ---

Re: FSR and unicode compliance - was Re: RE Module Performance

2013-07-29 Thread Heiko Wundram
Am 29.07.2013 13:43, schrieb wxjmfa...@gmail.com: 3.2 timeit.timeit(r = dir(list)) 22.300465007102908 3.3 timeit.timeit(r = dir(list)) 27.13981129541519 For the record, I do not put your example to contradict you. I was expecting such a result even before testing. Now, if you do not

Don't feed the troll... (was: Re: A few questiosn about encoding)

2013-06-14 Thread Heiko Wundram
Am 14.06.2013 10:37, schrieb Nick the Gr33k: So everything we see like: 16474 nikos abc123 everything is a string and nothing is a number? not even number 1? Come on now, this is _so_ obviously trolling, it's not even remotely funny anymore. Why doesn't killfiling work with the mailing list

Re: Don't feed the troll...

2013-06-14 Thread Heiko Wundram
Am 14.06.2013 11:32, schrieb Nick the Gr33k: I'mm not trolling man, i just have hard time understanding why numbers acts as strings. If you can't grasp the conceptual differences between numbers and their/a representation, it's probably best if you stayed away from programming alltogether.

Re: Don't feed the help-vampire

2013-06-14 Thread Heiko Wundram
Am 14.06.2013 14:09, schrieb rusi: Since identifying a disease by the right name is key to finding a cure: Nikos is not trolling or spamming; he is help-vampiring. Just to explain the trolling allegation: I'm not talking about him wanting to get his scripts fixed, that's help-vampiring most

Re: Don't feed the troll...

2013-06-14 Thread Heiko Wundram
Am 14.06.2013 14:45, schrieb Nick the Gr33k: we are all benefit out of this. Let's nominate you for a nobel prize, saviour of python-list! -- --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing filenames from Greeklish = Greek (subprocess complain)

2013-06-06 Thread Heiko Wundram
Am 05.06.2013 18:44, schrieb MRAB: From the previous posts I guessed that the filename might be encoded using ISO-8859-7: s = b\305\365\367\336\ \364\357\365\ \311\347\363\357\375.mp3 s.decode(iso-8859-7) 'Ευχή\\ του\\ Ιησού.mp3' Yes, that looks the same. Most probably, his terminal is

Re: Changing filenames from Greeklish = Greek (subprocess complain)

2013-06-06 Thread Heiko Wundram
Am 06.06.2013 12:35, schrieb Νικόλαος Κούρας: ni...@superhost.gr [~/www/data/apps]# ls -l | file - /dev/stdin: ASCII text Did you actually try to understand what I wrote? -- --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing filenames from Greeklish = Greek (subprocess complain)

2013-06-06 Thread Heiko Wundram
Am 06.06.2013 13:00, schrieb Νικόλαος Κούρας: Heiko, the ssh client i used to 'mv' the .mp3 was putty.Do you mean that putty is responsible for the encoding mess? Exactly. Check the encoding that putty uses for the terminal session. If it doesn't use UTF-8, switch your terminal session to

Re: Changing filenames from Greeklish = Greek (subprocess complain)

2013-06-06 Thread Heiko Wundram
Am 06.06.2013 13:24, schrieb Νικόλαος Κούρας: ni...@superhost.gr [~/www/data/apps]# ls *.mp3 | file - /dev/stdin: ASCII text Again, did you actually read (and try to understand) what I wrote? I said to redo the rename after you change your terminal session to UTF-8. -- --- Heiko. --

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Heiko Wundram
Am 05.06.2013 10:53, schrieb Νικόλαος Κούρας: I ALSO HAVE GIVEN ROOT ACCESS TO ANOTHER MEMBER OF THIS LIST AND HE IN FACT TRIED TO HELP ME INSTEAD OF DOING WHAT YOU DID. AND FROM 2 OTHER PEOPLE AS SOME OTHER FORUMS TOO. You know what you're saying there? You've given (at least) four people

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Heiko Wundram
Am 05.06.2013 11:19, schrieb Chris Angelico: Not quite accurate; he can change his root password back as soon as he logs in as the non-root user and cats one little file. I understood that - I rather got the impression that he (as a person) wasn't technically capable of changing it. Alas, the

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Heiko Wundram
Am 05.06.2013 11:33, schrieb Νικόλαος Κούρας: It will remain, if you go away. Look, pal, I work as a programmer for a (medium size) network service provider, and due to that I (should) know my networking security 101. It's generally people like you who are: 1) extremely careless about

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Heiko Wundram
Am 05.06.2013 12:21, schrieb Νικόλαος Κούρας: I dont care what you do for a living, you never helped me a bit in anything, you just presented to me your self 1 hour ago to join the party. Guess why I did so: you're presently touching a subject (network safety) that I hold dear, and not only

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Heiko Wundram
Am 05.06.2013 12:30, schrieb Νικόλαος Κούρας: You and Heiko of course would be excluded from the programmer for hire list. Guess what: I have a job. And I don't give a damn. -- --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Heiko Wundram
Am 05.06.2013 13:07, schrieb Νικόλαος Κούρας: Btw, since history doesnt show me his history comamnds when he logged in from .au(why not really?), how can i tell what exactly did he do when he logged on to the server? As root has full access to your system (i.e., can change file contents and

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Heiko Wundram
Am 05.06.2013 13:19, schrieb Νικόλαος Κούρας: Is there some logging utility i can use next time iam offering root access to someone(if i do it) or perhaps logging a normal's account activity? Short answer: Not for root, no. Long answer: as I've already said: root can change file contents, or

Re: convert string to bytes without changing data (encoding)

2012-03-28 Thread Heiko Wundram
Am 28.03.2012 11:43, schrieb Peter Daum: ... in my example, the variable s points to a string, i.e. a series of bytes, (0x61,0x62 ...) interpreted as ascii/unicode characters. No; a string contains a series of codepoints from the unicode plane, representing natural language characters (at

Re: convert string to bytes without changing data (encoding)

2012-03-28 Thread Heiko Wundram
Am 28.03.2012 19:43, schrieb Peter Daum: As it seems, this would be far easier with python 2.x. With python 3 and its strict distinction between str and bytes, things gets syntactically pretty awkward and error-prone (something as innocently looking like s=s+'/' hidden in a rarely reached branch

Re: Inconsistency between os.getgroups and os.system('groups') after os.setgroups()

2012-03-25 Thread Heiko Wundram
Am 25.03.2012 23:32, schrieb jeff: After the os.setgroups, os.getgroups says that the process is not in any groups, just as you would expect... I can suppress membership in the root group only by doing os.setgid and os.setuid before the os.system call (in which case I wind up in the group of

Re: how to read serial stream of data [newbie]

2012-02-07 Thread Heiko Wundram
Am 07.02.2012 14:48, schrieb Antti J Ylikoski: On 7.2.2012 14:13, Jean Dupont wrote: ser2 = serial.Serial(voltport, 2400, 8, serial.PARITY_NONE, 1, rtscts=0, dsrdtr=0, timeout=15) In Python, if you want to continue the source line into the next text line, you must end the line to be continued

Re: [Perl Golf] Round 1

2012-02-05 Thread Heiko Wundram
Am 05.02.2012 12:49, schrieb Alec Taylor: Solve this problem using as few lines of code as possible[1]. Pardon me, but where's the problem? If your intention is to propose a challenge, say so, and state the associated problem clearly. -- --- Heiko. --

Re: [Perl Golf] Round 1

2012-02-05 Thread Heiko Wundram
Am 05.02.2012 23:15, schrieb Neal Becker: Heiko Wundram wrote: Am 05.02.2012 12:49, schrieb Alec Taylor: Solve this problem using as few lines of code as possible[1]. Pardon me, but where's the problem? If your intention is to propose a challenge, say so, and state the associated problem

Re: Looking under Python's hood: Will we find a high performance or clunky engine?

2012-01-22 Thread Heiko Wundram
Am 22.01.2012 16:50, schrieb Rick Johnson: What does Python do when presented with this code? py [line.strip('\n') for line in f.readlines()] If Python reads all the file lines first and THEN iterates AGAIN to do the strip; we are driving a Fred flintstone mobile. If however Python strips

Re: Hash stability

2012-01-16 Thread Heiko Wundram
Am 16.01.2012 09:44, schrieb Christian Heimes: Am 16.01.2012 09:18, schrieb Peter Otten: I've taken a quick look into the suds source; the good news is that you have to change a single method, reader.Reader.mangle(), to fix the problem with hash stability. However, I didn't see any code to

Re: Hash stability

2012-01-15 Thread Heiko Wundram
Am 15.01.2012 11:13, schrieb Stefan Behnel: That's a stupid design. Using a hash function that the application does not control to index into persistent storage just screams for getting the code broken at some point. I agree completely with that (I hit the corresponding problem with suds

Re: Hash stability

2012-01-15 Thread Heiko Wundram
Am 15.01.2012 13:22, schrieb Peter Otten: Heiko Wundram wrote: I agree completely with that (I hit the corresponding problem with suds while transitioning from 32-bit Python to 64-bit Python, where hashes aren't stable either), but as stated in my mail: that wasn't the original question

Re: Hash stability

2012-01-15 Thread Heiko Wundram
Am 15.01.2012 17:13, schrieb Chris Angelico: On Mon, Jan 16, 2012 at 3:07 AM, Heiko Wundrammodeln...@modelnine.org wrote: I don't know the prevalence of suds, but I guess there's more people than me using it to query SOAP-services - all of those will be affected if the hash() output is

Re: Hash stability

2012-01-14 Thread Heiko Wundram
Am 14.01.2012 10:46, schrieb Peter Otten: Steven D'Aprano wrote: How many people rely on hash(some_string) being stable across Python versions? Does anyone have code that will be broken if the string hashing algorithm changes? Nobody who understands the question ;) Erm, not exactly true.

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Heiko Wundram
Am 03.01.2012 02:19, schrieb Adam Skutt: On Jan 2, 6:09 pm, Jérômejer...@jolimont.fr wrote: What is the clean way to avoid this race condition ? The fundamental race condition cannot be removed nor avoided. Ideally, avoid the need to send the subprocess a signal in the first place. If it

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Heiko Wundram
Am 03.01.2012 14:40, schrieb Adam Skutt: On Jan 3, 7:31 am, Heiko Wundrammodeln...@modelnine.org wrote: Yes, it can be avoided, that's what the default SIGCHLD-handling (keeping the process as a zombie until it's explicitly collected by a wait*()) is for, which forces the PID not to be reused

Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error

2012-01-02 Thread Heiko Wundram
Am 02.01.2012 14:25, schrieb Νικόλαος Κούρας: On 23 Δεκ 2011, 19:14, Νικόλαος Κούραςnikos.kou...@gmail.com wrote: I dont know why this line host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] fails sometimes and some other times works ok retrieving the hostnames correctly. Please i

Re: Misleading error message of the day

2011-12-08 Thread Heiko Wundram
Am 08.12.2011 15:47, schrieb Robert Kern: Would including the respective numbers help your thought processes? ValueError: too many values to unpack (expected 2, got 3) Not possible in the general case (as the right-hand side might be an arbitrary iterable/iterator...). -- --- Heiko. --

Re: Misleading error message of the day

2011-12-08 Thread Heiko Wundram
Am 08.12.2011 16:42, schrieb Roy Smith: The exception was raised when i() returned it's third value, so saying expected 2, got 3 is exactly correct. Yes, it is true that it might have gotten more if it kept going, but that's immaterial; the fact that it got to 3 is what caused the Holy Hand

Re: SSE4a with ctypes in python? (gcc __builtin_popcount)

2011-10-31 Thread Heiko Wundram
Am 31.10.2011 04:13, schrieb est: Is it possible to rewrite the above gcc code in python using ctypes (preferably Win/*nix compatible)? No; the (gcc-injected) functions starting with __builtin_* are not real functions in the sense that they can be called by calling into a library, but rather

Re: Problem receiving UDP broadcast packets.

2011-04-21 Thread Heiko Wundram
Am 21.04.2011 03:35, schrieb Dan Stromberg: I think tcpdump and tshark (was tethereal) will put the interface into promiscuous mode so it can see more traffic; on OSF/1 (Tru64), we had to do this manually for said programs to see all that was possible (barring the presence of a switch not

Re: learnpython.org - an online interactive Python tutorial

2011-04-21 Thread Heiko Wundram
Am 21.04.2011 09:19, schrieb Chris Angelico: On Thu, Apr 21, 2011 at 5:10 PM, Algis Kabaila akaba...@pcug.org.au wrote: False: Python IS strongly typed, without doubt (though the variables are not explicitly declared.) Strongly duck-typed though. If I create a class that has all the right

Re: is there a difference between one line and many lines

2011-04-21 Thread Heiko Wundram
Am 21.04.2011 11:55, schrieb vino19: I am asking about what happens in Python interpreter? Why is there a difference between running one line like a=1;b=1 and two lines like a=1 \n b=1? Does it decide to locate memory in different types depend on a code? There is no difference between the

Re: is there a difference between one line and many lines

2011-04-21 Thread Heiko Wundram
Am 21.04.2011 11:59, schrieb Heiko Wundram: Am 21.04.2011 11:55, schrieb vino19: I am asking about what happens in Python interpreter? Why is there a difference between running one line like a=1;b=1 and two lines like a=1 \n b=1? Does it decide to locate memory in different types depend

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Heiko Wundram
Am 20.04.2011 01:54, schrieb Grant Edwards: I guess the problem is that I expected to receive a packet on an interface anytime a packet was received with a destination IP address that matched that of the the interface. Apprently there's some filtering in the network stack based on the

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Heiko Wundram
Am 20.04.2011 16:30, schrieb Grant Edwards: If you need to see the packets regardless, either use a promiscuous mode sniffer (i.e., tcpdump, but that's relatively easy to mirror in Python using SOCK_RAW, capturing packets at the ethernet level), or add a route on your system for the

Re: Copy-on-write when forking a python process

2011-04-08 Thread Heiko Wundram
Am 08.04.2011 18:14, schrieb John Connor: Has anyone else looked into the COW problem? Are there workarounds and/or other plans to fix it? Does the solution I am proposing sound reasonable, or does it seem like overkill? Does anyone foresee any problems with it? Why'd you need a fix like

Re: Copy-on-write when forking a python process

2011-04-08 Thread Heiko Wundram
Am 08.04.2011 20:34, schrieb jac: I disagree with your statement that COW is an optimization for a complete clone, it is an optimization that works at the memory page level, not at the memory image level. In other words, if I write to a copy-on-write page, only that page is copied into my

Re: Find class of an instance?

2008-08-06 Thread Heiko Wundram
Am Mittwoch, den 06.08.2008, 08:44 -0400 schrieb Neal Becker: Sounds simple, but how, given an instance, do I find the class? inst.__class__ For example: Python 2.5.2 (r252:60911, Aug 5 2008, 03:26:50) [GCC 4.3.1] on linux2 Type help, copyright, credits or license for more information. x =

Re: proposal, change self. to .

2008-08-03 Thread Heiko Wundram
Am 03.08.2008, 12:51 Uhr, schrieb Equand [EMAIL PROTECTED]: how about changing the precious self. to . imagine self.update() .update() simple right? What about: class x: def x(self,ob): ob.doSomethingWith(self) ? Not so simple anymore, isn't it? If you're not trolling,

Re: Help me

2008-08-02 Thread Heiko Wundram
Am 02.08.2008, 18:02 Uhr, schrieb [EMAIL PROTECTED]: snip I'll help you by giving some good advice: homework is meant to be homework, so you should get started reading and processing the assignment. If you have any specific questions besides text comprehension, come back to ask. ---

Re: How smart is the Python interpreter?

2008-07-31 Thread Heiko Wundram
(sorted(string)) will be the fastest way of stating this. -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: problem when reading file

2008-07-31 Thread Heiko Wundram
/fgrep). Type grep --help to see all the options you get (context display, ignoring anything that's not a proper file or directory, only printing filenames with matches, not the matches themselves, etc.). -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Heiko Wundram
the fact that all this discussion centers around something that is a non-point, but simply a matter of personal taste. -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Heiko Wundram
the explicit test for truth of a container elsewhere as a proof for the point I'm trying to make. -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: Proxy server?

2008-07-30 Thread Heiko Wundram
just this kind of transparent proxying for a network), you're out of luck, just like Diez said. -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Heiko Wundram
that the type of x is a singular type. Additionally, IMHO if x is so much more readable than if x != something. Just my 2 (euro)cents. -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Heiko Wundram
Am Dienstag, 29. Juli 2008 11:15:05 schrieb Heiko Wundram: I can't dig up a simple example from code I wrote quickly... Just to get back to that: an example I found where if x (the generic __nonzero__() test) will work to test for emptiness/non-emptiness of a container, whereas if len(x) 0

Re: SWIG and char* newb questions :)

2008-07-29 Thread Heiko Wundram
the Python C-API directly. Hope this helps! -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Heiko Wundram
Am 29.07.2008, 18:30 Uhr, schrieb Carl Banks [EMAIL PROTECTED]: On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote: I can't dig up a simple example from code I wrote quickly, but because of the fact that explicit comparisons always hamper polymorphism I'm not going to take your word

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Heiko Wundram
Also, just a couple of points: Am 29.07.2008, 22:27 Uhr, schrieb Carl Banks [EMAIL PROTECTED]: 1. Any container type that returns a length that isn't exactly the number of elements in it is broken. I agree, but how do you ever expect to return an infinite element count? The direction I took

Re: Some notes on a high-performance Python application.

2008-03-26 Thread Heiko Wundram
with the threading server. -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: Some notes on a high-performance Python application.

2008-03-26 Thread Heiko Wundram
Am Mittwoch, 26. März 2008 18:54:29 schrieb Michael Ströder: Heiko Wundram wrote: Am Mittwoch, 26. März 2008 17:33:43 schrieb John Nagle: ... Using MySQL as a queueing engine across multiple servers is unusual, but it works well. It has the nice feature that the queue ordering

Re: what does ^ do in python

2008-03-26 Thread Heiko Wundram
Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: HOw can we use express pointers as in C or python? There's no such thing as a pointer in Python, so you can't express them either. Was this what you were trying to ask? -- Heiko Wundram -- http://mail.python.org/mailman/listinfo

Re: what does ^ do in python

2008-03-25 Thread Heiko Wundram
^ 01 = 01 01 ^ 01 = 00 10 ^ 01 = 11 11 ^ 01 = 10 -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/python-list

Re: getattr for modules not classes

2006-05-26 Thread Heiko Wundram
Am Mittwoch 24 Mai 2006 15:43 schrieb Piet van Oostrum: Heiko Wundram [EMAIL PROTECTED] (HW) wrote: HW y.py HW --- HW from x import test HW print test.one HW print test.two HW print test.three HW --- Or even: import x x = x.test print x.one print x.two print x.three Or even

Re: NEWB: how to convert a string to dict (dictionary)

2006-05-24 Thread Heiko Wundram
Am Mittwoch 24 Mai 2006 07:52 schrieb manstey: Hi, How do I convert a string like: a={'syllable': u'cv-i b.v^ y^-f', 'ketiv-qere': 'n', 'wordWTS': u'8'} into a dictionary: b={'syllable': u'cv-i b.v^ y^-f', 'ketiv-qere': 'n', 'wordWTS': u'8'} b = eval(a) (if a contains a dict-repr) ---

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-24 Thread Heiko Wundram
Am Mittwoch 24 Mai 2006 06:12 schrieb Tim Roberts: At one time, it was said that the % operator was the fastest way to concatenate strings, because it was implemented in C, whereas the + operator was interpreted. However, as I recall, the difference was hardly measurable, and may not even

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread Heiko Wundram
Am Montag 22 Mai 2006 11:27 schrieb Boris Borcic: Mhhh, your unsugared form remind me of darks hours with primitive BASICS in my youth - the kind Dijsktra commented on. Why don't you write for node in tree: if node.haschildren(): do something with node As

PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Heiko Wundram
-Modified: $Date$ Author: Heiko Wundram [EMAIL PROTECTED] Status: Active Type: Standards Track Content-Type: text/plain Created: 21-May-2006 Post-History: 21-May-2006 17:00 GMT+0200 Abstract When list comprehensions were introduced, they added the ability to add conditions which are tested

Re: Feature request: sorting a list slice

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 18:55 schrieb Raymond Hettinger: If the perf gain is small and the use cases are infrequent, the addition is likely unwarranted. There is an entire class of feature requests that are more appropriate as recipes than for inclusion in the language. The thing is: having

Re: Iterators: Would rewind be a good idea?

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 21:43 schrieb Charles D Hixson: I was reading through old messages in the list and came up against an idea that I thought might be of some value: Wouldn't it be a good idea if one could rewind an iterator? Not stated in precisely those terms, perhaps, but that's the way

Re: proposal: disambiguating type

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 21:13 schrieb gangesmaster: i suggest splitting this overloaded meaning into two separate builtins: * type(name, bases, dict) - a factory for types * typeof(obj) - returns the type of the object While I personally don't find this proposal to be bad, this is something

Re: getattr for modules not classes

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 21:52 schrieb Daniel Nogradi: Is there something analogous to __getattr__ for modules? I know how to create a class that has attributes from a list and nothing else by overloading __getattr__ and making sure that the accessed attribute appears in my list. Now I would

Re: escapes in regular expressions

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 19:49 schrieb James Thiele: re.match('\d', '7').group() print '\d' \d re.match('\\d', '7').group() print '\\d' \d '\d' evaluates to \d, because d is not a valid escape sequence. '\n' evaluates to newline, because n is a valid escape sequence. '\\' evaluates to \,

Re: Slicing Issues

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 22:52 schrieb BJ Swope: district_combo=line[85:3] This returns the slice from character 85 to character 3 in the string, read forwards. Basically, as Python slices are forgiving (because the borders are actually illogical), this amounts to nothing, but could also

Re: Feature request: sorting a list slice

2006-05-19 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 19:27 schrieb George Sakkis: It would be useful if list.sort() accepted two more optional parameters, start and stop, so that you can sort a slice in place. I've just submitted: http://sourceforge.net/tracker/index.php?func=detailaid=1491804group_id=5470atid=305470

Re: Feature request: sorting a list slice

2006-05-19 Thread Heiko Wundram
Am Freitag 19 Mai 2006 23:24 schrieb George Sakkis: This is great, thanks Heiko ! Any idea on the chances of being considered for inclusion in 2.5 ? Don't ask me, I'm not one of the core developers... ;-) But, anyway, the people on python-dev are doing their best to review patches. Just: I

Re: Complex evaluation bug

2006-05-19 Thread Heiko Wundram
Am Freitag 19 Mai 2006 18:03 schrieb Paul McGuire: An eval-less approach - the problem is the enclosing parens. snip I've just submitted two patches to the Python bugtracker at: http://sourceforge.net/tracker/index.php?func=detailaid=1491866group_id=5470atid=305470 which either change the

Re: Reference Counts

2006-05-18 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 08:28 schrieb raghu: #!/usr/bin/python import sys global a print Total Reference count at the start =,sys.gettotalrefcount() a=1 print a ref count =,sys.getrefcount(a) b=a print a ref count =,sys.getrefcount(a) del a del b print Total Reference count at the

Re: Python - Web Display Technology

2006-05-18 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 08:51 schrieb SamFeltus: I am trying to figure out why so little web development in Python uses Flash as a display technology. It seems most Python applications choose HTML/CSS/JS as the display technology, yet Flash is a far more powerful and elegant display

Re: Reference Counts

2006-05-18 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 09:33 schrieb raghu: However, the 'non-leaky' one showed a funny trend ...it kept increasing the totalrefcount for five iterations (see 1 thru 5) and then dropped down by 5 ( See Before 5 : 16584 After 5 : 16580 ) suddenly and again increase as shown below. However,

Re: Proposal for new operators to python that add syntactic sugar for hierarcical data.

2006-05-18 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 13:27 schrieb bruno at modulix: Adding ugly and unintuitive operators to try to turn a general purpose programming language into a half-backed unusable HTML templating language is of course *much* more pythonic... What about writing a mini-language that gets

Re: Proposal for new operators to python that add syntactic sugar for hierarcical data.

2006-05-18 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 15:17 schrieb glomde: nothing general the OP is trying to achieve here Define general :-). I do think I solve something and make it more readable. You could also argue that list comprehension doesnt solve anything general. Sure, a list comprehension solves

Re: Python - Web Display Technology

2006-05-18 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 16:09 schrieb SamFeltus: I guess there isn't much to understand. Sure, there's a lot to understand here. What I guess you can't come to terms with is the fact that the web (hell, the whole Internet) isn't designed for Windows personal computers only, but for a whole

Re: Proposal for new operators to python that add syntactic sugar for hierarcical data.

2006-05-18 Thread Heiko Wundram
Am Freitag 19 Mai 2006 02:08 schrieb Bruno Desthuilliers: We'd need the make: statement, but the BDFL has pronounced against. I'm still -2 against your proposition, but it could make a good use case for the make statement. I gave an eye at the new 'with' statement, but I'm not sure it could

Re: Feature request: sorting a list slice

2006-05-18 Thread Heiko Wundram
Am Donnerstag 18 Mai 2006 22:13 schrieb Raymond Hettinger: This is a false optimization. The slicing steps are O(n) and the sort step is O(n log n) unless the data has some internal structure that Timsort can use to get closer to O(n). If you implemented this and timed in it real apps, I

Re: List behaviour

2006-05-17 Thread Heiko Wundram
Am Mittwoch 17 Mai 2006 17:06 schrieb [EMAIL PROTECTED]: Maybe I'm missing something but the latter is not the behaviour I'm expecting: a = [[1,2,3,4], [5,6,7,8]] b = a[:] b [[1, 2, 3, 4], [5, 6, 7, 8]] a == b True a is b False Try an: a[0] is b[0] and a[1] is b[1]

Re: Pyparsing: Grammar Suggestion

2006-05-17 Thread Heiko Wundram
Am Mittwoch 17 Mai 2006 17:24 schrieb Khoa Nguyen: Any suggestions? If you're not limited to PyParsing, pyrr.ltk/ptk might be appropriate for you here (if you're used to bison/flex). The following file implements a small sample lexer/parser which does exactly what you need. pyrr.ltk (the

Re: Pyparsing: Grammar Suggestion

2006-05-17 Thread Heiko Wundram
Am Mittwoch 17 Mai 2006 17:53 schrieb Heiko Wundram: If you're not limited to PyParsing, pyrr.ltk/ptk might be appropriate for you here (if you're used to bison/flex). The following file implements a small sample lexer/parser which does exactly what you need. pyrr.ltk (the lexing toolkit

Re: Pyparsing: Grammar Suggestion. 2nd thought

2006-05-17 Thread Heiko Wundram
Am Mittwoch 17 Mai 2006 20:05 schrieb Khoa Nguyen: On 2nd thought, I don't think this will check for the correct order of the fields. For example, the following would be incorrectly accepted: f1,f5,f2 END_RECORD Thanks, Khoa If I'm not completely mistaken, parsers written using

Re: Pyparsing: Grammar Suggestion. 2nd thought

2006-05-17 Thread Heiko Wundram
Am Mittwoch 17 Mai 2006 20:24 schrieb Heiko Wundram: If I'm not completely mistaken, parsers written using PyParsing can accept a small superset of all languages that an N/DFA can accept, snip... Okay, forget what I said about PyParsing here; using Forward(), you can create recursion

Re: creating a new database with mysqldb

2006-05-17 Thread Heiko Wundram
Am Mittwoch 17 Mai 2006 21:23 schrieb John Salerno: Well, the thing about it is that all the guides I find online seem to begin with using a command prompt or a unix shell, neither of which will work in my case. I'm trying to find a way to access my database server using just a python script.

Re: send an email with picture/rich text format in the body

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 13:24 schrieb anya: I want to send an email message with picture in it. This... I dont want to put it as attachment but make it in the body of the mail, so every one who open the email will see the picture.. will... (it is possible that the solution will be in

Re: Question regarding checksuming of a file

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 20:51 schrieb Andrew Robert: def getblocks(f, blocksize=1024): while True: s = f.read(blocksize) if not s: return yield s This won't work. The following will: def getblocks(f,blocksize=1024): while True: s =

Re: Converting String to int

2006-05-14 Thread Heiko Wundram
Am Sonntag 14 Mai 2006 22:23 schrieb Ognjen Bezanov: mynums = 423.523.674.324.342.122.943.421.762.158.830 mynumArray = string.split(mynums,.) This is the old way of using string functions using the module string. You should only write this as: mynumArray = mynums.split(.) (using the string

  1   2   3   >