Saturday, November 16, 2013

comp.lang.python - 26 new messages in 10 topics - digest

comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en

comp.lang.python@googlegroups.com

Today's topics:

* Implementing #define macros similar to C on python - 6 messages, 5 authors
http://groups.google.com/group/comp.lang.python/t/c860b0cb4d0104f7?hl=en
* python 3.3 repr - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/4726d89afd8330a2?hl=en
* Automation - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.python/t/2cb5aaffece4c4a9?hl=en
* Bug asking for input number - 6 messages, 4 authors
http://groups.google.com/group/comp.lang.python/t/81815a2fcf14f6f7?hl=en
* Suggest an open-source issue tracker, with github integration and kanban
boards? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/e316be1fe7a9af24?hl=en
* PyMyth: Global variables are evil... WRONG! - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/40e017ec6b97306c?hl=en
* Question regarding 2 modules installed via 'pip' - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/f1f9d76614b30999?hl=en
* Program Translation - Nov. 14, 2013 - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/69cada4c80ff7036?hl=en
* To whoever hacked into my Database - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/1459c9bdf9ab0ada?hl=en
* Running python's own unit tests? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/a5a67ba9432de510?hl=en

==============================================================================
TOPIC: Implementing #define macros similar to C on python
http://groups.google.com/group/comp.lang.python/t/c860b0cb4d0104f7?hl=en
==============================================================================

== 1 of 6 ==
Date: Fri, Nov 15 2013 4:20 pm
From: Irmen de Jong


On 16-11-2013 0:36, JL wrote:
> Thanks! This is the answer which I am seeking. However, I am not able to get the following line to work. I am using python 2.7.5
>
> debug_print = print
>
> Can we assign a function into a variable in this manner?

Yes, functions are just another object. But 'print' is only a function as of Python 3.
For your version, try adding this as the first line:
from __future__ import print_function

Irmen





== 2 of 6 ==
Date: Fri, Nov 15 2013 4:22 pm
From: Terry Reedy


On 11/15/2013 6:36 PM, JL wrote:
> Thanks! This is the answer which I am seeking. However, I am not able to get the following line to work. I am using python 2.7.5
>
> debug_print = print

Start your file with
from __future__ import print_function
and the above should work.

Oh, and please snip stuff not relevant to your post.

--
Terry Jan Reedy





== 3 of 6 ==
Date: Fri, Nov 15 2013 4:22 pm
From: Mark Lawrence



On 15/11/2013 23:36, JL wrote:
> Thanks! This is the answer which I am seeking. However, I am not able to get the following line to work. I am using python 2.7.5
>
> debug_print = print
>
> Can we assign a function into a variable in this manner?
>
> On Friday, November 15, 2013 11:49:52 AM UTC+8, Chris Angelico wrote:
>> On Fri, Nov 15, 2013 at 1:29 PM, JL <lightaiyee@gmail.com> wrote:
>>
>>> One of my favorite tools in C/C++ language is the preprocessor macros.
>>
>>>
>>
>>> One example is switching certain print messages for debugging use only
>>
>>>
>>
>>> #ifdef DEBUG_ENABLE
>>
>>> DEBUG_PRINT print
>>
>>> #else
>>
>>> DEBUG_PRINT
>>
>>>
>>
>>> Is it possible to implement something similar in python? Thank you.
>>
>>
>>
>> There are usually other ways to do things. For instance, you can
>>
>> define a function to either do something or do nothing:
>>
>>
>>
>> if debug_mode:
>>
>> debug_print = print
>>
>> else:
>>
>> debug_print = lambda: None
>>
>>
>>
>> debug_print("This won't be shown unless we're in debug mode!")
>>
>>
>>
>> But as Dave says, you could write a preprocessor if you need one.
>>
>>
>>
>> ChrisA

Yes but please don't top post. Actually print is a statement in Python
2 so your code should work if you use

from __future__ import print_function

at the top of your code.

Would you also be kind enough to read and action this
https://wiki.python.org/moin/GoogleGroupsPython to prevent the double
line spacing shown above, thanks.

--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer

Mark Lawrence





== 4 of 6 ==
Date: Fri, Nov 15 2013 9:38 pm
From: JL


On Saturday, November 16, 2013 8:22:25 AM UTC+8, Mark Lawrence wrote:

