Re: [Tutor] Installing Python and modules

2011-12-19 Thread Jugurtha Hadjar

On 15/12/2011 01:28, Sean Baumgarten wrote:

Hello,

I'm wondering if someone could walk me step-by-step through installing 
Python and some third-party modules. I've never used Python or other 
programming languages before, but I'm just trying to install it so I 
can run a simple script. I'm running Mac OSX 10.6.8.





Hello Sean,

Installing Python shouldn't be a problem .. I found it more complicated 
to subscribe to this mailing list than to install it :)   ..


I think it comes with most of what you need in a single package. I 
needed recently pyWin, and I downloaded it from Sourceforge.


I'll walk in your shoes for a bit (Although I'm on Windows XP 5.1.2600  
Python 3.2)


I searched for the term Numpy on Google. The first site it returned was 
numpy.scipy.org


I clicked on Download, I landed on http://new.scipy.org/download.html.

I opened two links in new tabs : SourceForge site for Numpy  
SourceForge site for Scipy


http://sourceforge.net/projects/numpy/files/

And

http://sourceforge.net/projects/scipy/files/

Looking for the latest version? *Download 
numpy-1.6.1-win32-superpack-python2.6.exe (6.0 MB) 
http://sourceforge.net/projects/numpy/files/latest/download?source=files


*Looking for the latest version? *Download 
scipy-0.10.0-win32-superpack-python2.6.exe (46.0 MB) 
http://sourceforge.net/projects/scipy/files/latest/download?source=files *

*
*You click on the links (I think the site is OS aware, so you'll 
probably be given a link for a dmg or something if you're on a mac)


I see the python2.6 at the end, I guess it won't work but I'll test 
for the sake of being certain nevertheless.


I click on the numpy-1.6.1 because it's smaller and to test quickly.. 
(I'm typing as I'm doing, so do some nops while you wait :) )


I launch the installation  of  numpy-1.6.1 and it says Python version 
2.6 required, which was not found in the registry in a dialog box 
titled Cannot install.


I Google nympy python 3.2 .. The second link seems interesting

http://www.wilmott.com/messageview.cfm?catid=10threadid=83588

The guy posting the question was advised to stick with Python 2.6 or 2.7 
and given a link for the FAQ


http://new.scipy.org/faq.html#does-numpy-currently-work-with-python-3-x-what-about-scipy


I don't know which version of Python you're using.

--
~Jugurtha Hadjar,

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Request for guidance about a python syntax

2011-12-19 Thread Ganesh Borse
Dear Tutors,

I am new to python.

I am trying to understand ( use) the python implementation of goertzel
implementation provided on
http://www.black-aura.com/blog/2011/12/10/python-implementation-of-the-goertzel-algorithm-dtmf-decoding/
.

This python program uses unpack_from() function to unpack string into array
of ints, with the following statement:
frames = struct.unpack_from(*%dH % nframes * **nchannels*, frames)

I could know the use of unpack_from, but I could not understand the fmt
part, i.e *%dH % nframes * nchannels*.
Can you pls help me know, what is the purpose of two % signs in this
statement?

Thanks for your help in advance.

Best Regards,
banes
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Request for guidance about a python syntax

2011-12-19 Thread Jerry Hill
On Mon, Dec 19, 2011 at 10:54 AM, Ganesh Borse bganes...@gmail.com wrote:

 I could know the use of unpack_from, but I could not understand the fmt
 part, i.e *%dH % nframes * nchannels*.
 Can you pls help me know, what is the purpose of two % signs in this
 statement?


