Re: callling python function in c

2011-10-18 Thread Anssi Saari
masood shaik writes: > Hi > > I am trying to call python function from c code.The following > program i got from the web source while i am trying to run this > program it throws an segmentation fault. Yes, the call to PyImport_Import fails and returns a NULL. You could use the more complete ex

Re: What is wrong with my code?

2011-10-25 Thread Anssi Saari
apometron writes: > Now it is another > thing, entirely. Rename1.py and Rename2.py works, but why Rename3.py > dont works? Well, Rename3.py works for me, even in Windows 7. Maybe you should test it again? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-23 Thread Anssi Saari
"W. eWatson" writes: > One thing I think no one has offered is whether their installation of > 2.7.2 has the same IDLE oddity that I've described. That is, if you > right-click on a py file, do you see a choice for the IDLE editor? I don't have 2.7.2, but my Windows (7, 32 bit) machine has 3.2

Re: python shell that saves history of typed in commands that will persist between reboots

2011-11-23 Thread Anssi Saari
goldtech writes: > Using Windows. Is there a python shell that has a history of typed in > commands? Is there a shell that doesn't have history then? At least both the vanilla shell and Idle both have basic history in Windows. IPython for more fun. -- http://mail.python.org/mailman/listinfo/pyt

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-23 Thread Anssi Saari
Dennis Lee Bieber writes: >> c:\Python32 Start in, and for Target: Python 3.2.2 (64-bit) > > Which tells me that the TARGET field is garbaged, since THAT is what > specifies the program (and arguments) that has to be run when the > shortcut is double-clicked. Actually, no, it's what I have

Re: How to install Python on Debian GNU/Linux (Python-2.7.2.tar.bz2)

2011-12-14 Thread Anssi Saari
Christian Heimes writes: >> Mea culpa, forgot that. Yes, use altinstall. Although it's probably >> not a problem to replace 2.6.6 with 2.7.2 - I doubt that'll break many >> things. > > Except that all 3rd party extensions and packages are missing if you > install Python manually. True, they woul

Re: Help with python-list archives

2012-01-10 Thread Anssi Saari
Ian Kelly writes: > Probably nobody has noticed it until now. It seems to be a quirk of > the archive files that they are double-gzipped... Interesting, but I don't think the files are actually double-gzipped. If I download http://mail.python.org/pipermail/python-list/2012-January.txt.gz with w

Re: First python project : Tuner

2012-01-20 Thread Anssi Saari
Jérôme writes: > - I tried to clarify the dependencies of my program by adding > "PyGObject (python-gi)." > I believe PyGObject is the name, but python-gi being the name of the debian > package (and possibly other distros' package, I didn't check), I assumed it > would be more helpful.

Re: Installing Python on CentOS 6 - a big pain

2012-01-20 Thread Anssi Saari
Benedict Verheyen writes: > If i need to install a new version of Python, as I happen to have done today, > I only need to do step 4. Which is maybe 5 minutes of work. I don't really understand why you compile these common libraries (zlib, ncurses, readline) yourself instead of using the relevan

Re: Opinion on best practice...

2013-02-06 Thread Anssi Saari
Dennis Lee Bieber writes: > PowerShell is meant to be used for administrative level scripting, > replacing such things as WSH. Yeah and WSH has been included since Windows 98... So Windows has been at least OK with shell scripting VBScript and JScript for the last 15 years or so. And I can

Re: Python 3.3 vs. MSDOS Basic

2013-02-19 Thread Anssi Saari
John Immarino writes: > I coded a Python solution for Problem #14 on the Project Euler > website. I was very surprised to find that it took 107 sec. to run > even though it's a pretty simple program. I also coded an equivalent > solution for the problem in the old MSDOS basic. (That's the 16 bit

Re: Shebang line on Windows?

2013-02-26 Thread Anssi Saari
Michael Torrie writes: > Actually, the shell isn't involved in parsing the shebang line at all. > That's actually done in the kernel by the program loader. So it's the > kernel that has a problem with it; wonder if Linus would accept a patch > to ignore the tailing CR? Worth a try in my opinion

Re: nested loops