> Yes but please don't top post. Actually print is a statement in Python
> 2 so your code should work if you use
> from __future__ import print_function
> at the top of your code.
> Would you also be kind enough to read and action this
> https://wiki.python.org/moin/GoogleGroupsPython to prevent the double
> line spacing shown above, thanks.

Thank you for the tip. Will try that out. Hope I get the posting etiquette right this time.




== 5 of 6 ==
Date: Sat, Nov 16 2013 2:02 am
From: Serhiy Storchaka


15.11.13 06:57, Chris Angelico написав(ла):
> On Fri, Nov 15, 2013 at 3:10 PM, Roy Smith <roy@panix.com> wrote:
>> Why would you want to? One of the most horrible things about C/C++ is
>> the preprocessor.
>
> Hey, that's not fair! Without the preprocessor, how would you be able
> to do this:
>
> //Hide this part away in a header file somewhere
> struct b0rkb0rk
> {
> float value;
> b0rkb0rk(float v):value(v) {}
> operator float() {return value;}
> float operator +(float other) {return value+other-0.1;}
> };
> //Behold the power of the preprocessor!
> #define float b0rkb0rk
>
> //Okay, now here's your application
> #include <iostream>
>
> int main()
> {
> std::cout << "Look how stupidly inaccurate float is!\n";
> float x = 123.0f;
> std::cout << "123.0 + 2.0 = " << x + 2.0f << "\n";
> std::cout << "See? You should totally use double instead.\n";
> }
>
> (Anybody got a cheek de-tonguer handy? I think it's stuck.)

>>> class b0rkb0rk(float):
... def __add__(self, other):
... return super().__add__(other) - 0.1
...
>>> import builtins
>>> builtins.float = b0rkb0rk
>>> float(123) + 2
124.9






== 6 of 6 ==
Date: Sat, Nov 16 2013 3:48 am
From: Mark Lawrence



On 16/11/2013 05:38, JL wrote:
> On Saturday, November 16, 2013 8:22:25 AM UTC+8, Mark Lawrence wrote:
>
>> Yes but please don't top post. Actually print is a statement in Python
>> 2 so your code should work if you use
>> from __future__ import print_function
>> at the top of your code.
>> Would you also be kind enough to read and action this
>> https://wiki.python.org/moin/GoogleGroupsPython to prevent the double
>> line spacing shown above, thanks.
>
> Thank you for the tip. Will try that out. Hope I get the posting etiquette right this time.
>

No problem. It's not a matter of etiquette, it's using a tool that's
not flawed :)

--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer

Mark Lawrence






==============================================================================
TOPIC: python 3.3 repr
http://groups.google.com/group/comp.lang.python/t/4726d89afd8330a2?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Nov 15 2013 5:09 pm
From: Steven D'Aprano


On Fri, 15 Nov 2013 17:47:01 +0000, Neil Cerutti wrote:

> The unicode support I'm learning in Go is, "Everything is utf-8, right?
> RIGHT?!?" It also has the interesting behavior that indexing strings
> retrieves bytes, while iterating over them results in a sequence of
> runes.
>
> It comes with support for no encodings save utf-8 (natively) and utf-16
> (if you work at it). Is that really enough?

Only if you never need to handle data created by other applications.



--
Steven





==============================================================================
TOPIC: Automation
http://groups.google.com/group/comp.lang.python/t/2cb5aaffece4c4a9?hl=en
==============================================================================

== 1 of 4 ==
Date: Fri, Nov 15 2013 5:28 pm
From: Tim Chase


On 2013-11-15 13:43, xDog Walker wrote:
> On Friday 2013 November 15 06:58, Grant Edwards wrote:
> > There are people (not many in this group) who grew up speaking
> > English and really ought to apologize for their writing -- but
> > they never do.
>
> Can you supply an example of the form such an apology might take?

"I'm sorry that, despite growing up steeped in the language, I can't
manage to put together two coherent thoughts or practically apply any
of the spelling/grammar/punctuation/capitalization lessons provided
at no cost to me throughout 12+ years of academic instruction."

Harumph. Non-native speakers get my extensive compassion--English
really is a nutso language, and any attempt to use it for
communicating should be lauded in the face of that challenge.
However, native speakers have a higher bar, IHMO.

