Pyton install Landmine
Hi I installed pyth3.5 on my Windows machine and had some complications trying to connect other components. I installed to the default directory chosen by the installer but that included a folder with an embedded space in the name. BIG NO NO Thanks for a great tool! Jeff -- Jeff Petersen Developer IEH Laboratories IT Support 15300 Bothell Way N.E. Lake Forest Park, Wa. 98155 Office: 206-522-5432 This message is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this message in error, please notify us immediately by telephone and delete or destroy the original message. -- https://mail.python.org/mailman/listinfo/python-list
Using 'Or'
Hi, I have python version 3.5.1 and I am working on a project, I'm trying
to make it by using the 'or' sequence, I'm trying to make it do 1 thing or
the other, here's an example: print('i like pie' or 'i like donuts'), it
only does the thing that's before the 'or', please help!
From,
Kitten Corner
--
https://mail.python.org/mailman/listinfo/python-list
Re: Post processing contour plot, how?
Den 2016-01-14 skrev Cody Piersall : > Sorry for the short response, but check out this Stack Overflow > question/answer > > http://stackoverflow.com/q/5666056/1612701 > Thanks, this is a way forward -- not as straight forward as in Scilab but better than writing my own find-contour algorithm. (I think) /Martin -- https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
On Sat, Jan 16, 2016 at 7:24 AM, Kitten Corner wrote:
> Hi, I have python version 3.5.1 and I am working on a project, I'm trying
> to make it by using the 'or' sequence, I'm trying to make it do 1 thing or
> the other, here's an example: print('i like pie' or 'i like donuts'), it
> only does the thing that's before the 'or', please help!
Under what circumstances do you want it to take the other? So far,
Python is correctly printing out one or the other of them.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
Am 15.01.16 um 21:24 schrieb Kitten Corner:
Hi, I have python version 3.5.1 and I am working on a project, I'm trying
to make it by using the 'or' sequence, I'm trying to make it do 1 thing or
the other, here's an example:
print('i like pie' or 'i like donuts')
it only does the thing that's before the 'or', please help!
I think you misunderstand what "or" does. It evaluates the first
expression, and if this is false, it evaluates the second. The empty
string is considered false in Python, so, if you modfiy your example:
print('' or 'i like donuts')
it'll print the second thing 'i like donuts'.
'or' does not choose randomly between both sides - if you are looking
for that, check
>>> import random
>>> random.choice(('donuts','apples'))
'donuts'
>>> random.choice(('donuts','apples'))
'apples'
>>> random.choice(('donuts','apples'))
'donuts'
>>>
Christian
--
https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
On Sat, Jan 16, 2016 at 7:24 AM, Kitten Corner
wrote:
> Hi, I have python version 3.5.1 and I am working on a project, I'm trying
> to make it by using the 'or' sequence, I'm trying to make it do 1 thing
> or the other, here's an example: print('i like pie' or 'i like donuts'),
> it only does the thing that's before the 'or', please help!
It's hard to say what is wrong if you don't tell us what you expect. What
*do* you expect
print('i like pie' or 'i like donuts')
to print?
(1) Always the first;
(2) Always the second;
(3) Read my mind and tell me whether I want pie or donuts right now;
(4) Randomly pick one;
(5) Something else?
I can tell you that number (3) is never going to happen :-)
My guess is that you want number (4), is that right? Unfortunately, that's
not what `or` does in Python. To print a random string in Python, probably
the best way is this:
import random
choices = ["I like pie, , pie!",
"I like donuts. Sweet, delicious donuts.",
"I like cookies. Gimme more cookies!",
"I like liver and onions. With extra liver. Hold the onions."]
print(random.choice(choices))
`or` operates differently. It takes two arguments, and it picks the first
one which is "truthy". (Truthy means "true, or something kinda like true".)
Now obviously Python cannot possibly tell whether you *actually do* like
pie or not, so what does "truthy" mean here?
In Python's case, it takes the empty string "" as false, and all other
strings as true. So:
py> "hello" or "goodbye" # choose the first truthy string
'hello'
py> "goodbye" or "hello"
'goodbye'
py> "" or "something"
'something'
Think of `or` as the following:
- if the first string is the empty string, return the second string;
- otherwise always return the first string.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
getkey
I have an application which runs on Windows and UNIX where I need to get one keypress from the user (without ENTER). Keys which sends escape sequences (e.g. cursor or function keys) should be ignored. I have a solution for Windows, but not for UNIX: The first byte of an escape sequence (example: ^[[21~ for F10) is recognized, but the trailing bytes then are not discarded by clear_keyboard_buffer() and get_key() returns the second byte of the escape sequence. My code: try: import msvcrt except ImportError: import tty import select import termios def get_key(): try: k = msvcrt.getch() except: fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: tty.setraw(fd) k = sys.stdin.read(1) finally: termios.tcsetattr(fd,termios.TCSADRAIN,old_settings) if k == '\033': clear_keyboard_buffer() return get_key() else: return k def clear_keyboard_buffer(): try: while msvcrt.kbhit(): msvcrt.getwch() except: fd = sys.stdin.fileno() while len(select.select([fd],[],[],0.0)[0]) > 0: os.read(fd,1) termios.tcflush(sys.stdin,termios.TCIOFLUSH) -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum IZUS/TIK E-Mail: [email protected] Universitaet Stuttgart Tel:++49-711-68565868 Allmandring 30aFax:++49-711-682357 70550 Stuttgart (Germany) WWW:http://www.tik.uni-stuttgart.de/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
Christian Gollwitzer :
> Am 15.01.16 um 21:24 schrieb Kitten Corner:
>> print('i like pie' or 'i like donuts')
>
>> it only does the thing that's before the 'or', please help!
>
> I think you misunderstand what "or" does. It evaluates the first
> expression, and if this is false, it evaluates the second.
The fact that "or" doesn't return True but one of its arguments is a
great feature. Too bad "any" doesn't follow suit:
>>> any(x for x in ('a', 'b'))
True
import random
random.choice(('donuts','apples'))
> 'donuts'
Well, there's that. "Any" works more nicely with generators, though.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
print size limit
I'm doing a format conversion and all works fine until I add another 100 characters... haven't determined exactly where the breaking point is... but the initial conversion gets truncated and then fixes itself a little while in. Is there a limit on the print statement or the print statement nested in a for loop? -- https://mail.python.org/mailman/listinfo/python-list
Is there a limit to the characters used in a print statement?
I'm doing a data conversion and all is garbled when I add an extra hundred lines to the print in my for loop. Is there a limit? -- https://mail.python.org/mailman/listinfo/python-list
Re: print size limit
On Sun, Jan 17, 2016 at 12:48 AM, wrote: > I'm doing a format conversion and all works fine until I add another 100 > characters... haven't determined exactly where the breaking point is... but > the initial conversion gets truncated and then fixes itself a little while > in. Is there a limit on the print statement or the print statement nested in > a for loop? > -- Shouldn't be. Can you post your code? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to the characters used in a print statement?
On 16/01/2016 13:49, Robert James Liguori wrote: I'm doing a data conversion and all is garbled when I add an extra hundred lines to the print in my for loop. Is there a limit? This will probably get answered under the thread with subject "print size limit" that arrived one minute before this did. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
On 15/01/16 20:24, Kitten Corner wrote:
Hi, I have python version 3.5.1 and I am working on a project, I'm trying
to make it by using the 'or' sequence, I'm trying to make it do 1 thing or
the other, here's an example: print('i like pie' or 'i like donuts'), it
only does the thing that's before the 'or', please help!
From,
Kitten Corner
Conditional operators (or and not == etc.) need to be used in a test
how else would you expect you print statement to be able to decided
which to print?
see if you can work through the code below
food="input food ?"
if food =='pie' or food=='donuts':
print ('I like %s'%food)
else:
print ('I dont like %s'%food'
--
https://mail.python.org/mailman/listinfo/python-list
Re: Stop writing Python 4 incompatible code
On 15/01/16 18:55, Bernardo Sulzbach wrote: On Fri, Jan 15, 2016 at 4:46 PM, Alister wrote: Doublespace disk compression springs to mind Does not ring a bell, I was not even born for MS-DOS 6.0. it was exactly the scenario described A company had developed a means of impo=roving the Fat file system (IIRC by using a pseudo file system on top to eliminate the wasted space caused by incomplete blocks & the end of files) Microsoft engaged in negotiations to include the technique in MSDOS the pulled out at the last minute (after obtaining all the technical details) & introduced their own version which operated almost identically. heck PCDos was initially written by a 3rd party who was ripped of by Microsoft. Microsoft are the goto example fro the three 'E' approach to development. Embrace Extend Extinguish -- https://mail.python.org/mailman/listinfo/python-list
Re: Stop writing Python 4 incompatible code
On Sat, Jan 16, 2016 at 12:41 PM, Alister wrote: > it was exactly the scenario described > > A company had developed a means of impo=roving the Fat file system (IIRC by > using a pseudo file system on top to eliminate the wasted space caused by > incomplete blocks & the end of files) > > Microsoft engaged in negotiations to include the technique in MSDOS > the pulled out at the last minute (after obtaining all the technical > details) & introduced their own version which operated almost identically. > > heck PCDos was initially written by a 3rd party who was ripped of by > Microsoft. > > Microsoft are the goto example fro the three 'E' approach to development. > > Embrace > Extend > Extinguish Did people know this back then or it just surfaced years later? I suppose that at the beginning MS was more "vulnerable" than it is today. -- Bernardo Sulzbach -- https://mail.python.org/mailman/listinfo/python-list
Re: Deploy Python script on Apache using mod_wsgi
On 15/01/16 22:33, [email protected] wrote: I am trying to deploy a python script on Apache using mod_wsgi. How to write the wsgi file for mod_wsgi ? I have asked my question here on http://stackoverflow.com/q/33314787/2350219 a Google search for python wsgi brings up many tutorials -- https://mail.python.org/mailman/listinfo/python-list
Re: getkey
Ulli Horlacher wrote: > The first byte of an escape sequence (example: ^[[21~ for F10) is > recognized, but the trailing bytes then are not discarded by > clear_keyboard_buffer() and get_key() returns the second byte of the > escape sequence. I have found a solution: def clear_keyboard_buffer(): try: while msvcrt.kbhit(): msvcrt.getwch() except: fd = sys.stdin.fileno() fcntl_flags = fcntl.fcntl(fd,fcntl.F_GETFL) fcntl.fcntl(fd,fcntl.F_SETFL,fcntl_flags|os.O_NONBLOCK) try: while sys.stdin.read(1): pass except: pass fcntl.fcntl(fd,fcntl.F_SETFL,fcntl_flags) -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum IZUS/TIK E-Mail: [email protected] Universitaet Stuttgart Tel:++49-711-68565868 Allmandring 30aFax:++49-711-682357 70550 Stuttgart (Germany) WWW:http://www.tik.uni-stuttgart.de/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Stop writing Python 4 incompatible code
On Sat, Jan 16, 2016 at 7:48 AM, Bernardo Sulzbach wrote: > Did people know this back then or it just surfaced years later? I > suppose that at the beginning MS was more "vulnerable" than it is > today. This was either pre- or early days of the Web which provided to some degree a shroud of secrecy. Companies today just have to work harder and pay more lawyers to keep their questionable actions from being known. -- https://mail.python.org/mailman/listinfo/python-list
Re: Pyton install Landmine
On Fri, Jan 15, 2016 at 2:49 PM, JeffP wrote: > Hi > I installed pyth3.5 on my Windows machine and had some complications trying > to connect other components. > I installed to the default directory chosen by the installer but that > included a folder with an embedded space in the name. BIG NO NO What, exactly, is not connecting? Can you post some source code and error messages? -- https://mail.python.org/mailman/listinfo/python-list
Re: Stop writing Python 4 incompatible code
> On Jan 16, 2016, at 9:48 AM, Bernardo Sulzbach > wrote: > > On Sat, Jan 16, 2016 at 12:41 PM, Alister wrote: >> it was exactly the scenario described >> >> A company had developed a means of impo=roving the Fat file system (IIRC by >> using a pseudo file system on top to eliminate the wasted space caused by >> incomplete blocks & the end of files) >> >> Microsoft engaged in negotiations to include the technique in MSDOS >> the pulled out at the last minute (after obtaining all the technical >> details) & introduced their own version which operated almost identically. >> >> heck PCDos was initially written by a 3rd party who was ripped of by >> Microsoft. >> >> Microsoft are the goto example fro the three 'E' approach to development. >> >> Embrace >> Extend >> Extinguish > > Did people know this back then or it just surfaced years later? It was known at the time. It was certainly known by the companies that were ripped off, but they were typically small to really small and couldn’t get traction for their stories in a press that was in thrall to Micro$oft. It was pretty much only mentioned by contrarian writers like Cringely, and for the most part was lost in the noise over the browser war. Bill > I > suppose that at the beginning MS was more "vulnerable" than it is > today. > > -- > Bernardo Sulzbach > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Python best practices
On Jan 15, 2016 8:20 PM, wrote: > > Are there any good resources on python best practices? e.g., articles What programming experience do you have? I'm thinking of languages. Here are a few of my guidelines - most not Python specific: Keep logic and data separate. Comment early and often - but don't comment the obvious. Use meaningful names. Read the manuals. Get familiar with modules. Someone has likely already solved the problem. Do not override built-in names. Follow these email lists. Avoid things like "if valid == True:". "if valid:" is sufficient. Read the manuals. When asking for help: Use a problem-specific subject. Use plain text so code keeps indentation Mention your Python version and OS. Include any traceback. If something is not clear try it in the interactive window. Dictionaries are very useful. Get familiar with them. HTH. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python best practices
Pylint is your friend: http://www.pylint.org/ If you already know a bit about the language then a good place to start is the Google Python Style Guide: https://google.github.io/styleguide/pyguide.html On 15/01/16 08:19 PM, [email protected] wrote: Are there any good resources on python best practices? e.g., articles Thanks, Robert -- https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
On Sun, 17 Jan 2016 01:06 am, Alister wrote: > Conditional operators (or and not == etc.) need to be used in a test Technically, that is incorrect. > how else would you expect you print statement to be able to decided > which to print? default = "I like Brussels sprouts." message = random.choice(["", "I like boiled cabbage."]) print( message or default ) -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: print size limit
On Sun, 17 Jan 2016 12:48 am, [email protected] wrote: > I'm doing a format conversion and all works fine until I add another 100 > characters... And then what happens? How many characters do you convert before that point? What does this "format conversion" do? > haven't determined exactly where the breaking point is... That's okay, you've determined where it is, plus or minus 50 characters. You know that everything is fine up to some mystery N characters, then you add 100 characters and something mysterious happens, so the breaking point has to be in the range N+1 to N+100. > but the initial conversion gets truncated and then fixes itself a little > while in. Huh? How can it fix itself? What do you mean "gets truncated"? I would start by looking at the code of this "format conversion" and see what it does. > Is there a limit on the print statement or the print statement > nested in a for loop? What does the print statement got to do with this? Above, you say that the problem is the mystery "format conversion". Perhaps if you show us some working code that demonstrates the problem, instead of talking in vague generalities, we might be able to suggest a solution. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Keen eyes
This is not python just a short snippet of javascript that refuse tracing, i've
staired blind upon it but since it does something weird with allocating memory
i have no idea what is going on and the parrots and monkeys at
comp.lang.javascript refuse to give a hint.
Something in those loops really wrong but it is no giant numbers.
function factor_it(i){
prime=true;
sqroot=Math.floor(Math.sqrt(i));
for (j=2;j
Re: Keen eyes
On Sun, Jan 17, 2016 at 9:23 AM, wrote:
> function factor_it(i){
> prime=true;
> sqroot=Math.floor(Math.sqrt(i));
> for (j=2;j prime}}
> return prime;
> }
A couple of potential problems here. The first thing that comes to
mind is that floating point inaccuracy is going to bite you long
before the numbers "seem huge" to someone who's thinking about 2**53.
The second is an off-by-one error: a perfect square may come up as
prime.
Check for those and see how it looks.
Also, check your double-use of the 'prime' variable, which also
appears to be global here.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
On 16/01/16 21:53, Steven D'Aprano wrote: On Sun, 17 Jan 2016 01:06 am, Alister wrote: Conditional operators (or and not == etc.) need to be used in a test Technically, that is incorrect. yes but the op is confused in his usage enough at present how else would you expect you print statement to be able to decided which to print? default = "I like Brussels sprouts." message = random.choice(["", "I like boiled cabbage."]) print( message or default ) I hope I never see production code like that -- https://mail.python.org/mailman/listinfo/python-list
Re: Keen eyes
Den lördag 16 januari 2016 kl. 23:30:48 UTC+1 skrev Chris Angelico:
> On Sun, Jan 17, 2016 at 9:23 AM, wrote:
> > function factor_it(i){
> > prime=true;
> > sqroot=Math.floor(Math.sqrt(i));
> > for (j=2;j > {return prime}}
> > return prime;
> > }
>
> A couple of potential problems here. The first thing that comes to
> mind is that floating point inaccuracy is going to bite you long
> before the numbers "seem huge" to someone who's thinking about 2**53.
> The second is an off-by-one error: a perfect square may come up as
> prime.
>
> Check for those and see how it looks.
>
> Also, check your double-use of the 'prime' variable, which also
> appears to be global here.
>
> ChrisA
Thank you Chris, this is not really for factoring it is meant to create a
composite sieve. Well all the legs just holding composites will be false.
Regarding the problem no number bigger than 100 is sent to the function, there
is something weird with either the loop structure or the break.
What should happen...
j=1
i=j
1+10 break (because prime in leg)
j++; well j is 2 and so is i
2+10,2+20,2+30,2+40.2+50,2+60,2+70,2+80,2+90 ((condidion break loop i>100
j++ ->i=3
3+10 break (because prime in leg)
j++
And so on...
And as you can see the outer loop does this until j reaches ***base which is
10***.
In all it is about 50 operations
So how can it allocate all memory?
--
https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
On Sat, Jan 16, 2016 at 8:47 PM, Alister wrote:
>>
>> default = "I like Brussels sprouts."
>> message = random.choice(["", "I like boiled cabbage."])
>> print( message or default )
>>
>>
>>
> I hope I never see production code like that
>
I agree. If you are going to use spaces after '(' and before ')' at
least be consistent.
--
Bernardo Sulzbach
--
https://mail.python.org/mailman/listinfo/python-list
Re: Using 'Or'
On Sun, Jan 17, 2016 at 9:47 AM, Alister wrote:
> On 16/01/16 21:53, Steven D'Aprano wrote:
>>
>> On Sun, 17 Jan 2016 01:06 am, Alister wrote:
>>
>>> Conditional operators (or and not == etc.) need to be used in a test
>>
>>
>> Technically, that is incorrect.
>
> yes but the op is confused in his usage enough at present
Adding a falsehood sometimes helps reduce the confusion, but in this
case it just worsens things, I think.
>>> how else would you expect you print statement to be able to decided
>>> which to print?
>>
>>
>>
>> default = "I like Brussels sprouts."
>> message = random.choice(["", "I like boiled cabbage."])
>> print( message or default )
>>
>>
>>
> I hope I never see production code like that
Why? Okay, maybe not with a random.choice, but what about dict lookup?
specific_messages = {
"foo": "You use a new foo.",
"bar": "You sing a few bars of music.",
}
print(specific_messages.get(kwd) or "You {} vehemently.".format(kwd))
Seems fine to me.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Re: Keen eyes
Den lördag 16 januari 2016 kl. 23:30:48 UTC+1 skrev Chris Angelico:
> On Sun, Jan 17, 2016 at 9:23 AM, wrote:
> > function factor_it(i){
> > prime=true;
> > sqroot=Math.floor(Math.sqrt(i));
> > for (j=2;j > {return prime}}
> > return prime;
> > }
>
> A couple of potential problems here. The first thing that comes to
> mind is that floating point inaccuracy is going to bite you long
> before the numbers "seem huge" to someone who's thinking about 2**53.
> The second is an off-by-one error: a perfect square may come up as
> prime.
>
> Check for those and see how it looks.
>
> Also, check your double-use of the 'prime' variable, which also
> appears to be global here.
>
> ChrisA
Thank you Chris your comment resolved it double use of j in two different
functions and loops.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to the characters used in a print statement?
On Sun, 17 Jan 2016 12:49 am, Robert James Liguori wrote: > I'm doing a data conversion and all is garbled when I add an extra hundred > lines to the print in my for loop. Is there a limit? Is this the same problem as the "print size limit" thread you started one minute earlier, or a different problem? In your previous message, you said things break when you add an extra 100 characters. Now you say 100 lines. Which is it? How big are these lines? Are they ASCII or Unicode? Are you printing before or after the data conversion? What is the data conversion doing? Are you sure that the problem is with print and not the conversion? Again, your question is little more than some vague generalities with no real detail. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Stop writing Python 4 incompatible code
On 01/16/2016 11:00 AM, William Ray Wing wrote: > It was known at the time. It was certainly known by the companies > that were ripped off, but they were typically small to really small > and couldn’t get traction for their stories in a press that was in > thrall to Microsoft. It was pretty much only mentioned by contrarian > writers like Cringely, and for the most part was lost in the noise > over the browser war. Stac, the company who Microsoft ripped off to make DoubleSpace, did successfully sue MS and won (fairly big time). MS ended up paying them a fair sum of money in damages. But it was too late by then. Stac's original product, and MS DoubleSpace, was no longer really in demand as hard drive prices fell and speeds increased. Stac moved onto reinvent itself a few times, probably saved by the money MS gave them for damages. Eventually though Stac became Previo, and then disappeared for good, selling its assets to Altirius. I am not sure Stac's destiny would have changed had MS not ripped them off, though. -- https://mail.python.org/mailman/listinfo/python-list
Re: Stop writing Python 4 incompatible code
On Sun, Jan 17, 2016 at 6:26 AM, Michael Torrie wrote: > On 01/16/2016 11:00 AM, William Ray Wing wrote: >> It was known at the time. It was certainly known by the companies >> that were ripped off, but they were typically small to really small >> and couldn’t get traction for their stories in a press that was in >> thrall to Microsoft. It was pretty much only mentioned by contrarian >> writers like Cringely, and for the most part was lost in the noise >> over the browser war. > > Stac, the company who Microsoft ripped off to make DoubleSpace, did > successfully sue MS and won (fairly big time). MS ended up paying them > a fair sum of money in damages. But it was too late by then. Stac's > original product, and MS DoubleSpace, was no longer really in demand as > hard drive prices fell and speeds increased. Not to mention the massive MASSIVE risks of doublespacing your drive - like total data loss. Even after it was made more reliable, the reputation was shot. Nobody I spoke to would ever trust that kind of drive-level compression. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: wxpython strange behaviour
On 01/15/2016 05:58 PM, Shiva Upreti wrote: > > What kind of further details do you want? Please tell me and i will try my > best to provide them. As always, post a small but complete example test program (no more than 20 lines of code) that has the problem. Paste it in such a way that one can copy and paste it into an editor and get a validly-formatted program. Also post the traceback you get when you run the test program you created. Another person has to be able to replicate the problem to advise you. Often in the process of doing this, people find their own bugs. -- https://mail.python.org/mailman/listinfo/python-list
Re: Pyton install Landmine
On Jan 16, 2016 3:02 AM, "JeffP" wrote: > > Hi > I installed pyth3.5 on my Windows machine and had some complications trying to connect other components. > I installed to the default directory chosen by the installer but that included a folder with an embedded space in the name. BIG NO NO Program Files is the standard Windows installation location for non-OS software and is selected as the default location as a security practice. If the other components to which you refer are designed for Windows but cannot correctly handle the space in Program Files, that sounds like a problem with those components, not with Python. -- https://mail.python.org/mailman/listinfo/python-list
Re: Stop writing Python 4 incompatible code
On 1/15/2016 10:09 AM, Bernardo Sulzbach wrote: On Fri, Jan 15, 2016 at 3:02 PM, William Ray Wing wrote: What Micro$oft was actually sued for was worse. They would approach a small company: “We like your product/technology, we think we are interested in buying you out, but we want to see your code to be sure it is modular/well-documented/etc.” Then, after looking over the code: “Well, it actually doesn’t fit our plans. Sorry.” Six months or so later, essentially identical stuff would turn up in a Micro$soft product. More out of curiosity than anything else, do you have a source? I thought I replied to this a few days ago from my iPhone but I haven't seen my response show up on the list. My apologies if this becomes a dupe. My favorite book is "Startup: A Silicon Valley Adventure" by Jerry Kaplan. He developed the first pen-based computer in the late 1980's that became the precursor for PDA's in the 1990's. After showing off the prototype to Apple, IBM and Microsoft, they all screwed him over by developing competing products within a few years. Microsoft was able to bring in an engineer to examine the electronic schematics and source code, decline any interest in the product, and form a development team for a pen-based Windows version. The venture capitalists squeezed the founders out and dismantled the company. Although out of print for a good many years, the book is now available as an ebook. Chris R. -- https://mail.python.org/mailman/listinfo/python-list
Re: Keen eyes
On Sun, 17 Jan 2016 10:25 am, [email protected] wrote: > double use of j in two different functions Are you using a global variable called "j" as a loop variable? That sounds like a terrible idea. You should use local variables. Then a function with a local variable j cannot possibly effect another function with a local variable also called j. Wait... is somebody going to tell me that Javascript defaults to global variables inside functions? js> function a(){ > for (j=2;j<10;j++){} > return 1 > } js> function b(){ > for (j=2; j<20;j++){} > return 1 > } js> j js: "", line 13: uncaught JavaScript runtime exception: ReferenceError: "j" is not defined. at :13 js> a() 1 js> j 10 js> b() 1 js> j 20 And this is the language that 95% of the Internet uses... my brain hurts. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Keen eyes
On Jan 17, 2016 12:16 AM, "Steven D'Aprano" wrote: > > On Sun, 17 Jan 2016 10:25 am, [email protected] wrote: > > > double use of j in two different functions > > Are you using a global variable called "j" as a loop variable? That sounds > like a terrible idea. > > You should use local variables. Then a function with a local variable j > cannot possibly effect another function with a local variable also called > j. > > Wait... is somebody going to tell me that Javascript defaults to global > variables inside functions? Technically it defaults to non local. The var statement allocates a variable within the current scope. Otherwise it searches up the chain of parent scopes for a matching variable, terminating at the global scope. I believe Lua also works this way. -- https://mail.python.org/mailman/listinfo/python-list
Re: Keen eyes
Steven D'Aprano writes: > And this is the language that 95% of the Internet uses... my brain hurts. WAT. https://www.youtube.com/watch?v=20BySC_6HyY -- https://mail.python.org/mailman/listinfo/python-list