2013-02-26 Thread Anssi Saari
leonardo writes: > how can i have it print a row of stars beside each number, like this?: > > how many seconds?: 5 > 5 * * * * * > 4 * * * * > 3 * * * > 2 * * > 1 * > blast off! You could use the repetition operator * since you have the number of repetitions needed in i. Alternatively, consider

Re: Help with zip in a Python exercise

2013-03-28 Thread Anssi Saari
lug...@elpasotel.net writes: > I've been working through a Python tutorial online and one of the exercises > uses the zip command. The only problem is that the command doesn't work. > I've read through the man page for zip and it looks like what I'm attempting > should work, but it doesn't. >

Re: Cross-compiling Python for ARM?

2013-04-16 Thread Anssi Saari
Gilles writes: > I see Python mentioned in /usr/lib and /usr/share, and was wondering > if all it'd take to solve this issue, is just to cross-compile the > interpreter and the rest is just CPU-agnostic Python scripts. I suppose. In any case, cross compiling Python shouldn't be that hard. I just

Re: can python do this?

2009-12-02 Thread Anssi Saari
Rounak writes: > I am a complete newbie. I want to know if the following can be done > using python or should I learn some other language: > (Basically, these are applescripts that I wrote while I used Mac OS) > 1.Web Page Image to Wallpaper: > A script that takes the current image in a browser

Re: Bored.

2009-12-03 Thread Anssi Saari
Necronymouse writes: > Hello, I am learning python for about 2 years and I am bored. Not with > python but I have a little problem, when i want to write something I > realise that somebody had alredy written it! So i don´t want to make a > copy of something but i wanna get better in python skills

Re: syntax error : first python program

2009-12-23 Thread Anssi Saari
Ben Finney writes: >> bash# /usr/bin/python sample.py >> File "sample.py", line 2 >> name = "blah" >> ^ >> SyntaxError: invalid syntax > > Indentation is syntax in Python. At least here with Python 2.5.2 I get "IndentationError: unexpected indent". I'm just wondering why would the OP g

Re: Accessing python from a network share in windows 7

2010-01-09 Thread Anssi Saari
aj writes: > I access python from a network share. This works fine on XP but on > windows 7 it throws the following error: > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. im

Re: myths about python 3

2010-01-29 Thread Anssi Saari
Stefan Behnel writes: > 'Stable Debian' has a long tradition of being late and outdated on arrival. > That doesn't mean you can't use existing Debian packages on it. Yes, but that's beside the point. No released version of Debian ships with Python3 or even 2.6. Oh, and RHEL5 and CentOS5 ship wi

Re: myths about python 3

2010-01-29 Thread Anssi Saari
Daniel Fetchinson writes: >> 1. Python 3 is supported by major Linux distributions. >> >> FALSE - most distros are shipping with Python 2.4, or 2.5 at best. > > This latter statement is false, Fedora 11 and 12 come with python 2.6. How does your mention of one distro counter that claim? Pe

Re: myths about python 3