-tkc






== 2 of 4 ==
Date: Fri, Nov 15 2013 6:01 pm
From: Dennis Lee Bieber


On Fri, 15 Nov 2013 19:28:45 -0600, Tim Chase
<python.list@tim.thechases.com> declaimed the following:

>On 2013-11-15 13:43, xDog Walker wrote:
>> On Friday 2013 November 15 06:58, Grant Edwards wrote:
>> > There are people (not many in this group) who grew up speaking
>> > English and really ought to apologize for their writing -- but
>> > they never do.
>>
>> Can you supply an example of the form such an apology might take?
>
>"I'm sorry that, despite growing up steeped in the language, I can't
>manage to put together two coherent thoughts or practically apply any
>of the spelling/grammar/punctuation/capitalization lessons provided
>at no cost to me throughout 12+ years of academic instruction."
>
>Harumph. Non-native speakers get my extensive compassion--English
>really is a nutso language, and any attempt to use it for
>communicating should be lauded in the face of that challenge.
>However, native speakers have a higher bar, IHMO.
>

Given that "English" contains remnants of latin (from the Roman
occupation), saxons (a germanic tribe), angles (another germanic tribe),
danish (after the joining of the anglo-saxon), other vikings (norse), then
the norman invasion (which was a mix of norse and old french), etc. -- the
overlapping of orthographic elements is no surprise.

Oh, and add in the Great Vowel Shift
http://en.wikipedia.org/wiki/Great_Vowel_Shift

At least we don't (nominally) have the situation of Mandarin vs
Cantonese (in which the spoken languages are quite different, but the
written pictographs are common, as I recall) [No... Instead we get the
different occidental phonemes for Chinese [and nearby]: Peking vs Beijing;
[nearby] Bombay vs Mumbai...]

>-tkc
>
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/





== 3 of 4 ==
Date: Fri, Nov 15 2013 10:17 pm
From: Larry Hudson


On 11/15/2013 07:02 AM, Grant Edwards wrote:
> On 2013-11-15, Paul Rudin <paul.nospam@rudin.co.uk> wrote:
>> Steven D'Aprano <steve+comp.lang.python@pearwood.info> writes:
>>
>>> A few minor errors is one thing, but when you see people whose posts are
>>> full of error after error and an apparent inability to get English syntax
>>> right, you have to wonder how on earth they expect to be a programmer?
>>
>> The irritating thing is apparent lack of care. A post is written once
>> and will be seen (perhaps not read) by many people. People post with the
>> intention of others reading their words. If they can't be bothered to
>> take a little care in writing, why should we spend time reading?
>
> Just because English is your second language it doesn't mean you don't
> need to pay attention to what keys you're hitting and proof-read a
> posting before hitting "send".
>
> And yes, people can _easily_ tell the difference between errors caused
> by being lazy/sloppy and errors caused by writing in a second
> language.
>
Not to start another flame-war (I hope), but our Greek friend is a good example of that. It's
not surprising he has so much trouble with his code.

However, that's just a side comment. I wanted to mention my personal peeve...

I notice it's surprisingly common for people who are native English-speakers to use 'to' in
place of 'too' (to little, to late.), "your" in place of "you're" (Your an idiot!) and 'there'
in place of 'their' (a foot in there mouth.) There are similar mis-usages, of course, but those
three seem to be the most common.

Now, I'm a 76-year-old curmudgeon and maybe overly sensitive, but I felt a need to vent a bit.

-=- Larry -=-





== 4 of 4 ==
Date: Sat, Nov 16 2013 3:42 am
From: Mark Lawrence



On 16/11/2013 02:01, Dennis Lee Bieber wrote:
>
> Given that "English" contains remnants of latin (from the Roman
> occupation), saxons (a germanic tribe), angles (another germanic tribe),
> danish (after the joining of the anglo-saxon), other vikings (norse), then
> the norman invasion (which was a mix of norse and old french), etc. -- the
> overlapping of orthographic elements is no surprise.
>

I'm trying to work out what the(?) language should be called given the
above list. Sure "English" is derived from those "angles", but by the
time you've derived all the other names and strung them all together,
phew, what a mouthful. It's best not to go there, yes?