That's python's string formatting.  See
http://docs.python.org/library/stdtypes.html#string-formatting-operations for
details.  Basically, it's building the format for the call to unpack_from
on the fly.  The %dH portion is calling for a single decimal value to
become part of the string (that's the %d portion).  That value comes from
multiplying nframes by nchannels.  So, for example, if nframes = 10 and
nchannels = 24, then the string becomes 240H.  That, in turn, tells the
program to unpack a sequence of 240 unsigned short values from the buffer.

-- 
Jerry
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson

Win 7, 64-bit

I had Py 2.5 installed on my PC earlier this year, and it began failing 
around June. I finally uninstalled it, and tried 2.6.  Still had 
problems that centered around getting to IDLE. Uninstalled 2.6, and went 
to 2.7. Same problem. I completely uninstalled 2.7. I do have several 
folders of py programs. No Python.


After that episode, I began to notice the following messages when I 
signed on to my PC after a boot. I do not bring my PC down very often.


Specified module could not be found: Loadlib python.dll failed, and 
another of the same for Python25.dll failed (maybe not found).  I did a 
search for both, but neither were found.


I ignored this inconvenience for a few weeks, and had developed a need 
to copy a particular python program on Win 7 to another computer. Call 
it abc.py.  I copied it to a thumb drive, and plugged the drive into the 
other PC, which has Python on it.  abc.py was missing from the drive.  I 
tried this about three times, and even went to yet another PC. No abc.py.


 Finally, I pulled xyz.py from an XP PC on to the drive. When I put it 
on yet another PC, xyz.py was there, and I copied it on to the PC. Very 
strange.  Note again, I did not have Python installed on the Win 7 PC.  
I have no idea if any of this is relevant to the attempt to install Py 
on my Win 7 PC, but it and the sign-on msgs may indicate something is 
twisted in the registry.


Comments?

It would be nice to get rid of the two msgs upon sign-on.

--
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
  Obz Site:  39° 15' 7 N, 121° 2' 32 W, 2700 feet

 CE 1955 October 20 07:53:32.6 UT
-- The Date The mystery unfolds.

Web Page:www.speckledwithstars.net/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread James Reynolds
On Mon, Dec 19, 2011 at 11:35 AM, Wayne Watson sierra_mtnv...@sbcglobal.net
 wrote:

 Win 7, 64-bit

 I had Py 2.5 installed on my PC earlier this year, and it began failing
 around June. I finally uninstalled it, and tried 2.6.  Still had problems
 that centered around getting to IDLE. Uninstalled 2.6, and went to 2.7.
 Same problem. I completely uninstalled 2.7. I do have several folders of py
 programs. No Python.

 After that episode, I began to notice the following messages when I signed
 on to my PC after a boot. I do not bring my PC down very often.

 Specified module could not be found: Loadlib python.dll failed, and
 another of the same for Python25.dll failed (maybe not found).  I did a
 search for both, but neither were found.

 I ignored this inconvenience for a few weeks, and had developed a need to
 copy a particular python program on Win 7 to another computer. Call it
 abc.py.  I copied it to a thumb drive, and plugged the drive into the other
 PC, which has Python on it.  abc.py was missing from the drive.  I tried
 this about three times, and even went to yet another PC. No abc.py.

  Finally, I pulled xyz.py from an XP PC on to the drive. When I put it on
 yet another PC, xyz.py was there, and I copied it on to the PC. Very
 strange.  Note again, I did not have Python installed on the Win 7 PC.  I
 have no idea if any of this is relevant to the attempt to install Py on my
 Win 7 PC, but it and the sign-on msgs may indicate something is twisted in
 the registry.

 Comments?

 It would be nice to get rid of the two msgs upon sign-on.

 --
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
  Obz Site:  39° 15' 7 N, 121° 2' 32 W, 2700 feet

 CE 1955 October 20 07:53:32.6 UT
-- The Date The mystery unfolds.

Web 
 Page:www.speckledwithstars.**net/http://www.speckledwithstars.net/
 


 __**_
 Tutor maillist  -  Tutor@python.org
 To unsubscribe or change subscription options:
 http://mail.python.org/**mailman/listinfo/tutorhttp://mail.python.org/mailman/listinfo/tutor





Did you change the PATH to the right directory? It may still be pointing to
the old directory, or you may have never set it to begin with.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Request for guidance about a python syntax

2011-12-19 Thread Peter Otten
Jerry Hill wrote:

 On Mon, Dec 19, 2011 at 10:54 AM, Ganesh Borse bganes...@gmail.com
 wrote:
 
 I could know the use of unpack_from, but I could not understand the fmt
 part, i.e *%dH % nframes * nchannels*.
 Can you pls help me know, what is the purpose of two % signs in this
 statement?


 That's python's string formatting.  See
 http://docs.python.org/library/stdtypes.html#string-formatting-operations
 for
 details.  Basically, it's building the format for the call to unpack_from
 on the fly.  The %dH portion is calling for a single decimal value to
 become part of the string (that's the %d portion).  That value comes
 from
 multiplying nframes by nchannels.  So, for example, if nframes = 10 and
 nchannels = 24, then the string becomes 240H.  That, in turn, tells the
 program to unpack a sequence of 240 unsigned short values from the buffer.

Close, but % and * have the same operator precedence. Therefore the 
expression

%dH % nframes * nchannels

is evaluated as

(%dH % nframes) * nchannels

So

 nframes = 2
 nchannels = 3
 %dH % nframes
'2H'
 %dH % nframes * nchannels
'2H2H2H'

The original script still works because multiplying a string by an integer 
repeats the string, and the format 2H2H2H is equivalent to 6H, but

%dH % (nframes * nchannels)

is probably a bit more efficient, especially for large values of nchannels.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Request for guidance about a python syntax

2011-12-19 Thread Jerry Hill
On Mon, Dec 19, 2011 at 12:10 PM, Peter Otten __pete...@web.de wrote:

 Close, but % and * have the same operator precedence. Therefore the
 expression

 %dH % nframes * nchannels

 is evaluated as

 (%dH % nframes) * nchannels


Thanks Peter, that's exactly correct.  Maybe this will teach me not to post
things without actually trying them in the interactive interpreter.

-- 
Jerry
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson

  
  


On 12/19/2011 8:50 AM, James Reynolds wrote:

  
  On Mon, Dec 19, 2011 at 11:35 AM, Wayne
Watson sierra_mtnv...@sbcglobal.net
wrote:

  Win 7, 64-bit
  
  I had Py 2.5 installed on my PC earlier this year, and it
  began failing around June. I finally ...
CE 1955 October 20 07:53:32.6 UT
   -- "The Date" The mystery unfolds.
  
   Web Page:www.speckledwithstars.net/
  
  
  ___
  Tutor maillist - Tutor@python.org
  To unsubscribe or change subscription options:
  http://mail.python.org/mailman/listinfo/tutor

  
  
  
  
  
  
  
  
  Did you change the PATH to the right directory? It may still
be pointing to the old directory, or you may have never set it
to begin with.

Someone suggested this several months when I was having an install
problem.
===
That being said, it sounds an awful lot like the python.exe isn't in
your path. To get it there you can open windows explorer (WIN+E)
right click on computer  properties then click advanced system
settings. In the window that pops up, click the "environment
variables" button. In the "system variables" portion, find the path
variable and click the "Edit..." button. Assuming that your new
installation was placed in C:\Python25\ you will want to add
";C:\Python25\" (the semicolon is important!) to the end of your
path.
===
Is that what you are suggesting? I brought up WE and clicked on
properties, and got a six tab dialog. Pushed Advanced. Tabs are:
Sharing, Security, Prev versions, general, tools, h/w, quota. I
don't see anything about about a PATH, sys or env vars. 
-- 
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
  Obz Site:  39 15' 7" N, 121 2' 32" W, 2700 feet

 CE 1955 October 20 07:53:32.6 UT 
-- "The Date" The mystery unfolds.

Web Page: www.speckledwithstars.net/



  

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread James Reynolds
On Mon, Dec 19, 2011 at 2:21 PM, Wayne Watson
sierra_mtnv...@sbcglobal.netwrote:



 On 12/19/2011 8:50 AM, James Reynolds wrote:



 On Mon, Dec 19, 2011 at 11:35 AM, Wayne Watson 
 sierra_mtnv...@sbcglobal.net wrote:

 Win 7, 64-bit

 I had Py 2.5 installed on my PC earlier this year, and it began failing
 around June. I finally ...

 CE 1955 October 20 07:53:32.6 UT
-- The Date The mystery unfolds.

Web Page:www.speckledwithstars.net/


 ___
 Tutor maillist  -  Tutor@python.org
 To unsubscribe or change subscription options:
 http://mail.python.org/mailman/listinfo/tutor





  Did you change the PATH to the right directory? It may still be pointing
 to the old directory, or you may have never set it to begin with.

 Someone suggested this several months when I was having an install problem.
 ===
 That being said, it sounds an awful lot like the python.exe isn't in your
 path. To get it there you can open windows explorer (WIN+E) right click on
 computer  properties then click advanced system settings. In the window
 that pops up, click the environment variables button. In the system
 variables portion, find the path variable and click the Edit... button.
 Assuming that your new installation was placed in C:\Python25\ you will
 want to add ;C:\Python25\ (the semicolon is important!) to the end of
 your path.
 ===
 Is that what you are suggesting? I brought up WE and clicked on
 properties, and got a six tab dialog.  Pushed Advanced. Tabs are: Sharing,
 Security, Prev versions, general, tools, h/w, quota. I don't see anything
 about  about a PATH, sys or env vars.

 --
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

  (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
   Obz Site:  39° 15' 7 N, 121° 2' 32 W, 2700 feet

  CE 1955 October 20 07:53:32.6 UT
 -- The Date The mystery unfolds.

 Web Page: www.speckledwithstars.net/



  In windows 7,

1. Go to start
2. Right click on Computer
3. Select Properties. This will bring up the System menu.
4. Select Advanced system Settings on the left hand side.
5. In this new window, select Environment variables... at the bottom
6. In the bottom window area, scroll down until you find PATH
7. Select Edit (do NOT delete anything contained in this or will screw
some stuff up)
8. scroll to the very end and put a ; as a deliminator if there isn't one
on the end already. Then put the direct path to you Python install you care
about. (it should be something like this:(;C:\Python27) - this is mine in
fact.
9. Hit OK. Then accept your way out. You will have to reboot.
10. To test, open a cmd prompt and and type simply python. if you get
Python 2.7.2 (some more stuff) then python is now on your path.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python challenge and decryption

2011-12-19 Thread Joaquim Santos
Hi list!

This is my first post here but I've been following the list for some time
now! I know that recently there was a message about decryption and all. I
think that was what made me go back into the Python challenge and try to
solve some of them...

For the second one, I first laid on paper my ideas, about user interaction
(or input) and what would do what.

I haven't implemented the user input yet but as I tested I ended up having
some problems. Anticipated but still annoying...

 My Python version is 2.7.1 and my OS is Linux Mint 11.

My code is this one:

 def decrypt(cypheredText, shiftedCypherNumber):

'''

This function will take two arguments. The first is the cyphered text, the
second

is the number of characters we need to shift the text so we can decrypt it.

This is a Caesar cypher.

'''

crypticText = list(cypheredText)

for letter in crypticText:

asciiValue = ord(letter)

asciiValue += shiftedCypherNumber

newLetter = chr(asciiValue)

print newLetter

This solves the riddle, however some characters are not correctly
decyphered  (a is coming back as {...) and prints the solution like this:
r
e
c
o
m
m
e
n
d
e
d
0

n
o
w

{
p
p
l
y

o
n

t
h
e

u
r
l

 - How can I make this Human readable? ... Print the letters in just one
(or more) lines and maybe replace the  for spaces (This one I suppose it
could/should be done with whitespaces() or just making a loop to check and
change those for ' '.)

Thanks for your time!
-- 

Joaquim Santos

http://js-vfx.com
http://js-vfx.com/
*linkedin*
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Prasad, Ramit
James wrote:
In windows 7,

1. Go to start
2. Right click on Computer
3. Select Properties. This will bring up the System menu.
4. Select Advanced system Settings on the left hand side.
5. In this new window, select Environment variables... at the bottom
6. In the bottom window area, scroll down until you find PATH
7. Select Edit (do NOT delete anything contained in this or will screw some 
stuff up)
8. scroll to the very end and put a ; as a deliminator if there isn't one on 
the end already. Then put the direct path to you Python install you care about. 
(it should be something like this:(;C:\Python27) - this is mine in fact.
9. Hit OK. Then accept your way out. You will have to reboot.
10. To test, open a cmd prompt and and type simply python. if you get Python 
2.7.2 (some more stuff) then python is now on your path.
=
Modify User Variables and not System variables. 
You will need to restart any open command prompt 
but not the full machine.

PATH=%PATH%;c:\python27

That should pick up the system variables 
and then append python's location to it.

http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
 

If that does not work; then feel free to follow
James's advice and then restart.


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Steven D'Aprano

Wayne Watson wrote:

Win 7, 64-bit

I had Py 2.5 installed on my PC earlier this year, and it began failing 
around June. I finally uninstalled it, and tried 2.6.  Still had 
problems that centered around getting to IDLE. Uninstalled 2.6, and went 
to 2.7. Same problem. I completely uninstalled 2.7. I do have several 
folders of py programs. No Python.



Programs should not just begin failing unless somebody (you?) or something 
(a virus, another program?) mess with them. Especially not something as simple 
and stable as Python.


Who installed Python 2.5 in the first place? If it was provided with your 
computer, then it was provided for a reason. Python is not a standard part 
Windows, but a number of PC manufacturers provide Python 2.5 to run their 
tools, and by removing it, you have broken whatever it is that the 
manufacturer tools are supposed to be doing. Installing Python 2.6 or 2.7 will 
probably not work as a replacement.


If you installed Python 2.5 yourself, then it doesn't matter.

However, my guess is that Python 2.5 was installed by the manufacturer, and my 
evidence for this is the error messages that you now see at boot up:



After that episode, I began to notice the following messages when I 
signed on to my PC after a boot. I do not bring my PC down very often.


Specified module could not be found: Loadlib python.dll failed, and 
another of the same for Python25.dll failed (maybe not found).  I did a 
search for both, but neither were found.


Of course they're not found. You uninstalled them.

My first advice: re-install Python 2.5. If you have a recovery disk supplied 
by the manufacturer, try using that. Make sure you install a 64-bit version of 
Python, not 32-bit.


Then do the same with Python 2.7. Make sure it is the 64-bit version. Then 
check that you still have BOTH Python 2.5 and 2.7 installed: look in the start 
menu, and you should see two entries for Python.



I ignored this inconvenience for a few weeks, and had developed a need 
to copy a particular python program on Win 7 to another computer. Call 
it abc.py.  I copied it to a thumb drive, and plugged the drive into the 
other PC, which has Python on it.  abc.py was missing from the drive.  I 
tried this about three times, and even went to yet another PC. No abc.py.


This has *nothing* to do with Python. To Windows, abc.py is just another file, 
like abc.txt or abc.jpg or abc.doc. If copying files to a thumb drive is 
failing (other than by human error, or faulty thumb drive), then you have 
deeper problems with your Windows installation than just missing Python.


But I suspect either human error or a faulty thumb drive. Since I don't use 
Windows 7, and did not see how you tried to copy the file to the thumb drive, 
I can't be sure, but if something as fundamental as copying files was failing, 
then I would expect your Windows machine to be crashing constantly. So more 
likely the thumb drive is failing, or human error.


Can you copy *other* files from the Windows 7 machine onto the thumb drive, 
and then from there to the second computer?



--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson

1. Go to start
2. Right click on Computer
3. Select Properties. This will bring up the System menu.
4. Select Advanced system Settings on the left hand side.
5. In this new window, select Environment variables... at the bottom
6. In the bottom window area, scroll down until you find PATH
7. Select Edit (do NOT delete anything contained in this or will 
screw some stuff up)
8. scroll to the very end and put a ; as a deliminator if there isn't 
one on the end already. Then put the direct path to you Python install 
you care about. (it should be something like this:(;C:\Python27)

I see at the end: Program Files\jEdit;C:\Python25\
There is no Python on my PC. Python 2.5 is what I started with, so I 
guess I should make this:

Program Files\jEdit


- this is mine in fact.
9. Hit OK. Then accept your way out. You will have to reboot.
10. To test, open a cmd prompt and and type simply python. if you 
get Python 2.7.2 (some more stuff) then python is now on your path.


--
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
  Obz Site:  39° 15' 7 N, 121° 2' 32 W, 2700 feet

 CE 1955 October 20 07:53:32.6 UT
-- The Date The mystery unfolds.

Web Page:www.speckledwithstars.net/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-19 Thread Stayvoid
 Please clarify, or expand, or tell us what problem you are having or
 trying to solve.

Hi!

I want to have a possibility to import modules from the folder, which
is not included in the load path.

Example:

module.py
-
def testfunc(name):
  file = open(name)
  return len(file.readlines())

if __name__ == __main__:
  print testfunc(module.py)

Code listing (shell):
python /Users/Username/pythonmodules/module.py

NameError: name 'module.py' is not defined

Kind regards.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson



On 12/19/2011 3:19 PM, Steven D'Aprano wrote:

Wayne Watson wrote:

Win 7, 64-bit

I had Py 2.5 installed on my PC earlier this year, and it began 
failing around June. I finally uninstalled it, and tried 2.6.  Still 
had problems that centered around getting to IDLE. Uninstalled 2.6, 
and went to 2.7. Same problem. I completely uninstalled 2.7. I do 
have several folders of py programs. No Python.



Programs should not just begin failing unless somebody (you?) or 
something (a virus, another program?) mess with them. Especially not 
something as simple and stable as Python.


Who installed Python 2.5 in the first place? If it was provided with 
your computer, then it was 

I did. It worked  for months.
provided for a reason. Python is not a standard part Windows, but a 
number of PC manufacturers provide Python 2.5 to run their tools, and 
by removing it, you have broken whatever it is that the manufacturer 
tools are supposed to be doing. Installing Python 2.6 or 2.7 will 
probably not work as a replacement.


If you installed Python 2.5 yourself, then it doesn't matter.

However, my guess is that Python 2.5 was installed by the 
manufacturer, and my evidence for this is the error messages that you 
now see at boot up:



After that episode, I began to notice the following messages when I 
signed on to my PC after a boot. I do not bring my PC down very often.


Specified module could not be found: Loadlib python.dll failed, and 
another of the same for Python25.dll failed (maybe not found).  I did 
a search for both, but neither were found.


Of course they're not found. You uninstalled them.
I would expect so, but why did it complain specifically about them and 
not others? See PATH comment below.


My first advice: re-install Python 2.5. If you have a recovery disk 
supplied by the manufacturer, try using that. Make sure you install a 
64-bit version of Python, not 32-bit.
I really no longer have a need for 2.5, so I thought I might as well go 
for something newer, which is basically what I'm doing, since 2.5 wasn't 
working.


Then do the same with Python 2.7. Make sure it is the 64-bit version. 
Then check that you still have BOTH Python 2.5 and 2.7 installed: look 
in the start menu, and you should see two entries for Python.


Whoops. Python 2.7.2 is on the menu and was installed 12/18. I thought I 
uninstalled it last night.  It is the 64-bit version. It's beginning to 
look like the PATH is the problem, since I found Python25 at the end of 
the PATH variable, as noted to James above.


I ignored this inconvenience for a few weeks, and had developed a 
need to copy a particular python program on Win 7 to another 
computer. Call it abc.py.  I copied it to a thumb drive, and plugged 
the drive into the other PC, which has Python on it.  abc.py was 
missing from the drive.  I tried this about three times, and even 
went to yet another PC. No abc.py.


This has *nothing* to do with Python. To Windows, abc.py is just 
another file, like abc.txt or abc.jpg or abc.doc. If copying files to 
a thumb drive is failing (other than by human error, or faulty thumb 
drive), then you have deeper problems with your Windows installation 
than just missing Python.


But I suspect either human error or a faulty thumb drive. Since I 
don't use Windows 7, and did not see how you tried to copy the file to 
the thumb drive, I can't be sure, but if something as fundamental as 
copying files was failing, then I would expect your Windows machine to 
be crashing constantly. So more likely the thumb drive is failing, or 
human error.


Can you copy *other* files from the Windows 7 machine onto the thumb 
drive, and then from there to the second computer?
No problem at all copying any other files to the thumb drive.  After I 
get out of this quandary with PATH, and get 2.7.2 working, I'll try to 
recreate the problem.





--
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
  Obz Site:  39° 15' 7 N, 121° 2' 32 W, 2700 feet

 CE 1955 October 20 07:53:32.6 UT
-- The Date The mystery unfolds.

Web Page:www.speckledwithstars.net/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson

The PATH variable for me (user) has c:\Users\Wayne\g95\bin

On 12/19/2011 12:25 PM, Prasad, Ramit wrote:

James wrote:
In windows 7,

1. Go to start
2. Right click on Computer
3. Select Properties. This will bring up the System menu.
4. Select Advanced system Settings on the left hand side.
5. In this new window, select Environment variables... at the bottom
6. In the bottom window area, scroll down until you find PATH
7. Select Edit (do NOT delete anything contained in this or will screw some 
stuff up)
8. scroll to the very end and put a ; as a deliminator if there isn't one on 
the end already. Then put the direct path to you Python install you care about. 
(it should be something like this:(;C:\Python27) - this is mine in fact.
9. Hit OK. Then accept your way out. You will have to reboot.
10. To test, open a cmd prompt and and type simply python. if you get Python 
2.7.2 (some more stuff) then python is now on your path.
=
Modify User Variables and not System variables.
You will need to restart any open command prompt
but not the full machine.

PATH=%PATH%;c:\python27

That should pick up the system variables
and then append python's location to it.

http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx

If that does not work; then feel free to follow
James's advice and then restart.


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.



--
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
  Obz Site:  39° 15' 7 N, 121° 2' 32 W, 2700 feet

 CE 1955 October 20 07:53:32.6 UT
-- The Date The mystery unfolds.

Web Page:www.speckledwithstars.net/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Request for guidance about a python syntax

2011-12-19 Thread Ganesh Borse
Hi,
That's amazing. Thanks for sharing this information.
Regards

On Tue, Dec 20, 2011 at 2:31 AM, Jerry Hill malaclyp...@gmail.com wrote:

 On Mon, Dec 19, 2011 at 12:10 PM, Peter Otten __pete...@web.de wrote:

 Close, but % and * have the same operator precedence. Therefore the
 expression

 %dH % nframes * nchannels

 is evaluated as

 (%dH % nframes) * nchannels


 Thanks Peter, that's exactly correct.  Maybe this will teach me not to
 post things without actually trying them in the interactive interpreter.

 --
 Jerry

 ___
 Tutor maillist  -  Tutor@python.org
 To unsubscribe or change subscription options:
 http://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-19 Thread Dave Angel

On 12/19/2011 08:33 PM, Stayvoid wrote:

Please clarify, or expand, or tell us what problem you are having or
trying to solve.

Hi!

I want to have a possibility to import modules from the folder, which
is not included in the load path.

Example:

module.py
-
def testfunc(name):
   file = open(name)
   return len(file.readlines())

if __name__ == __main__:
   print testfunc(module.py)

Code listing (shell):
python /Users/Username/pythonmodules/module.py

NameError: name 'module.py' is not defined

Kind regards.


First rule:  include the complete error message, including the traceback.

Also, make sure you copy/paste the message, not paraphrase or retype it.

Anyway, chances are the error occurs because you didn't have any quotes 
around the filename.  Python is forced to look up the name module in 
the global dictionary, and it can't find it.  Of course, the error 
message wouldn't be exactly that.



--

DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Dave Angel

On 12/19/2011 08:47 PM, Wayne Watson wrote:

The PATH variable for me (user) has c:\Users\Wayne\g95\bin



By top-posting, you've ruined the whole continuity of what you quoted.

Anyway, with a PATH like that, you won't be able to type Python at a 
command prompt.  It works much better if it's on the path.



--

DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson
It became apparent during the other part of this thread that I had not 
uninstalled Python 2.7, as I thought I had.  As pointed out in the PATH 
discussion (James R.), the last item in the system variable PATH was 
Python25. I would think then changing it to Python27 might Python 
rolling again.


--
   Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

 (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
  Obz Site:  39° 15' 7 N, 121° 2' 32 W, 2700 feet

 CE 1955 October 20 07:53:32.6 UT
-- The Date The mystery unfolds.

Web Page:www.speckledwithstars.net/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor