FYI - wiki.python.org compromised

2013-01-07 Thread Brian Curtin
On December 28th, an unknown attacker used a previously unknown remote
code exploit on http://wiki.python.org/. The attacker was able to get
shell access as the "moin" user, but no other services were affected.

Some time later, the attacker deleted all files owned by the "moin"
user, including all instance data for both the Python and Jython
wikis. The attack also had full access to all MoinMoin user data on
all wikis. In light of this, the Python Software Foundation encourages
all wiki users to change their password on other sites if the same one
is in use elsewhere. We apologize for the inconvenience and will post
further news as we bring the new and improved wiki.python.org online.

If you have any questions about this incident please contact
jnol...@python.org. Thank you for your patience.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Has anyone seen any updated versions of pywapi? (Python Weather API)

2011-06-05 Thread Brian Curtin
On Sun, Jun 5, 2011 at 19:27, Benjamin Schollnick <
bscholln...@schollnick.net> wrote:

> The Google Code site is at http://code.google.com/p/python-weather-api/
>
> And it's powerful, but I don't see any updates since late 2010...  Does
> anyone know of a different pre-built API for accessing weather information?
>

Why does it matter if it hasn't been modified in ~6 months?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread Brian Curtin
2011/7/7 António Rocha 

> Greetings
>
> I'm running Python (32b) in Windows7 (at 64bits) and I would like to know
> how can I check if my machine is a 32b or 64b in Python. Is it possible? I
> saw a few examples (like platform) but they only provide information about
> Python not the machine.
> Thanks
> Toze
>

Running CPython compiled for 32-bit on a Windows 7 64-bit machine gives the
following:

>>> platform.architecture()
('32bit', 'WindowsPE')
>>> platform.machine()
'AMD64'

This didn't used to be the case - it was corrected in
http://bugs.python.org/issue7860 so you may need to upgrade to get accurate
information if you have an older Python installed.
-- 
http://mail.python.org/mailman/listinfo/python-list


PyCon US 2012 Survey - We need your input!

2011-08-08 Thread Brian Curtin
Hi all,

As we ramp up our efforts on PyCon US 2012, we wanted to gather some
information from the community on what we can do best to serve you at the
March 2012 conference in Santa Clara, CA. We've put together a survey about
your experiences at past PyCons as well as what your interests are in the
upcoming conference. We're interested in what speakers and topics you'd like
to have at the tutorials, conference, and the poster sessions, as well as
any input you have on what we can improve in other aspects of the event.

If you have 5 minutes to spare, the survey is available at
https://www.surveymonkey.com/s/pycon2012_launch_survey and results will be
used to help us make PyCon 2012 the best conference yet.

Thanks,

The PyCon Organizers
http://us.pycon.org/2012/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to build python using visual studio 2005?

2011-08-18 Thread Brian Curtin
On Wed, Aug 17, 2011 at 13:16, smith jack  wrote:

> anybody here have build it correctly?
> how to make a msi file just as the official site did?
> is there any detailed tutorial online?


We're currently shipping CPython built on VS 2008, but I do know of people
building with 2005. How they do it, I'm not entirely sure, but all of the
related files are available -- see the PC folder for previous versions of
project and solution files.

As for making the MSI, from a source checkout, the Tools/msi/msi.py script
is how its generated, but there isn't currently any documentation or
tutorial. What I'd do is start by running that script, then piece together
what you're missing in order to get it working. You'll need a built Python
including the third-party things like tkinter in order for it to work. I
know it needs pywin32, but I can't remember anything else I needed off the
top of my head, but I have gotten it to work before.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Tools for Visual Studio - anyone using it?

2011-08-31 Thread Brian Curtin
On Wed, Aug 31, 2011 at 14:29, Andrew McLean  wrote:

> I understand that Python Tools for Visual Studio doesn't work with VS
> Express, but does work with the (free) VS 2010 Shell. Does anyone know if
> you can install VS Express and VS Shell on the same machine?


Yes, because the shell and Express work together.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Dump interpreter history?

2011-03-25 Thread Brian Curtin
On Fri, Mar 25, 2011 at 16:03, Ken D'Ambrosio  wrote:

> Hey, all.  A co-worker asked me a question, and I've got no idea how (or
> if) it can be done.  Bottom line: he'd like to save off the text from an
> interpreter session, his thinking being that you've already tried to get
> what you want, and now you just need to gussy it up in an editor.
>
> Can this be done?
>
> Thanks!
>
> -Ken


If readline is available, this might be a helpful start:
http://my.opera.com/alecmg/blog/2007/03/30/add-history-and-completion-to-python-in
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: who moved reload?

2011-04-07 Thread Brian Curtin
On Thu, Apr 7, 2011 at 00:45, harrismh777  wrote:

> All right...  somebody is sacked (er, fired) !
>
> Who moved reload()?
>
> This kinda stuff is driving me bonkers... there was no need to move
> reload() anyplace...
>
> ... so for those of you who haven't found out yet, if you want to reload a
> module in 3.x you have to import reload() first from module 'imp' ... now
> that is just plain wrong.  :-}
>
>
> import mymod
>
> from imp import reload
> reload(mymod)<<= now reload() will work.
>
>
>
> Somebody out there thinks this is funny, right?
>
> >>> reload(mymod)
> Traceback (most recent call last):
>  File "", line 1, in 
>reload(mymod)
> NameError: name 'reload' is not defined  ???
> >>>


http://docs.pythonsprints.com/python3_porting/py-porting.html#organizational-changes
might
help you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: windows 7 x64 shutdown

2011-04-29 Thread Brian Curtin
On Mon, Apr 25, 2011 at 16:15, rjmccorkle  wrote:

> does anyone know a solution to shutting down windows 7 x64 via python
> script?  the win32 obviously doesn't work... something similar?
>
> "the win32 obviously doesn't work" -- It does.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing 2.6 on Win 7

2011-09-09 Thread Brian Curtin
On Fri, Sep 9, 2011 at 15:04, ray  wrote:
>
> I have not found binaries for this install.  The page
> http://www.python.org/download/windows/
> takes me to
> http://www.python.org/download/releases/
> which goes to
> http://www.python.org/download/releases/2.6.7/
> Here are Gzip and Bzip tar balls.  The readme files describe linux
> builds and the content seems to match.
>
> Are there win binaries or source files?