Also consider how the language has changed from Chaucer, through
Shakespear, Dickins and now J.K. Rowling.

Then there's the centre of the universe, "Breamore" is prounced
"Bremmer" and used to be spelt "Bremmer". Don't ask :)

--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer

Mark Lawrence






==============================================================================
TOPIC: Bug asking for input number
http://groups.google.com/group/comp.lang.python/t/81815a2fcf14f6f7?hl=en
==============================================================================

== 1 of 6 ==
Date: Fri, Nov 15 2013 6:15 pm
From: Arturo B


Hi! I hope you can help me.

I'm writting a simple piece of code.
I need to keep asking for a number until it has all this specifications:

- It is a number
- It's lenght is 3
- The hundred's digit differs from the one's digit by at least two

My problem is that I enter a valid number like: 123, 321, 159, 346... and it keeps asking for a valid number.

Here's mi code:

res = input('Give me a number --> ')
hundreds = int(res[0])
ones = int(res[2])

# checks if the user enters a valid number
while not res.isdigit() or not len(res) == 3 or abs(hundreds - ones) <= 2:
res = input('Enter a valid number --> ')

Thanks for help!




== 2 of 6 ==
Date: Fri, Nov 15 2013 6:33 pm
From: MRAB


On 16/11/2013 02:15, Arturo B wrote:
> Hi! I hope you can help me.
>
> I'm writting a simple piece of code.
> I need to keep asking for a number until it has all this specifications:
>
> - It is a number
> - It's lenght is 3
> - The hundred's digit differs from the one's digit by at least two
>
> My problem is that I enter a valid number like: 123, 321, 159, 346... and it keeps asking for a valid number.
>
> Here's mi code:
>
> res = input('Give me a number --> ')
> hundreds = int(res[0])
> ones = int(res[2])
>
> # checks if the user enters a valid number
> while not res.isdigit() or not len(res) == 3 or abs(hundreds - ones) <= 2:
> res = input('Enter a valid number --> ')
>
> Thanks for help!
>
In the loop you're asking for the number but not doing the:

hundreds = int(res[0])
ones = int(res[2])

bit for it.

Also, after the number is entered for the first time, you're not
first checking its length or that it's a number.

It's probably easier just to use a break in a loop:

while True:
res = input('Give me a number --> ')
if len(res) == 3 and res.isdigit() and abs(int(res[0]) -
int(res[2])) >= 2:
break





== 3 of 6 ==
Date: Fri, Nov 15 2013 6:37 pm
From: Terry Reedy


On 11/15/2013 9:15 PM, Arturo B wrote:
> Hi! I hope you can help me.
>
> I'm writting a simple piece of code.
> I need to keep asking for a number until it has all this specifications:
>
> - It is a number
> - It's lenght is 3
> - The hundred's digit differs from the one's digit by at least two
>
> My problem is that I enter a valid number like: 123, 321, 159, 346... and it keeps asking for a valid number.

If you enter a 'valid' number at first try, it works fine.

> Here's mi code:
>
> res = input('Give me a number --> ')
> hundreds = int(res[0])
> ones = int(res[2])
>
> # checks if the user enters a valid number
> while not res.isdigit() or not len(res) == 3 or abs(hundreds - ones) <= 2:

Look at that last condition *carefully*!!!!

> res = input('Enter a valid number --> ')


--
Terry Jan Reedy





== 4 of 6 ==
Date: Fri, Nov 15 2013 7:03 pm
From: Arturo B


MRAB your solution is good thank you I will use it.

Terry Eddy I saw my mistake about for example 2 <= 2, I think it's easier to use break in this case thank you!




== 5 of 6 ==
Date: Fri, Nov 15 2013 6:47 pm
From: Christopher Welborn


On 11/15/2013 08:15 PM, Arturo B wrote:> Hi! I hope you can help me.
>
> I'm writting a simple piece of code.
> I need to keep asking for a number until it has all this specifications:
>
> - It is a number
> - It's lenght is 3
> - The hundred's digit differs from the one's digit by at least two
>
> My problem is that I enter a valid number like: 123, 321, 159, 346...
and it keeps asking for a valid number.
>
> Here's mi code:
>
> res = input('Give me a number --> ')
> hundreds = int(res[0])
> ones = int(res[2])
>
> # checks if the user enters a valid number
> while not res.isdigit() or not len(res) == 3 or abs(hundreds - ones)
<= 2:
> res = input('Enter a valid number --> ')
>
> Thanks for help!
>