2010-02-01 Thread Anssi Saari
Blog writes: > Where did you come up with that information? Almost all of the major > distros ship with 2.6.x - CentOS, OpenSuSe, Ubuntu, Fedora. (Debian > does ship with 2.5, but the next major release "sid' is due out in Q2) I don't see Python 2.6 in my CentOS 5.4 installation. All I see is 2.

Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Anssi Saari
Schif Schaf writes: > (brackets replaced by braces). I can do that with Perl pretty easily: > > > for (<>) { > s/\[(.+?)\]/\{$1\}/g; > print; > } > Just curious, but since this is just transpose, then why not simply tr/[]/{}/? I.e. why use a regular expression at all for this?

Re: merge stdin, stdout?

2010-02-07 Thread Anssi Saari
jonny lowe writes: > The result is the same as before. I've tested in fedora11. I don't think script is the answer here, since it only stores what's displayed on a terminal and your program's input comes from a file and is not displayed on the terminal. Simplest solution is probably that you ha

Re: Your beloved python features

2010-02-07 Thread Anssi Saari
Julian writes: > I've asked this question at stackoverflow a few weeks ago, and to make > it clear: this should NOT be a copy of the stackoverflow-thread > "hidden features of Python". Thanks for the hint, interesting stuff in there. > For those guys would be a poster quite cool which describes

Re: MemoryError, can I use more?

2010-02-13 Thread Anssi Saari
"Diez B. Roggisch" writes: > Am 13.02.10 17:18, schrieb Anssi Saari: >> Nobody writes: >> >>> A single process can't use much more than 2GiB of RAM without a 64-bit CPU >>> and OS. >> >> That's not really true. Even Windows XP has

Re: MemoryError, can I use more?

2010-02-13 Thread Anssi Saari
Nobody writes: > A single process can't use much more than 2GiB of RAM without a 64-bit CPU > and OS. That's not really true. Even Windows XP has the /3GB boot option to allow 3 GiB per process. On PCs, free operating systems and server Windows can use PAE to give access to full 4 GB per process

Re: /usr/bin/ld: cannot find -lz on Cent OS - Python 2.4

2010-02-21 Thread Anssi Saari
V8 NUT writes: > /usr/bin/ld: cannot find -lz > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 Could it be you're missing zlib-devel? What does yum info zlib-devel say? Or locate libz? -- http://mail.python.org/mailman/listinfo/python-list

Re: pyao makes the right sound but why?

2010-03-04 Thread Anssi Saari
"'2+" writes: > dev = ao.AudioDevice('alsa') > dev.play(x) > > could launch me a semi realtime dj kinda sys > luckily .. it does seem to be making the right sound > but why? > the default of the samplerate and that 16bit happened to match with my thing > x? Yes, that seems to be the case from h

Re: Building Python-2.6.4 on G/L: can't build in _ssl support.

2010-03-06 Thread Anssi Saari
Alan Mackenzie writes: > Hi, Python! > > I build Python-2.6.4 on my GNU/Linux (Debian Sarge) box. I get a warning > message "Failed to find the necessary bits to build these modules: > _ssl ... RTFS to find out what!". At a guess, you're missing libssl-dev. You might consider installing p

Re: another newbie question

2010-11-20 Thread Anssi Saari
Roy Smith writes: > I'm still searching for as nice a font to use on Linux. Envy Code R is a lookalike, so maybe worth considering. I haven't tried actual Monaco on Linux, but apparently it's possible. Personally, I use -lfp-gamow-medium-r-*-*-7-*-*-*-*-*-*-* in Linux (Emacs). -- http://mail.py

Re: Extending Thunderbird mail client with Python

2010-12-16 Thread Anssi Saari
John Bond writes: > Anyone have any experience with this, ideally using Python 3? I don't but there is a great need to have a working SyncML client for Thunderbird. Funambol used to have one available, but it has crashing problems with Thunderbird 3 for some people. The existing extension was do

Re: Noob question on 2 vs 3 Python releases

2010-12-29 Thread Anssi Saari
Franck Ditter writes: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? Well, Python 2.7 is the last major 2.x release, only bugfixes are done for it, like the 2.7.1 release. Actual developement is in the 3.x branch now. > Which one sh

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Anssi Saari
Ben Finney writes: > Raymond Hettinger writes: > >> Compute π ± e by counting Mandlebrot set iterations :-) > > Very cool! I love π nerdery. > > > Raymond Hettinger writes: > >> > Compute ð ± e by counting Mandlebrot set iterations :-) >> >> That should be: pi plus-or-minus e > > It was in my

Re: How to use Python well?

2011-02-23 Thread Anssi Saari
Grant Edwards writes: > I've lost track of how many times I've tried to learn to use the Gnu > "info" command and gave up in frustration. I've never seen a program > with a more difficult to use UI. As I recall, there are other info viewers like tkinfo for example. But really, how hard is the

Re: fcntl, serial ports and serial signals on RS232.

2010-04-08 Thread Anssi Saari
Max Kotasek writes: > Hello to all out there, > > I'm trying to figure out how to parse the responses from fcntl.ioctl() > calls that modify the serial lines in a way that asserts that the line > is now changed. For example I may want to drop RTS explicitly, and > assert that the line has been d

Re: ftp and python

2010-04-08 Thread Anssi Saari
John Nagle writes: > In theory, the FTP spec supports "three-way transfers", where the > source, destination, and control can all be on different machines. > But no modern implementation supports that. I remember even using that way back when, Unix machines in the 1990s. But, server to ser