As stated at the top of that page...
"""Python 2.6.7 is a security-fix only source release for Python
2.6.6, fixing several reported security issues. Python 2.6.7 was
released on June 3, 2011."""

If you work backwards, http://www.python.org/download/releases/2.6.6/
is the last version binaries were created for.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python bug in Windows 8--report now, or later?

2011-09-19 Thread Brian Curtin
On Sat, Sep 17, 2011 at 13:01, Kevin Walzer  wrote:
> I have been testing my Python application on the just-released developer
> preview of Windows 8 and have noted an error: the application does not
> create an app folder in the user's "application data" directory. This causes
> the app to crash on startup. Manually creating the directory solves the
> problem. Since the app uses an os.mkdir() call to create the directory, and
> since the app runs fine on Windows 7, my guess is that the bug lies
> somewhere in the interaction between Python (I'm using ActivePython 2.7) and
> Windows.
>
> Here's the relevant code:
>
>    #make preferences directory if it does not exist
>    def makePrefsDir(self):
>        self.appdir = os.path.join(os.path.join(os.environ['APPDATA'],
> 'MyApp'))
>        if not os.path.exists(self.appdir):
>            os.mkdir(self.appdir)
>
> I realize that this developer preview of Windows is still at somewhere
> between alpha- and beta-level, and it's possible things will get better.
> Should I wait to report this as a bug until Windows 8 is released, or do the
> Python developers test Python on pre-release versions of Windows?

First, is your application actually crashing, or does it just exit due
to an unhandled exception? I suspect the latter, so if that's true,
what's the exception and message?

You said "the application does not create an app folder in the user's
'application data' directory" -- what does this mean, or rather, what
is the specific folder you're expecting to have? If Python can't
create the directory but you can do it manually, there may be some
permission or access differences new to Windows 8. What does "echo
%APPDATA%" give you?

I haven't installed Windows 8 yet, but I'm planning to get it up and
running soon. If you submit issues to http://bugs.python.org,
hopefully with specific test cases that we can run and work with,
it'll be easier to track and fix. If you do that, add me to the nosy
list on the issues - tracker id: brian.curtin, I'm one of the Windows
people around there.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyWin build 216

2011-09-23 Thread Brian Curtin
On Fri, Sep 23, 2011 at 09:25, python  wrote:
> I have used pyWin for several years now with out issue.   I recently
> installed build 216 for python 2.7 on windows XP pro.   The program
> crashes every time I exit a wxPython program and has crashed a few
> other times.  I does not seem that pyWin has been updated since
> February of this year.   Is there a direction change for the windows
> extensions?  Is it time I make the move to 3.x?  Mark Hammond has
> given much to the Python community and I do not intend for this post
> to be negative in any way.

pywin32 has been available for 3.x for some time, but you wouldn't be
able to use it since you're currently using wxPython.

You may want to post a more detailed question to
http://mail.python.org/mailman/listinfo/python-win32 -- Mark hangs out
there and there are plenty of pywin32 experts around who could help as
well.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Brian Curtin
On Tue, Sep 27, 2011 at 15:54, Wanderer  wrote:
> How do I install Python 2.6.7 on Windows? The Python 2.6.6 page says
>
> "Python 2.6.6 has been replaced by a newer security-fix only source
> release of Python. Please download Python 2.6.7 instead."
>
> But there is no windows installer on the 2.6.7 page. Do I install
> 2.6.6 first and then update to 2.6.7?

As the text states, 2.6.7 is only a source code release. 2.6.6 is the
last binary package available, but if you need what's in 2.6.7, you
will have to compile the source yourself.

Alternatively, you could upgrade to 2.7 as 2.6 will continue to only
receive security fixes, or as Arnaud states, you could use an
alternative distribution to get 2.6.6.
-- 
http://mail.python.org/mailman/listinfo/python-list


PyCon 2012 Proposals Due October 12

2011-09-27 Thread Brian Curtin
The deadline for PyCon 2012 tutorial, talk, and poster proposals is
under 15 days away, so be sure to get your submissions in by October
12, 2011. Whether you’re a first-timer or an experienced veteran,
PyCon is depends on you, the community, coming together to build the
best conference schedule possible. Our
call for proposals (http://us.pycon.org/2012/cfp/) lays out the
details it takes to be included in the lineup for the conference in
Santa Clara, CA on March 7-15, 2012.

If you’re unsure of what to write about, our recent survey yielded a
large list of potential talk topics
(http://pycon.blogspot.com/2011/09/need-talk-ideas.html), and plenty
of ideas for tutorials (INSERT TUTORIAL POST). We’ve also come up with
general tips on proposal writing at
http://pycon.blogspot.com/2011/08/writing-good-proposal.html to ensure
everyone has the most complete proposal when it comes time for review.
As always, the program committee wants to put together an incredible
conference, so they’ll be working with submitters to fine tune
proposal details and help you produce the best submissions.

We’ve had plenty of great news to share since we first announced the
call for proposals. Paul Graham of Y Combinator was recently announced
as a keynote speaker
(http://pycon.blogspot.com/2011/09/announcing-first-pycon-2012-keynote.html),
making his return after a 2003 keynote. David Beazley, famous for his
mind-blowing talks on CPython’s Global Interpreter Lock, was added to
the plenary talk series
(http://pycon.blogspot.com/2011/09/announcing-first-pycon-2012-plenary.html).
Sponsors can now list their job openings on the “Job Fair” section of
the PyCon site 
(http://pycon.blogspot.com/2011/09/announcing-pycon-2012-fair-page-sponsor.html).
We’re hard at work to bring you the best conference yet, so stay tuned
to PyCon news at http://pycon.blogspot.com/ and on Twitter at
https://twitter.com/#!/pycon.

We recently eclipsed last year’s sponsorship count of 40 and are
currently at a record 52 organizations supporting PyCon. If you or
your organization are interested in sponsoring PyCon, we’d love to
hear from you, so check out our sponsorship page
(http://us.pycon.org/2012/sponsors/).

A quick thanks to all of our awesome PyCon 2012 Sponsors:

- Diamond Level: Google and Dropbox.
- Platinum Level: New Relic, SurveyMonkey, Microsoft, Eventbrite,
Nasuni and Gondor.io
- Gold Level: Walt Disney Animation Studios, CCP Games, Linode,
Enthought, Canonical, Dotcloud, Loggly, Revsys, ZeOmega, Bitly,
ActiveState, JetBrains, Caktus, Disqus, Spotify, Snoball, Evite, and
PlaidCloud
- Silver Level: Imaginary Landscape, WiserTogether, Net-ng, Olark, AG
Interactive, Bitbucket, Open Bastion, 10Gen, gocept, Lex Machina,
fwix, github, toast driven, Aarki, Threadless, Cox Media, myYearBook,
Accense Technology, Wingware, FreshBooks, and BigDoor
- Lanyard: Dreamhost
- Sprints: Reddit
- FLOSS: OSU/OSL, OpenHatch


The PyCon Organizers - http://us.pycon.org/2012
Jesse Noller - Chairman - jnol...@python.org
Brian Curtin - Publicity Coordinator - br...@python.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Brian Curtin
On Tue, Sep 27, 2011 at 16:32, Wanderer  wrote:

> I think it is strange to release a security update but not really expect
> people
> to use it.


We expect that people who need 2.6 but won't move to 2.7, and at the same
time are vulnerable to the security issue(s), would be able to compile
Python for themselves. Shortly after 2.7 was released, 2.6 went into
security-fix mode, and that's true of any X.Y and X.Y-1 pair.

For a look at how busy the release schedule has been at times, I wrote about
all of the releases we were up to in June at
http://blog.python.org/2011/06/june-releases-267-272-314.html. Consider the
fact that the person creating the installer usually creates at least three
installers for any release (usually two candidates, and the final - add in
alphas for a new X.Y), for each branch, of which three branches were having
binary installers produced.

For the specifics on the 2.6.7 fix,
http://blog.python.org/2011/04/urllib-security-vulnerability-fixed.html covers
it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing Python 2.6.7 on Windows

2011-09-29 Thread Brian Curtin
On Wed, Sep 28, 2011 at 19:10, Nobody  wrote:

> On Wed, 28 Sep 2011 15:21:25 -0700, Ned Deily wrote:
>
> > No, it was a deliberate decision.  After a release is in security-fix
> > mode only, we don't build Windows or Mac OS X installers for them.
>
> But you continue to offer the installers for the unfixed version.


No one would use Python if we literally forced everyone to upgrade based on
our schedule by removing any trace of previous installers.

Also, "unfixed" is relative. You're only vulnerable if you're using urllib
to request resources which may end up being 302 redirected. I personally
don't need that fix, so 2.6.6 would be alright with me.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: L.A. user group?

2011-10-06 Thread Brian Curtin
On Thu, Oct 6, 2011 at 12:24, Miki Tebeka  wrote:
> Greetings,
>
> Is there an L.A. Python user group out there?

http://socal-piggies.org might work for you. They recently had a
meeting in Santa Monica, and I believe many of the members are LA
based.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I get curses to work in Python 3.2 on win-64?

2011-10-17 Thread Brian Curtin
On Sun, Oct 16, 2011 at 11:16, Jan Sundström  wrote:
> On 16 Okt, 06:59, Christoph Gohlke  wrote:
>> On Oct 15, 1:13 pm, Jan Sundström  wrote:
>>
>>
>>
>> `import curses` should work. What exactly is the error message? Does
>> `import curses` work outside your program/program directory?
>>
>> The curses package is part of the standard library and usually
>> installed in Python32\Lib\curses. On Windows the  _curses.pyd files is
>> missing in the standard distribution. curses-2.2.win-amd64-py3.2.exe
>> installs the missing _curses.pyd file into Lib/site-packages.
>
> Thanks for the tip to check in what library it works, that set me on
> track tofind a silly mistake that I had done. Now everything works
> fine.
>
> But, how come that the Windows distribution for Python doesn't include
> the _curses.pyd file?

It's not a standard library module on Windows. The curses Christoph
mentioned is built on the PDCurses library, which is an external
project.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: C API: Making a context manager

2011-10-31 Thread Brian Curtin
On Mon, Oct 31, 2011 at 13:34, Chris Kaynor  wrote:
> I am currently rewritting a class using the Python C API to improve
> performance of it, however I have not been able to find any
> documentation about how to make a context manager using the C API.
>
> The code I am working to produce is the following (its a method of a class):
>
> @contextlib.contextmanager
> def connected(self, *args, **kwargs):
>        connection = self.connect(*args, **kwargs)
>        try:
>                yield
>        finally:
>                connection.disconnect()
>
> For this, my first question is: is there any built-in method to make
> this type of method in the C API? If not, is there a slot on the type
> object I am missing for __enter__ and __exit__, or should just be
> defined using the PyMethodDef struct on the class (presumably named
> the same as the Python functions)?

You'd just add "__enter__" and "__exit__" in the PyMethodDef. If you
have the CPython source, we do it in there in a few places. Off the
top of my head, PC\winreg.c contains at least one class that works as
a context manager (PyHKEY), although there are a few others scattered
around the source.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Does anyone use Python Tools for visual studio?

2011-11-01 Thread Brian Curtin
On Tue, Nov 1, 2011 at 11:57, Wei  wrote:
> I got several buggy things going on.
> First, the view of class tree stops expanding after creating more than
> two classes.
> Second, after 800 lines of code the classes and methods can't be
> folded. (meaning the + sign is gone)
> P.S. there is no warning or errors in my code.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Yes, I use it. If you're having issues with it, you should report them
at http://pytools.codeplex.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Install Python on Windows without Start Menu icons?

2011-12-05 Thread Brian Curtin
On Fri, Dec 2, 2011 at 12:34, snorble  wrote:

> Is it possible to automate the Python installation on Windows using
> the MSI file so it does not add a Start Menu folder? I would like to
> push out Python to all of my office workstations, but I'd like for it
> to be relatively silent from the user's point of view.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

http://www.python.org/getit/releases/2.4/msi/ outlines some of the MSI
command line features, but I don't see the option to not add the Start Menu
folder.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyCon US 2012 sprints

2011-12-18 Thread Brian Curtin
2011/12/17 Ricardo Bánffy :
> Hi folks.
>
> Next March I'm planning to attend PyCon US (for the first time) and
> stay for the sprints. I am not sure how they work, however. Are there
> any "first-timer guide to PyCon sprints"?

I don't know of any such guide, but here's what usually happens:

1. Right after the closing of the conference days on Sunday, late in
the afternoon, there will be a chance for all projects who plan to
host sprints to get on stage and talk for a minute about who they are,
what their project is, and what they'll be sprinting on. You might
hear something like this: "Hi I'm Brian and I'll be hosting a sprint
on foo project. We're going to be working on x, y, and z functionality
using a lot of a, b, and c libraries. Come check it out of you're
interested. We've got plenty of stuff for first timers"
2. At the entrance to wherever the sprints will be there will be a
board listing what projects are sprinting in what areas. The last few
years we've taken over numerous rooms, so that board acted as a map to
know what was going on in what room.
3. I don't yet know how the sprints will be laid out this year since
it's a new hotel and location, but if its anything like last year,
each room will have several projects working inside it. It's quite
normal to just walk in and say "hey where's the blah blah sprint at?",
then see they're over in the corner. Everyone has been really friendly
in my experience, and a lot of people bounce back and forth between
rooms for a lot of reasons, so ask if you don't know where you're
going or who you're looking for.
4. Hack on some fun stuff and meet some new people.

It's a bit early for the 2012 sprint page to be up and populated, but
it'll happen soon enough. The 2011 page is here
(http://us.pycon.org/2011/sprints/) and the list of some (but not all)
of the sprints and their attendees here:
http://us.pycon.org/2011/sprints/projects/

It's really relaxed and a lot of fun. It's one of my favorite parts of
the PyCon experience.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting a patch accepted

2011-12-19 Thread Brian Curtin
On 19-12-11 18:13, Tycho Andersen wrote:
>
> Hi all,
>
> A couple months ago I found a bug in a corner of the curses library
> (http://bugs.python.org/issue13051) and filed it. Unfortunately, there
> was nobody listed to cc on the noisy list, so it probably got lost in
> the shuffle. (There is even previous mention of this bug elsewhere on
> the tracker, and on stackoverflow, so it does affect some small number
> of people.)
>
> Is there anyone else I can bother to get this patch applied?

Part of the issue with this taking a while is that there's no one on
the committer side of things that deals with curses.

For one thing, I see that the patch has no tests, so you might want to
add unit tests to ensure that your changes don't break anything else.
I left a comment saying that on the issue, so I'll get any updates you
make and can look at them.

Rick Johnson's response is, as always, pure trolling. I'd suggest you
ignore him.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: the slash & Windows paths

2011-12-19 Thread Brian Curtin
On Mon, Dec 19, 2011 at 16:02, Juan Declet-Barreto <
juan.declet-barr...@mesaaz.gov> wrote:

> All,
>
> ** **
>
> I have a Windows-style path that I need to modify so Python functions can
> find it. For example, the path
> “C:\Projects\Population_Pyramids\charts\test.xls” is being interpreted as
> pointing to a file called “est.xls” since the “t” is being escaped by the
> preceding slash as a tab. 
>
> ** **
>
> I know this is straightforward to handle using raw literals by prefixing
> the literal with an ‘r’, but my path is stored in a variable. 
>
> ** **
>
> My questions are: 1. How do I prevent single slashes from being escaped in
> a string variable (NOT literal)? 
>
>   2. Is it possible to do a
> string.replace to substitute all instances of ‘\’ for ‘\\’? I tried this
> but it did not give me the desired result.
>

Use os.path.normpath(your_path).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to install lxml in window xp?

2012-01-11 Thread Brian Curtin
On Wed, Jan 11, 2012 at 23:01, Tamer Higazi  wrote:
> Use Linux!
> Specially Gentoo Linux!

Not a useful answer.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to remove ellipses from long paths in traceback?

2012-01-12 Thread Brian Curtin
On Thu, Jan 12, 2012 at 22:34, Jason Veldicott  wrote:
> Hi,
>
> Long paths in python traceback are contracted with ellipses.  eg:
>   TclError: couldn't load library "C:/Python26/tcl/tk8.5/../../bin/tk85.dll"
>
> Is there any way to see the full path?
>
> Surprisingly, search didn't reveal an answer to this question.
>
> Thanks
>
> Jason

Is this tcl/tk specific or have you seen it in other places? Either
way, you may want to submit a report to http://bugs.python.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: _winreg error on open key (64bit) - proper usage of _winreg.DisableReflectionKey

2009-11-18 Thread Brian Curtin
On Tue, Nov 17, 2009 at 19:59, Mark Hammond wrote:

> On 18/11/2009 6:29 AM, Randall Walls wrote:
>
>> I don't believe so, but it seems like I'm in a catch 22, where I need to
>> _winreg.OpenKey the key first before I can pass it to
>> _winreg.DisableReflectionKey, but it doesn't exist, so I can't open it.
>>
>> I did find out that I can open the key using:
>> hKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
>> r"SOFTWARE\ODBC\ODBC.INI\
>> DRSQL2000_mu0100\\", 0, _winreg.KEY_READ | _winreg.KEY_WOW64_64KEY)
>>
>> The 'trick' was adding _winreg.KEY_WOW64_64KEY, which apparently tells
>> the system to look in the 64bit key area, and not under the Wow6432Node.
>> That brings up problem #2, though... I can't seem to CREATE a key in the
>> above path, and _winreg.CreateKey doesn't accept _winreg.KEY_WOW64_64KEY
>> (in fact it doesn't accept any options other than key, sub_key).
>> _winreg.CreateKey does work, it just puts the key in
>> SOFTWARE\Wow6432Node\ODBC\ODBC.INI. So I'm in a quandry... I'd like to
>> use one or the other, and not have to account for both.
>>
>
> It looks like _winreg needs to be enhanced to make the RegCreateKeyEx API
> function available.  It can be called via the win32api module of pywin32, or
> could also be called via ctypes.
>
> HTH,
>
> Mark
>

Created http://bugs.python.org/issue7347 and added a patch which I think
will solve the problem moving forward.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to use python to register a service (an existing .exe file)

2010-02-15 Thread Brian Curtin
On Mon, Feb 15, 2010 at 18:10, News123  wrote:

> Hi,
>
> Is there a python way to register new windows services.
>
>
> I am aware of the
> instsrv.exe program, which can be used to install services.
> I could use subprocess.Popen to call
>
>
> instsrv.exe "service_name" program.exe
>
>
> but wondered, whether there's already an existing function.
>
> Thans in advance and bye
>
>
> N 
>
There is nothing like that in the stdlib, so calling instserv via Popen may
be your best bet.

"sc create" may also be helpful to you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: listing existing windows services with python

2010-02-15 Thread Brian Curtin
On Mon, Feb 15, 2010 at 18:17, Alf P. Steinbach  wrote:

> * News123:
>
>  Hi,
>>
>>
>> What is the best way with python to get a list of all windows services.
>>
>> As a start I would be glad to receive only the service names.
>>
>> However it would be nicer if I could get all the properties of a service
>> as well.
>>
>> Thanks for any info and bye
>>
>
>
> * Registry functions:
>
>  Otherwise, I'd use the general registry access functions.
>
>  Info about the registry access functions is available in your Python docs.
>
>  All the information about services is in the Windows registry (documented
> in
>  the MSDN Library, which is available in a browsable on-line version at
>  Microsoft).
>

As for doing this via the registry, take a look at the EnumKey and EnumValue
functions of the winreg module (_winreg in 2.x).
HKLM\System\CurrentControlSet\Services contains service information, and
iterating over that should get a lot of what's needed.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: __pycache__, one more good reason to stck with Python 2?

2011-01-17 Thread Brian Curtin
On Mon, Jan 17, 2011 at 08:31, jmfauth  wrote:

> As a scientist using computer tools, and not as a computer
> scientist, I discovered Python long time ago (it was in its
> 1.5.6 version) and I remain an happy user up to now date.
> Yesterday, I was happy to download and test Python 3.2rc1.
> Python is still this powerful and pleasant language, but...
>
> I fall on this cached pyc's directory, __pycache__. Without
> to many explanations (I think they will be obvious for an
> end user), one word: a nithtmare.


What are the specific problems you've seen with __pycache__? Have you read
PEP 3147 [0], at least through the rationale section?

[0] http://www.python.org/dev/peps/pep-3147/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: move to end, in Python 3.2 Really?

2011-01-18 Thread Brian Curtin
On Tue, Jan 18, 2011 at 12:33, rantingrick  wrote:

>
> On Jan 18, 11:56 am, Antoine Pitrou  wrote:
> > On Tue, 18 Jan 2011 09:10:48 -0800 (PST)
> >
> > rantingrick  wrote:
> >
> > > Well don't get wrong i want to join in --not that i have all the
> > > solutions--
> >
> > Take a look athttp://docs.python.org/devguide/#contributing
>
> Thanks for this link Antoine however i think you missed the point of
> my post. What i would like to see is an forum where the "noob" to
> "average" python programmer can voice his/her opinion about the
> current state or future state of Pythons syntax, stdlib, goals and
> dreams, etc, al the while not fearing attack from all sides. Currently
> such a place is non-existent. I believe many folks would get involved
> if this "place" existed however it does not exist.


I'm unaware of "attack from all sides" on python-dev, but the standards are
high, as they should be. The discussion is open to everyone, but it's not
generally about opinions, goals, dreams, etc. -- it's mostly about getting
work done.

python-ideas might be a list that would work for what you are looking for.
It's a list of possible ideas to implement in Python. Some are half-baked
ideas needing community help and input, some are fully thought out
implementations asking if the community thinks it's worthy of inclusion.

I'm not sure why this list, python-list, isn't a good venue for any of that.
A lot of the people who follow python-dev also follow this list, e.g.,
Raymond and Antoine who already commented on this.

I also believe that
> these same folks have no interest in "debating" in the highly
> competitive environmental of python-dev, python-ideas. Heck, even
> c.l.py is far too competitive! They just basically want a forum were
> they can come in and give their two cents and leave.
>

Sorry, it's not that easy, for good reason. We're talking about a
programming language that has been around for quite a while, is used in many
places for many reasons by many people, and the numbers surrounding just
about every category are always rising. We're also talking about a group of
volunteers who spend their time working on Python. Drive-by commenting
likely serves little purpose other than noise.

If you want to bring something up, by all means bring it up, but you will
probably have to fight for it. We can't just have everyone throw two cent
suggestions in a hat and move along.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: move to end, in Python 3.2 Really?

2011-01-18 Thread Brian Curtin
On Tue, Jan 18, 2011 at 13:22, rantingrick  wrote:

>
> Thanks for offering a suggestion it was very welcome however i need to
> emphasize that what i am proposing is sort of "community discussion
> suggestion box". Like a "Python Suggestions" group or something. Where
> any and all suggestions, rants, complaints, ideas, etc, are welcome
> from anyone without fear of reprisals.


What is it with all of this talk of fear? Is there some group of people who
were shamed out of python-dev that I wasn't aware of? It's not a hostile
mailing list, and I'm not sure why you keep saying that it is...

I understand maybe I don't feel that way because I've been reading it for a
while, but even thinking back to when I was new around there, I never felt
any amount of fear. Sure, I've talked to people who had things shot down and
they took it harshly, but they realized it was just part of the game and it
wasn't personal and they weren't kicked out of the group or anything.
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2011-01-19 Thread Brian Curtin
On Wed, Jan 19, 2011 at 18:53, rantingrick  wrote:

> Without the car the driver is
> nothing, and without the driver the car is nothing. But together, they
> are a force to reckoned with. Well, unless the driver is Asian -- then
> all bets are off! :-)


Welcome to the auto-deletion filter.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Finding the right Python executable on Windows

2011-01-25 Thread Brian Curtin
On Tue, Jan 25, 2011 at 04:25, Geoff Bache  wrote:

> Hi all,
>
> I have a Python process on Windows and would like to start a Python
> subprocess using the same interpreter. I wonder how to go about this?
>
> First, I tried the obvious
>
> subprocess.Popen([ sys.executable, "subproc.py", ... ])
>
> but that fails, because my process has a "native launcher", (i.e. C:
> \path\mylauncher.exe, which is just a wrapper around the Python
> program) and hence sys.executable returns this path instead of the
> interpreter location. It isn't appropriate to use the launcher for the
> subprocess.
>
> I also tried using sys.exec_prefix but there didn't seem to be any
> standard location for the interpreter under this directory in any
> case.
>
> I feel certain there must be some way to do this as it seems a rather
> basic thing somehow, can anyone give me a hint?
>
> Regards,
> Geoff Bache


If sys.executable doesn't work due to this "native launcher", you
could try something
like this:

>>> import os
>>> import sys
>>> full_path = None
>>> for path in sys.path:
... full = os.path.join(path, "python.exe")
... if os.path.exists(full):
... full_path = full
...
>>> full_path
'c:\\python31\\python.exe'
-- 
http://mail.python.org/mailman/listinfo/python-list


PSF Sprints - Call For Applications

2011-01-27 Thread Brian Curtin
Hello Python Users!

On behalf of the Python Software Foundation’s sponsored sprint group, I
wanted to drop your group a quick note introducing us. If you’re already
familiar with our sponsored sprints, you’ll be happy to know we made a few
changes to help both sprint groups and Python even more.

The PSF recently set aside funding to be distributed to groups who spend
time contributing to the Python ecosystem, often in the form of development
sprints. Our goal is to help you help Python, so whether it’s buying meals
or renting meeting space for your all-day hackathon, we have a budget set
aside to reimburse your expenses up to $300 USD (up from $250).
If your goal is to make the Python world a better place, and you work on the
problems facing Python today, we want to help you. We’re looking for groups
of hackers that spend their time fixing and expanding the wide variety of
Python interpreters, libraries, tools, and anything else affecting the
community.We’re also looking for groups who want to help and get started but
don’t have the resources to get together. Whether your group is separated by
a train ride or lacking a shared space, we want to help you. On-boarding new
contributors to open source Python projects is an especially important area
that we’d like to work with.This means if you have a Python project and you
want to sprint -- we want to help you.Some sprints we’ve sponsored include
the porting of Genshi to Python 3, improvements to packaging
(Distribute/distutils), and most recently, the PyPy winter sprint in
Switzerland.

If your group is interested in hosting a sprint, check out the full details
of our call for applications at http://www.pythonsprints.com/cfa/ and
contact us at spri...@python.org.

Thanks for your time, and happy sprinting!

Brian Curtin
Jesse Noller
http://www.pythonsprints.com/ <http://pythonsprints.com/>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Idea for removing the GIL...

2011-02-08 Thread Brian Curtin
On Tue, Feb 8, 2011 at 06:34, Vishal  wrote:

> Also, multiprocessing has issues on Windows (most probably because of
> the way CreateProcess() functions...)


Such as?
-- 
http://mail.python.org/mailman/listinfo/python-list


PyCon 2011 news - going strong, sign up today!

2011-02-09 Thread Brian Curtin
Hey python-list readers!

PyCon 2011 looks like it may very well break every single record in the past
-
making it one of the biggest and best PyCons of all time. We've gone all out
this year - including Extreme Talks, a Startup Row, amazing talks,
tutorials,
Poster sessions.

Extreme talks:
http://us.pycon.org/2011/speaker/extreme/
Startup Row:
http://us.pycon.org/2011/blog/2011/01/19/announcing-startup-row-pycon-2011/

Also just announced - "Startup Stories":
http://us.pycon.org/2011/blog/2011/02/07/pycon-2011-announcing-startup-stories/

If you haven't bought your PyCon tickets, it's time to do so. This year
we're
limited to 1500 attendees, and with a faster than average sales rate
compared
to previous years, you may not have the luxury of leaving registration until
just before the conference -- places may sell out in advance! Check out
http://us.pycon.org/2011/tickets/ for rates and details.

Not sold on the conference? Not sure what it's all about? We are confident
this
year's conference will surpass anything that has gone before, and we think
there's something for everyone.

Looking for education? This year's tutorial selection features a range of
topics and an all-star cast of presenters. From the cloud to the GUI, from
beginner to advanced, we have it. Check out courses taught by book authors
Wesley Chun and David Beazley, web framework master Jacob Kaplan-Moss, core
developer and guru Raymond Hettinger, hacker extraordinaire Zed Shaw and
many
more: http://us.pycon.org/2011/schedule/tutorials/ -- and at flat fees that
wouldn't buy you an hour of training by less-qualified instructors
elsewhere!

The conference talks are some of the best we've seen in years, coming from a
record number of submissions. We've got talks on using Python for airplane
tuning and massive telescopes. All of the major web frameworks will be
discussed. Numerous databases are covered. PyPy, IronPython and Jython are
in.
We'll be talking about IDEs, testing, security, scalability, and
documentation.
Have a look: http://us.pycon.org/2011/schedule/lists/talks/

We've also got an amazing array of poster presentations - everything from
Arduino hacking, Geospatial Python, Open Government and Microsoft Kinect
hacking. Check out: http://us.pycon.org/2011/schedule/lists/posters/

Meanwhile we've got the awesome sprints  (http://us.pycon.org/2011/sprints/
),
and open spaces (http://us.pycon.org/2011/openspaces/) everyone knows and
loves.

This is shaping up to be the best PyCon yet, and we think it's a great
value,
both cost-wise, and community-wise. We can guarantee that you'll come away
with
a head full of knowledge and amazing new friends and contacts.

Get your tickets before they are gone: http://us.pycon.org/2011/tickets/

If you have any questions, comments or concerns - feel free to email Van
Lindberg (v...@python.org) or Jesse Noller (jnol...@python.org) or
pycon-organizers (pycon-organiz...@python.org).

See you in Atlanta,

Van Lindberg
Jesse Noller
The entire PyCon 2011 team
http://us.pycon.org/2011
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: logging module -- better timestamp accuracy on Windows

2011-02-16 Thread Brian Curtin
On Wed, Feb 16, 2011 at 09:34, sturlamolden  wrote:

> On 16 Feb, 15:30, benhoyt  wrote:
>
> > It seems to me that the logging module should use a millisecond-accurate
> timestamp (time.clock) on Windows, just like the "timeit" module does.
>
> AFAIK, the Windows performance counter has long-term accuracy issues,
> so neither is perfect. Preferably we should have a timer with the long-
> term accuracy of time.time and the short-term accuracy of time.clock.
>
> Sturla


I just uploaded a timer extension I wrote a while back which tries to solve
some of this: http://pypi.python.org/pypi/timer (supports Python 2 and 3)

It takes an idea from MSDN Magazine about creating reliable and accurate
high resolution timers and converts it into somewhat of a threading.Timer
replacement. It accepts a duration in microseconds and can be stopped,
giving you the current elapsed microseconds. I should add an infinite
argument so it can be used more like a stopwatch, rather than requiring a
duration.

It appears to be fairly accurate so far, but I wouldn't count lives on it
just yet.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: logging module -- better timestamp accuracy on Windows

2011-02-16 Thread Brian Curtin
On Wed, Feb 16, 2011 at 12:23, benhoyt  wrote:

>
> > AFAIK, the Windows performance counter has long-term accuracy issues,
> > so neither is perfect. Preferably we should have a timer with the long-
> > term accuracy of time.time and the short-term accuracy of time.clock.
>
> Thanks for the tip -- yes, I hadn't thought about that, but you're right,
> QueryPerformanceCounter (and hence time.clock) veers away from the system
> time, and it's non-trivial to fix. See also:
>
> http://msdn.microsoft.com/en-us/magazine/cc163996.aspx


This is what http://pypi.python.org/pypi/timer uses, although it doesn't go
as far as using the final result of the article, but an implementation from
Figure 2, which was "Good Enough" (TM).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Check in interpreter if running a debug version of python

2010-07-27 Thread Brian Curtin
On Tue, Jul 27, 2010 at 09:06, John Reid wrote:

> Can I check in the interpreter if I am running a debug version of python? I
> don't mean if __debug__ is set, I want to know if python was compiled in
> debug mode.
>
> Thanks,
> John.


Starting with Python 2.7 and 3.2 you can do this:

>>> sysconfig.get_config_var("Py_DEBUG")
1

(returns None if the var doesn't exist)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Best practice way to open files in Python 2.6+?

2010-07-27 Thread Brian Curtin
On Tue, Jul 27, 2010 at 09:33,  wrote:

> What is the best practice way to open files in Python 2.6+
>
> It looks like there are at least 3 different ways to open files:
> - built-in open()
> - io.open()
> - codecs.open()
>
> It seems like io.open() combines the best of the built-in open() and the
> codecs open(). Am I missing any obvious drawbacks to using io.open() except
> for backwards compatibility?
>
> Thank you,
> Malcolm
>

As an FYI, the builtin open() uses io.open() on at least 3.1 (maybe also
3.0, don't know). I don't know your use cases or what you get or don't get
from any of those options, but the future is io.open.

>>> io.open is open
True
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Windows: How to detect whether a Python app/script is running in console/GUI mode?

2010-07-27 Thread Brian Curtin
On Tue, Jul 27, 2010 at 09:36,  wrote:

> Windows: How can I detect whether a Python app/script is running in
> console/GUI mode? By app I mean a script compiled to an exe via py2exe or
> similar.
>
> Thank you,
> Malcolm
>

I don't remember much about py2exe, but you could check if
``os.path.split(sys.executable)[1]`` equals pythonw.exe (typical for GUIs)
or just python.exe (regular console).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Best practice way to open files in Python 2.6+?

2010-07-27 Thread Brian Curtin
On Tue, Jul 27, 2010 at 09:59,  wrote:

> Brian,
>
>  Under Python 2.6.4 (Windows), "io.open is open" returns False. Retrieving
> help() on io.open and open() reinforces that these are 2 different
> implementations of open.
>
> My use case is reading and writing UTF-8 text files with universal newline
> support. I believe that the following io.open() parameter list is what I
> should be using:
>
> # mode set to 'rt' (read) or 'wt' (write)
> io.open( file, mode, encoding='utf-8', errors='ignore', newline=None )
>
> Malcolm
>

Precisely. I was just showing that in 3.x they are the same because one uses
the other, and that reason might be enough for you to consider io.open.

Your usage of io.open looks fine to me. If it works for you, keep doing it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: looking for open source python project

2010-08-29 Thread Brian Curtin
On Sat, Aug 28, 2010 at 19:50, mo reina  wrote:

> looking for a python project (preferably something a bit small) that
> is looking for contributors. the small bit is because i've never
> worked in a team before and haven't really read source code that's
> 1000s of lines long, so i'm not too sure i can keep up.
>
> my python fu is decent (i think), i recently wrote a small archive/
> grimoire program (command line only) that can store multiline text
> with title, tags, and basic search functionality (not using curses so
> the entry, once entered, can't be modified), entries are stored in a
> pickle file.
>
> anybody have any suggestions? i'm keen to work on something with
> others, both for learning and i'd like to do something a bit
> meaningful, plus i'm sure it's fun.


Check out http://bugs.python.org along with the pages of the Python
development area at http://www.python.org/dev/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Source code for itertools

2010-08-30 Thread Brian Curtin
On Mon, Aug 30, 2010 at 22:06, vsoler  wrote:

> On 31 ago, 04:42, Paul Rubin  wrote:
> > vsoler  writes:
> > > I was expecting an itertools.py file, but I don't see it in your list.
> > >> ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c
> >
> > looks promising.  Lots of stdlib modules are written in C for speed or
> > access to system facilities.
>
> Lawrence, Paul,
>
> You seem to be running a utility I am not familiar with. Perhaps this
> is because I am using Windows, and most likely you are not.
>
> How could I have found the answer in a windows environment?
>
> Thank you very much
> --
> http://mail.python.org/mailman/listinfo/python-list
>

You need to checkout the source from svn (or pull from applicable hg
mirrors).

For example:
1. svn co http://svn.python.org/projects/python/branches/release31-maint
2. open Modules/itertoolsmodule.c

The C code for extension modules doesn't get distributed with the
installers.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: develop for Windows on GNU/Linux, using Python

2010-09-21 Thread Brian Curtin
On Tue, Sep 21, 2010 at 03:36, Lawrence D'Oliveiro
 wrote:

> In message , Kev
> Dwyer
> wrote:
>
> > To be confident that your code is good you need to test it on a Windows
> > box (we all test, right?).
>
> Preferably more than one. Test with Seven as well as Vista (yes, there are
> still some Vista users out there). What about the difference between
> Starter
> versus Home Basic versus Home Premium versus Professional versus Ultimate
> versus whatever? To be 100% safe, you probably need to test with all those
> as well.
>
> Test on machines running the various major antivirus packages, because you
> have no idea how they might screw things up.
>
> In other words, with Windows the guideline is: test till it hurts. Then
> test
> some more.


Testing with every single Win7 SKU is not necessary. The Windows API is the
same on all of them, the file system is the same, they are the same
underlying operating system, but they are equipped with different types of
tools. For example, at one of those levels they enable Terminal Server,
something that should not affect your project (unless your project is a
Terminal Server related tool, of course).

For CPython, we test with XP (Win32 API version 5.1) and 7 (ver 6.1, same as
Server 2008 R2). I have previously done a lot of my development on Server
2003 (ver 5.2, same as XP x64), although there is no buildbot slave running
for that OS. If I need anything tested for Vista (ver 6.0, same as Server
2008), another OS without a buildbot slave, I know of a Vista user that can
usually lend a hand. There would be no benefit to us to test CPython on all
available releases of each OS -- it would be more of a burden, actually.


As for antivirus screwing things up, that may be of interest to some
projects, mainly those opening and then deleting files very quickly. The
CPython test suite occasionally runs into issues deleting temporary files
because the AV tools that some users have installed try to scan them in the
very small time frame the file is intended to exist. TortoiseSVN also
latches on long enough that handles to the file exist when a test tries to
clean up after itself, thus causing seemingly random test failures. There's
an open issue to fix that, though.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: minimal D: need software testers

2010-09-28 Thread Brian Curtin
On Mon, Sep 27, 2010 at 10:07, Kruptein  wrote:

> Hey,
>
> I've released the second alpha for minimal-D a program I've written in
> python which should make developing easier.
> I need people to test the app on bugs and give ideas.
>
> It is written in python using the wxPython toolkit and is linux-only.
> (using on windows is on own risk)
>
> You can download a .deb or a .tar.gz from http://launchpad.net/minimal


What type of testing do you currently do?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: discussion

2010-10-01 Thread Brian Curtin
On Thu, Sep 30, 2010 at 21:12, Geo_subodh  wrote:

> please send me the simple python code that uses input number greater
> than3 digits(>3 digits) and  checks whether the number is palindrome
> or not.


$ cat homework.py
raise NotImplementedError
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] PyArg_ParseTuple

2010-10-11 Thread Brian Curtin
On Mon, Oct 11, 2010 at 07:06, Ioan Ferencik  wrote:

> I  would like to ask where can I find more detailed info on
> PyArg_ParseTuple function.
>
> I find the doc limited on the matter.
> Mainly I am curious why the function requires an address of a pointer.
>
> I have issues in the following case:
> in python
> int jmax = 16
>
> print type(jmax)
>
> 
>
> which is just all right
>  but following C code seems to be working
> PyObject *jmax_o = NULL;
>
> if(!PyArg_ParseTuple(args, "i", &jmax_o)){
>goto error;
>}
>
> but PyInt_Check(jmax_o) fails.
>
> I tried to debug and this is what i could see
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x767a75bd in fprintf (self=, args=(16,))
> at /usr/include/bits/stdio2.h:98
> 98  return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
>
> so for some reason the jmax_o can not be converted to int.
>
> I use a x86_64 ubuntu and i suspect it could be because of 64 bits arch.
>
> Cheers
>
> Ioan Ferencik
> PhD student
> Aalto University
> School of Science and Technology
> Faculty Of Civil and Env. Engineering
> Lahti Center
> Tel: +358505122707
>

The following is probably what you want:

"""
int jmax_o;

if(!PyArg_ParseTuple(args, "i", &jmax_o)){
   goto error;
   }
"""

PyArg_ParseTuple takes the arguments passed in, a format string, and then
the resulting values from conversion. The "i" format, as you already knew,
is for ints, and it converts your value into an *actual int* -- not a Python
int. Because of that, you wouldn't need the PyInt_Check -- that's for
checking PyObjects to see if they are Python ints.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question regarding python2.5 migration from windows xp to windows 7

2010-10-14 Thread Brian Curtin
On Thu, Oct 14, 2010 at 01:37, python_tsp  wrote:

> Hi,
>
> We have a Python based test framework which is being used in various
> projects.
>
> Our current environment is
> Python (ver 2.5.1)
> wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25)
> pywin32-210.win32-py2.5
> vcredist_x86.exe
> pyserial-2.2
>
> Our Framework is being currently used in Windows XP.
>
> The issue is:
> Soon our environment will be migrated from Windows XP to Windows 7.
> In this regard, I would be in need of suggestions/ideas/information
> regarding migration of our existing framework into windows 7
> environment.
>
> Do i need to migrate our framework from Python 2.5 to either Python
> 2.6 or directly to Python 3.0 ? What happens to all supporting
> packages..etc
>
> Which is the best way ?
>
> We tried out of some option of using our framework under virtual xp
> context of windows 7.Thou it works for timebeing,i am not interested
> to having the same as kind of way of working for future.
>
> Please help
>
> Many thanks in advance
>
> - Pramod


You will be able to just install your current code on Windows 7 and it will
work fine. If it doesn't for any reason, it's probably a bug in Python,
which I think is highly unlikely.
-- 
http://mail.python.org/mailman/listinfo/python-list