You only set 'hundreds' and 'ones' the first time, when the loop goes
around those values never change. Also, I don't see any .isdigit()
before you call int(), which may make it error (maybe you just didn't
post the full code?). Also, I think your <= is flipped the wrong way.
The difference should be greater than or equal to 2 right?
Try something like this:

def is_valid_input(s):
""" Returns True if a number is a digit,
is 3 digits long,
and hundreds - ones is >= 2
"""
if not (s.isdigit() and (len(s) == 3)):
return False
hundreds = int(s[0])
ones = int(s[2])
return abs(hundreds - ones) >= 2

prompt = 'Give me a number --> '

res = input(prompt)
while not is_valid_input(res):
print('\nInvalid number!: {}\n'.format(res))
res = input(prompt)

...Of course you don't have to make it a function, I just did that
because it was going to be used more than once. If you need to actually
work with 'hundreds' and 'ones', you can rewrite it to suit your needs.

--

- Christopher Welborn <cjwelborn@live.com>
http://welbornprod.com





== 6 of 6 ==
Date: Fri, Nov 15 2013 7:15 pm
From: Christopher Welborn


Sorry about my previous post, gmane is being really slow. :(

I wouldn't have posted if I knew the question was already answered.


--

- Christopher Welborn <cjwelborn@live.com>
http://welbornprod.com






==============================================================================
TOPIC: Suggest an open-source issue tracker, with github integration and
kanban boards?
http://groups.google.com/group/comp.lang.python/t/e316be1fe7a9af24?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Nov 15 2013 7:21 pm
From: Jason Friedman


> Can you recommend an open source project (or two) written in Python;
> which covers multi project + sub project issue tracking linked across
> github repositories?
>

Why does it need to be written in Python?





==============================================================================
TOPIC: PyMyth: Global variables are evil... WRONG!
http://groups.google.com/group/comp.lang.python/t/40e017ec6b97306c?hl=en
==============================================================================

== 1 of 3 ==
Date: Fri, Nov 15 2013 8:01 pm
From: Rick Johnson


On Friday, November 15, 2013 2:19:01 AM UTC-6, Steven D'Aprano wrote:

> But with software, coupling is *easy*. By default, code in
> a single process is completely coupled. Think of a chunk
> of machine code running in a single piece of memory. We
> have to build in our own conventions for decoupling code:
> subroutines, local variables, objects, modular code, and
> so forth. Physical objects are inherently decoupled. Code
> is inherently coupled, and we need conventions to decouple
> it. One of those conventions is to prefer local variables
> to global variables, and another is to limit the scope of
> global variables to per module rather than process-wide.

You're thoughts on "coupling" and "decoupling"
of design architecture is correct, but you only argue for
your side :-). Allow me to now argue for my side now.

And i want to leave the "safe" world of general analogies
and enter the dark esoteric word of flawed software design.

And since people only want to give me credit when i talk
about Tkinter, well then, what better example of bad design
is there than Tkinter? Hmm, well there's IDLE but that will
have to wait for another thread.

Let's see... Tkinter's design today is a single module
containing a staggering:

155,626 chars

3,733 lines

30 classes

16 functions

4 "puesdo-constants" (Python does not support true
constants!)

10 "module level" variables (3 of which are mutated from
nested scopes within the module itself)

Unwise use of a global import for the types module, even
though only a few names are used -- AND there are
better ways to test type nowadays!

Unwisely auto-imports 82 Tkinter constants.

Only OpenGL is more promiscuous than Tkinter!

But let's stay on subject shall we!

============================================================
The Road To Recovery:
============================================================

The very first thing a wise programmer would do is create a
package called "tkinter". Then, he would export all class
source code to individual sub-modules -- each module being
the class name in lowercase.

AND VOILA!

Even after only a simple half hour of restructuring, the
code is starting to become maintainable -- IMAGINE THAT!


BUT DON'T GET YOUR ASTROGLIDE OUT YET FELLA!

WE'VE GOT MORE WORK TO DO!