Re: Printing forms and labels in Python

2010-06-13 Thread Anssi Saari
Monte Milanuk writes: > Hello, > > I'm still a relative newbie to python, so I apologize if this is > covered in detail somewhere and I missed it. > > I have a program or two that I want to work on once I get more > proficient with python and sqlite and tkinter/wxpython. One of the > big 'featur

Re: how to get bit info

2010-06-19 Thread Anssi Saari
Back9 writes: > Hi, > > I have one byte data and want to know each bit info, > I mean how I can know each bit is set or not? Other than the tedious anding, oring and shifting, you can convert your byte to a string (with function bin) and use normal string handling functions to check if individua

Re: Q for Emacs users: code-folding (hideshow)

2010-07-17 Thread Anssi Saari
David Robinow writes: > Really, if you can't be bothered to set your key bindings to something > you prefer, then I don't think Emacs is the right tool for you. Uh, I absolutely think Emacs is the right tool for me, but I don't think I've never changed any key bindings in the 20 years I've used

Re: Light-weight/very-simple version control under Windows using Python?

2010-07-25 Thread Anssi Saari
pyt...@bdurham.com writes: > 1. Use an existing version control utility. There are lots of options > here(!), any recommendations on a light weight, open source one that > xcopy installs under Windows with lots of command line options? Personally, I like RCS. It seems fulfil your requirements. Yo

Re: How does Python get the value for sys.stdin.encoding?

2010-08-12 Thread Anssi Saari
Benjamin Kaplan writes: > Sys.stdin and stdout are files, just like any other. There's nothing > special about them at compile time. When the interpreter starts, it > checks to see if they are ttys. If they are, then it tries to figure > out the terminal's encoding based on the environment. Just

Re: Working with PDFs?

2010-08-18 Thread Anssi Saari
writes: > - Pull out text from each PDF page (to search for specific words) > - Combine separate pdf documents into one document > - Add bookmarks (with destination settings) PDF Shuffler is a Python app which does PDF merging and splitting very well. I don't think it does anything else, though,

Re: vpython

2010-08-21 Thread Anssi Saari
kimjeng writes: > the thing is i have installed gtkglextmm both from source and via a > slackbuilds package script and i still get the same error, > help would be a appreciated You'll just have to check what it is configure actually tests for and figure out from that why your system doesn't pass

Re: how to get partition information of a hard disk with python

2010-09-30 Thread Anssi Saari
Nobody writes: > On Wed, 22 Sep 2010 00:31:04 +0200, Hellmut Weber wrote: > >> I'm looking for a possibility to access the partiton inforamtion of a >> hard disk of my computer from within a python program. > > Have you considered parsing /proc/partitions? One could also just read the partition

Re: how to get partition information of a hard disk with python

2010-10-04 Thread Anssi Saari
Lawrence D'Oliveiro writes: > The Linux kernel includes built-in support for something close to two dozen > different partition formats, from the common ones like MS-DOS, Solaris, SGI, > Ultrix, EFI and BSD on down. Why reinvent parts of that when you can get it > all for free? Because for th

Re: Newbie question - parsing MIME(?) strings

2010-10-28 Thread Anssi Saari
Dan M writes: > On Thu, 28 Oct 2010 15:05:56 -0500, Dan M wrote: > > Ok, I didn't research enough before I posted this. I see now that this > *is* indeed a MIME message, and the '?Q' bit says that the next piece is > quoted-printable, and that the encoding is defined in RFC2047. > > So the ques

Re: Data exchange between python script and bash script

2017-04-05 Thread Anssi Saari
venkatachalam...@gmail.com writes: > For example, the data is printed in > execute_sensor_process.py as follows: > > print >>sys.stderr,sens_data > > By printing the data onto sys.stderr and assigning a return variable in the > bash, I am expecting the data to be assigned. > > But this is not hap

Re: comp.lang.python killfile rule

2017-06-26 Thread Anssi Saari
John Black writes: > All, in case this is useful to anyone, this rule that tells my newsreader > which posts to kill really cleans up the group. I get by just with a very old rule that lowers the score of articles where the subject is in all caps. Those articles end up in the bottom of the arti

<    1   2