Just as the programmer thought "all was well" in "toon
town", he quickly realizes that since Python has no
intelligent global variable access, and his sub-modules need
to share data with the main tkinter module (and vise versa),
he will be forced to write:

from tkinter import var1, var2, ..., varN

IN EVERY DAMN SUBMODULE that needs to access or
mutate one of the shared variables or shared
functions.

Can anyone tell me why sharing globals between sub-packages
is really so bad that we have to import things over and
over?

And if so, would you like to offer a cleaner solution for
the problem?

And don't give me the messy import thing, because that's
not elegant!

WHY IS IT NOT ELEGANT RICK?

Because when i see code that accesses a variable like this:

var = value

I have no way of knowing whether the mutation is happening
to a local variable, a module level variable, or even a true
global level variable (one which extends beyond the
containing module).

Sure, i could search the file looking for imports or
global declarations, but why not use "self documenting
paths" to global variables?

The best solution is to create a global namespace. You could
name it "G". So when i see a mutation like this:

G.var = value:

I will know that the mutation is happening to a REAL global
variable. But, even that information is lacking. I need
more... What i really want to see is this:

G.tkinter.var = value

Boom baby! Every thing i need to know is contained within
that single line without "import everywhere".

I am accessing a global variable
I am accessing a global variable for the tkinter package
The variable's name is "var"

It's explicit, but it's not SO explicit that it becomes
excessive, no. I would much rather type just a FEW more
characters than scour source code looking for obscure clues
like global declarations, imports, or whatever foolish
design you can pull out of your arse!

And what about the mysterious "run-time injected
global", how the heck are you planning to handle
that one with imports?

I just want to access globals in an logical and consistent
manner via a clean interface which will alleviate all the
backtracking and detective work that causes us to lose focus
on the main architecture of our software.

Because,

EXPLICIT IS BETTER THAN IMPLICIT.

And,

FOCUS IS BETTER THAN FRUSTRATION!

Is that really too much to ask?

Must i create a hack (C.py and G.py) for every missing or
broken feature in this damn language?




== 2 of 3 ==
Date: Fri, Nov 15 2013 8:19 pm
From: Chris Angelico


On Sat, Nov 16, 2013 at 3:01 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> Let's see... Tkinter's design today is a single module
> containing a staggering:
>
> 155,626 chars
>
> 3,733 lines

Also: I see nothing wrong with a single module having 3-4K lines in
it. Hilfe, the Pike REPL/interactive interpreter, is about that long
and it's not a problem to maintain. The Python decimal module (as
opposed to CDecimal) is twice that, in the installation I have here to
check. My primary C++ module from work was about 5K lines, I think -
of that order, at least.

Python modules don't need to be split up into tiny fragments.
Flat is better than nested.

ChrisA




== 3 of 3 ==
Date: Fri, Nov 15 2013 8:14 pm
From: Chris Angelico


On Sat, Nov 16, 2013 at 3:01 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> Because when i see code that accesses a variable like this:
>
> var = value
>
> I have no way of knowing whether the mutation is happening
> to a local variable, a module level variable, or even a true
> global level variable (one which extends beyond the
> containing module).

If it's in a function, and there's no global/nonlocal declaration,
it's local. Otherwise, it's module level. It can't be process-level in
Python, so you don't need to worry about that.

It doesn't get much simpler than that without variable declarations
(in which case it's "scan surrounding scopes till you find a
declaration, that's it" - and it's arguable whether that's simpler or
not). Really Rick, you're clutching at straws here.

ChrisA





==============================================================================
TOPIC: Question regarding 2 modules installed via 'pip'
http://groups.google.com/group/comp.lang.python/t/f1f9d76614b30999?hl=en
==============================================================================

== 1 of 2 ==
Date: Sat, Nov 16 2013 12:52 am
From: Ferrous Cranus


Finally i have managed to install 'Python' and 'Python-pip' from rpms from EPEL repository.

That good BUT:

root@secure [~]# pip install pymysql
Downloading/unpacking pymysql
Downloading PyMySQL-0.6.1.tar.gz (51kB): 51kB downloaded
Running setup.py egg_info for package pymysql
Installing collected packages: pymysql
Running setup.py install for pymysql
Successfully installed pymysql
Cleaning up...
root@secure [~]# pip install pygeoip
Downloading/unpacking pygeoip
Downloading pygeoip-0.3.0.tar.gz (97kB): 97kB downloaded
Running setup.py egg_info for package pygeoip
Installing collected packages: pygeoip
Running setup.py install for pygeoip
Successfully installed pygeoip
Cleaning up...
root@secure [~]#
root@secure [~]# pip list py*
distribute (0.6.10)
ethtool (0.6)
iniparse (0.3.1)
iwlib (1.0)
pycurl (7.19.0)
pygeoip (0.3.0)
pygpgme (0.1)
PyMySQL (0.6.1)
urlgrabber (3.9.1)
yum-metadata-parser (1.1.2)
root@secure [~]#

but when is: http://superhost.gr
i get the error you will like 'pymysql' and 'pymysql' are missing
Since they are install how can they be missing?

root@secure [~]# which python
/usr/bin/python

root@secure [~]# which python3
/usr/bin/python3
root@secure [~]#

The only thing i can think of is that those packages have installed under default python 2.6.6 and not under Python 3.3.2.

Can this be the case here?
And if yes then, how will i e those 2 packages with latest python?




== 2 of 2 ==
Date: Sat, Nov 16 2013 2:41 am
From: Antoon Pardon


Op 16-11-13 09:52, Ferrous Cranus schreef:
>
> but when is: http://superhost.gr
> i get the error you will like 'pymysql' and 'pymysql' are missing
> Since they are install how can they be missing?
>
> root@secure [~]# which python
> /usr/bin/python
>
> root@secure [~]# which python3
> /usr/bin/python3
> root@secure [~]#
>
> The only thing i can think of is that those packages have installed under default python 2.6.6 and not under Python 3.3.2.
>
> Can this be the case here?

It can be the case. Now think of a way to verify this.

--
Antoon Pardon





==============================================================================
TOPIC: Program Translation - Nov. 14, 2013
http://groups.google.com/group/comp.lang.python/t/69cada4c80ff7036?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 16 2013 1:31 am
From: "Terence"


I downloaded the packed file mentioned, extracted the files and had a look
at the Fortran sources given:
ETGTAB.FOR and ETGTAB.F

The ETGTAB.FOR file had double spacing, which Iremoved automatically, then
compared the two sources automatically (passing and copying equals and
offering choice between lexically different lines).

The two files were now very nearly identical, but the .FOR file had some
CALLs to GEOEXT(IUIT6,DEXTIM) which were commented out in the other; also
calls to LAHEY timing functions not used in the .F version (and a minor
change in two format statements which effectively just changed the shift in
the output report).

I don't see why not either source (given access to the external GEOEXT, etc,
fuctions) shouldn't be left for compilation (and later running) by any F77
or later compiler. The code is still valid.









==============================================================================
TOPIC: To whoever hacked into my Database
http://groups.google.com/group/comp.lang.python/t/1459c9bdf9ab0ada?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 16 2013 2:40 am
From: Robert Day


On 11/11/13 09:36, Νίκος Αλεξόπουλος wrote:
>
> Tell the mighty female hacker to polish her nails, do her hair and fix
> a good meal.

Nikos,

I'm afraid I'm not very impressed by this misogynist nonsense you keep
coming out with about how your supposed female hacker ought to be doing
stereotypically female things instead. Please can you stop making these
comments? I don't think it's very pleasant or inclusive for the Python
community (as a whole, not just women) to see comments like these being
made and not being called out.

Thanks,
Rob





==============================================================================
TOPIC: Running python's own unit tests?
http://groups.google.com/group/comp.lang.python/t/a5a67ba9432de510?hl=en
==============================================================================

== 1 of 1 ==
Date: Sat, Nov 16 2013 3:05 am
From: Tim Golden


On 15/11/2013 23:10, Russell E. Owen wrote:
> In article <5285223D.50309@timgolden.me.uk>,
> Tim Golden <mail@timgolden.me.uk> wrote:
>
>> http://docs.python.org/devguide/
>
> Thank you and the other responders. I was expecting to find the
> information here <http://docs.python.org/2/using/unix.html> under
> Building Python. The developer's guide is a nice resource.

There's probably a case for referring to the dev guide from that page
under "Building Python". I'll propose a patch.

TJG





==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en

To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate