Over 1 million tech questions and answers.

Porting Perl To Python: Techniques for migrating legacy, untested Perl to Python

Q: Porting Perl To Python: Techniques for migrating legacy, untested Perl to Python

Porting Perl To Python.

Summary: Porting legacy Perl to Python can be a daunting task. In this article, learn some of the theory behind dealing with legacy code, including what not to do.Click to expand...

-- Tom

Read other answers
RELEVANCY SCORE 200
Preferred Solution: Porting Perl To Python: Techniques for migrating legacy, untested Perl to Python

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

RELEVANCY SCORE 89.6

I have a perl script that reads through a directory and manipulates every mp3. I would like to call another script, passing the name of the mp3 file and returning values obtained in the second program. Then I would like to reference those returned values in the original program.

How do I call the second program, sending it the file to process and leaving place-holders for the return values? This is on a linux server.

Any ideas?
 

A:calling a perl program from within another perl program

Read other 8 answers
RELEVANCY SCORE 79.6
Q: python

Hi
can any one please tell me how to compile a python source code into a standart .exe file
 

A:python

http://www.py2exe.org/
 

Read other 2 answers
RELEVANCY SCORE 79.6

How does PHP compare with Python and witch one is better to learn for future use?
 

A:PHP vs Python

Read other 6 answers
RELEVANCY SCORE 79.6

Am writing a program which simulates the action of an atm machine and I need it to end when option "c" is chosen. How exactly cn I do this, the only ways i can think of are...rubbish...
 

A:Python atm

Hi eventide,

Perhaps this link will help which is the result of searching for case statement here.

I assume you can structure your input options in a case statement - one of which would be 'c' to switch to in the proper Python syntax, of course.

-- Tom
 

Read other 1 answers
RELEVANCY SCORE 79.6
Q: python

Does anyone know what python 2.2 combined win32 extensions is?
Do I need it on my pc?
I just noticed it about a week ago.
Thanks

A:python

Hello dee1-2-3 and welcome to BC.What is Python?Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing. There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). New built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface.Unless you are doing some programming..............

Read other 1 answers
RELEVANCY SCORE 79.6

Does anybody know what that is? (Python 22)

It is a sizable prog. and is in the start up line.
when I do a search for it , I can not find anything ??
I tried google for info , no luck there.
accept one site that said "send me $$ and I will tell you"

Well I have a few words for them.
thanks to anybody who can help.
 

A:Python 22 ??

See if this helps: http://www.python.org/doc/faq/installed/
 

Read other 2 answers
RELEVANCY SCORE 79.6

And is it something I need or just another security and privacy risk HP put on my computer>
 

A:What is Python>

Read other 8 answers
RELEVANCY SCORE 79.6

I am having trouble running pip. It is supposed to come installed with python, but my computer doesn't recognize it. I try installing it, but get an error message. Could it have something to do with running 32 bit python on a 64 bit computer? I have version 3.6 python.
 

Read other answers
RELEVANCY SCORE 79.6

Is this a necessary software for windows XP?...Trying to clean up my HD..Don't even know how it got on my system..
 

A:Python 2.2.3?

Python is a programming language and not absolutely necessary unless you have programs installed that need Python in order to run.
 

Read other 1 answers
RELEVANCY SCORE 79.6

What are the uses of Python in Software Development?
 

Read other answers
RELEVANCY SCORE 79.6
Q: Python?

Is anyone here versed in Python? My son is into programming and already is very knowledgeable in several programming languages but is just learning, on his own, Python. I'm sure he would like to become acquainted with anyone who is already fairly fluent in this new language. TIA.
 

Read other answers
RELEVANCY SCORE 79.6

i am trying to learn python not sure if its loaded properly on my pc any one as any detail instruction for win7 installation
 

A:python and win 7

If you're using ActivePython, the installer should have everything configured for you. You will, of course, want to read the accompanying documentation for how to run your python scripts.
 

Read other 1 answers
RELEVANCY SCORE 79.2

I realize this is a little off-topic, but I'm getting very frustrated with something. I'm going to throw down a little syntax here and see if you can figure out whats wrong. The script works, as far as I don't get an error message, but it simply doesn't do the following, which basically adds a thread to a list on an html page, like a bulletin board. For copyright issues, this script is partially derived from Matt from Matt's Script Archive.

sub main_page {
open(MAIN,"$imagedir/$galpage") || die $!;
@main = <MAIN>;
close(MAIN);

open(MAIN,">$imagedir/$galpage") || die $!;
foreach $main_line (@main) {
if ($main_line =~ /<ul>/) {
print MAIN "<ul>\n";
print MAIN "<li><a href=http://www.nevermind.com/pics/$pictitle.html>$pictitle</a>\n";
}
else {
print MAIN "$main_line";
}
}
close(MAIN);
}

All the variables are properly defined and the sub itself is called properly. Since I don't get an error I'm assuming it does run through the sub, but for some reason doesn't add the HTML to the file.
Again, this might not be a good question to post here, but you folks have always helped me out with my headaches, however strange they were, and this one is giving me quite a doozy.

ps) that bullet and link are just generated by the board...it should say the actual HTML in there

Thanks, DAN
 

Read other answers
RELEVANCY SCORE 79.2

hi everybody, how r ya?
can anybody give me his/her opinion about what to start with for web applecations? should i learn perl or asp? i really need the help to get started !!!!!!! thanx very much........
 

A:should i go for PERL or ASP ?

Read other 7 answers
RELEVANCY SCORE 79.2

I am running a perl script on solaris and need to solve the following problem. I have a list of entries that I am reading in that may look like this:

HELLO_1.0.0.12
HELLO_1_16_1_3
HELLO_2_6_3.2
HELLO_GOODBYE_1_0_0

I am trying to figure out a way to parse out ONLY the number portion of the line. For example, for the list below I want only this information:

1.0.0.12
1_16_1_3
2_6_3.2
1_0_0

The things I have tried:
1) Using substring beginning at the end of the line, but that doesn't work because I need to know the exact number of characters I am looking for. Since I don't know if any of the numbers will be one digit or four digits.

2) Splitting the line into an array based on underscore (_) or dot (.). I then did a splice of the array for the last four array elements, but that does not work if the line only has three numbers (ex. 1_0_0). I will then get part of the text.

Any suggestions on how to do this successfully would be very much appreciated.

Thanks!
 

Read other answers
RELEVANCY SCORE 79.2

anyone here know Perl? Am trying to add a perl script to a site and am having problems.
 

A:Perl ???

Try this Perl tutorial to get you started.
 

Read other 3 answers
RELEVANCY SCORE 79.2

Hi, just got a book on Perl programming, and the way to use the compiler is a bit confusing.

I downloaded The AS Package Under Windows and tried to make a simple "Hello" program.

I used a .txt file, saved it to c:/Perl/bin (where the compiler and other files are installed) and opened it through using CD \Perl\bin\perl.txt The text file opened and not the code (I guess thats what should have happened)

Anyway, how do I use this so that I see the output and not the language?

I tried going through perl.exe located in the same .bin folder to open the code, but that did not work.

Thanks for any help.
 

A:Help With Perl

Read other 16 answers
RELEVANCY SCORE 79.2

I have an html page on my Server, already formatted that I want to use as a response to a CGI form request. How do I simply print a $var (which is the complete html page) back to the client machine?

The print outputs all html code to the console when the script is run from the Command line. Any help would be appreciated.
 

A:Perl CGI

You could use a print block to do something like that, I'd think. It's been forever since I've used CGI scripting to make dynamic webpages, but as I recall, variables are interpolated into print blocks. So you'd just start your print block, and the only content it'd have would be $var.

I'm only suggesting this because it's been 3 or 4 years since I've made a webpage using perl.

HTH

chris.

[edit]
Does Print($var) not work? The client browser should be the STDOUT if the script is run from a web server. At least, as I recollect...
[/edit]
 

Read other 3 answers
RELEVANCY SCORE 79.2
Q: Perl ?

In a Perl script it ask for Full System path and WWW path. The domain is www.suziem.com. User name is suziem. It is on hypermart.net and server 104
Sure could use some help.
Dutch
 

A:Perl ?

look at the read me file that should have come with the perl script!
I'm guessing that it's a premade free srcipt?
Am I right?

The path is, I think, asking for the CGI-bin Path.
Meaning that your WebHost must offer CGI before you can implement a CGI script.

Contact your Webhost 'HyperMart' and ask if they offer CGI to it's users. Then ask Where the CGI-Bin is located.
Then you really just need to edit the perl script a tiny bit, no the actual code, but the Path etc...

If I'm wrong, feel free to correct me. It's been a while since I've touched on Perl.
 

Read other 1 answers
RELEVANCY SCORE 79.2

I have a Perl assignment that is driving me nuts. Here is what I don't understand.

1)How to get the ages to work like the names do.
2)How to get the names and ages to be displayed together.
3)How to show how many years till 25 that they are.

Below is the assignment and the coding.
Here is my assignment:

--Format an HTML page
--Declare an array of 10 names
--Add 3 new names to the name array
--Declare an array of 10 ages for the original 10 names
--Uses a control structure to:
--Print each name and age
--Print each name and the age the person will be in 25 years.
--Declare 2 numbers $a=2523 and $b=11 and perform the operations listed below. You may assign these values to new scalar variables:
--concatenate $a and $b to create $c -- print the value of $c
--repeat $c two times and print its value
--square $a and print the result
--divide $c by $a
--Determine the modulus of $c divided by $b
--Design and develop another feature for the program:
--Be sure to use comments to describe the feature.

Here is my coding thus far:

#!/usr/bin/perl
#Assignment4.pl Part B
print "Content-type: text/html\r\n\r\n";
print "<html><head><title>Assignment#4</title></head>";
print "<body><font face=tahoma><b><font color=gray><body bgcolor=navy><h2><center>Assignment 4</h2></center>";
my @names;
$names[0]="Miguel ";
$names[1]="Roberto ";
$names... Read more

Read other answers
RELEVANCY SCORE 79.2
Q: Perl?

anyone here know Perl? Am trying to add a perl script to a site and am having problems.
 

A:Perl?

I see you have another thread open regarding the same issue, TechGuy Rules state that you are to post one thread for one specific issue so I will Close this one. I feel that the other thread is in a better suited location, too.
Stick with that one thread. If you would like to post the question in another forum, you can PM or contact an Admin or Moderator who can Move your thread to a different forum.
 

Read other 1 answers
RELEVANCY SCORE 79.2

Hi

i am writing a perl program to retieve data from a clearcase enviornment . What the code shld do is to connect a network path to a drive and then execute a command to extract some data . then it disconnects the drive and then connect another shared path and does the same thing . This does it for numerous shared paths . The code that i wrote works buetifully on my system , but acts cranky on other systems . It actualy 'hangs ' in some other systems . i was able to find out that it is actually stopping at the line which disconnects the drive for the shared path .
This does not happen at definite points . Sometimes it does everything correctly for say 5-6 shared paths and hangs while disconnecting the drive for the next one .
I really dont know why it is happening like this , only thing that i could guess is that the previos command had not completed executing and so the shared path was busy which resulted in the code freezing at the line which disconnects the drive ...
The code is a .bat file ...
I would appreciate if any one could give me a workaround , or if anyone could recall facing similar issues .. Please Help ..

Regards
Max

P.S - It is still working buetifully on my system ... WHY ??????/
 

Read other answers
RELEVANCY SCORE 79.2

I have just started CGI/Perl and I have written my first cgi. It's called first.cgi. Anyways, I am able to run it on command prompt ( I use Window Vista) but when I try to run it on IE or FireFox I get the HTTP 404 error. I have downloaded and installed the data files from my school, ActiveState for Perl, I have even clicked all the boxes under Internet Information Services. I can pull up the IIS website, but I can not bring up my first.cgi. Can some please help me?!

Thank you.
 

Read other answers
RELEVANCY SCORE 79.2

i want to put a basic contact page on my web site with fill in cgi forms. does anyone know any good online forums / helpdesks/ tutorials. e.g. where the info goes etc. how to set up forms etc r any good software to do it. i only want basic form such as name , address etc THANKS!!!
 

A:cgi perl help

I would see if someone has already written a freely downloadable one.

http://www.hotscripts.com

http://www.hotscripts.com/Perl/Scripts_and_Programs/Form_Processors/index.html
 

Read other 1 answers
RELEVANCY SCORE 78.4

Hi all,

I've got Python v.2.4 that supposedly has an editor and I'm unable to find it.
Can anyone tell me how I would open the editor.

Thanks.
 

A:Python editor

Read other 9 answers
RELEVANCY SCORE 78.4

Hello everybody,
I'm sure everybody here knows some Scripting language and have working knowledge. I need help with getting started to learn but i want to start with some project wide enough to help learn the language and understand the concpets of python. There are some other scripting languages i know about, for eg: perl, php but i'm interested in this one..dont know why???
Need help of someone who is actively working on it or has worked in the past and can throw some pointers here to get started.
I dont like the idea of reading pages and pages and then impementing something. The other way round is a much faster and better way.

Please post your replies soon... Thanks a lot!!
 

Read other answers
RELEVANCY SCORE 78.4

Can someone explain to me how i can create clickable links within my wxpython program? i cant seem to find anythin to help me.

Thanx
 

Read other answers
RELEVANCY SCORE 78.4

After two years break I tried to restart a Python/Excel program that ran ok then. The first lines of my Python code reads

import win32com.client, sys, os
excel = win32com.client.Dispatch.client.Dispatch('Excel.Application')
excel.Visible = 1

When I try to run it I get the error

ImportError: No module named win32com.client

How can I find the modul again?
I am using Python 2.5.1.

// Willy

A:Python/Excel

Hello and welcome to the forum.

I am very sorry for the delay, we have been very busy lately.

Please try this:

Python for Windows extensions | Download Python for Windows extensions software for free at SourceForge.net

Read other 1 answers
RELEVANCY SCORE 78.4

I have just started learning Python and like it a lot, but all that seems to exist to use it is the interpreter. I'd like to be able to compile things written with it into stand-alone Windows executables... does anyone know of any way to do this?
 

A:Python Compiler (?)

http://www.python.org/doc/current/lib/compiler.html
 

Read other 3 answers
RELEVANCY SCORE 78.4

I'm developing some scripts on Win 10. But suddenly all the script failed due to it cannot invoke CMD on Win10.
Here is one example,
"
import os
os.system("cd .")
"
It is a very simple code that python to call CMD to execute "cd .".
But it always return "-1073740791".
And all my other projects such as Jenkins failed because of try to invoke CMD.
Could anyone help me on this?

Read other answers
RELEVANCY SCORE 78.4

I am having trouble creating a program that allow customers to enter the insurance company name, annual premium and monthly (6% more) for insurance companies. The insurance company name, annual premium, monthly premium and how much more to pay if paid on monthly basis should be shown.
 

A:Programming Python

You have not provided us any code to help you with. Which part are you having problems with?
 

Read other 2 answers
RELEVANCY SCORE 78.4

Hello,

I was trying to update my Python version yesterday, from 2.3 to 2.7. However, when I had finished installing 2.7, I was unable to open IPython. When I right-click a folder and click "IPython here" a window opened and I was redirected to a command prompt window. I uninstalled all Python after that and tried reinstalling, but had no success in getting IPython working.

If you have any insight into what's going on and how I can remedy the issue, please let me know.
 

Read other answers
RELEVANCY SCORE 78.4

FAILED INIT PYTHON...

i know it probably sound familiar but i cant get the addon--beyond the sword---for civ 4 to work....

the original game works fine with the crack and everything...but even after adding the crack to the installed beyondthesword directory it reads failed python...anyhting i can do to correct this?
 

Read other answers
RELEVANCY SCORE 78.4

I want to buy a book on programming, but I cant decide between learning Ruby or Python. Which one is better to learn first? Which one is easier for someone who does not program, but has a good concept of how it works?

Please Visual Basic & Java people, try to stay with the topic
 

A:Ruby or Python which one is better?

Read other 8 answers
RELEVANCY SCORE 78.4

I downloaded Python for the first time today and went to start compiling a code but when I did, it said there was a Syntax error. it highlighted the "2" in "3.2" at the top of IDLE. I tried deleting the 2 but it did the same thing and highlighted the "." after the "3" instead. Same thing when I tried Python 2.7. Both versions were the Windows x86 MSI Installer. Any ideas?
 

A:Can't get Python to work

Read other 10 answers
RELEVANCY SCORE 78.4

I need to get Python for one of my classes and I was about to download it, when I came across Python source... What is it? I realize Python is open source, but can't figure out what is a Python source. I have Win7 64-bit and the warning notice next to the 64-bit download said that "it doesn't include source"...
I also need IDLE, so would that be a problem? Or should I just download the first, normal Windows installer?
Thanks
 

A:What is Python source?

Hi wicked.ludicrous,

Since Python is a programming language, Python source is text containing Python statements in the programming language Python. See: Python (programming language).

For example: to execute a python source, one might issue the following command (in a Terminal command line window where $ is the command prompt) assuming that a Python interpreter executable is available on your computer:
$ sudo python check-my-hardware.py

The file check-my-hardware.py is the file containing python source statements interpreted by the python interpreter executable in root mode (via use the sudo) on a Linux platform. The python source code in check-my-hardware.py determines compatibility of a computer's BIOS with PAE and NX bit available memory.

-- Tom
 

Read other 2 answers
RELEVANCY SCORE 78.4

Python multiprocessing.

Oskar Andreasson (yes that Oskar Andreasson) explores using the language Python in a multiprocessing context - good stuff to fill your brain with if you are interested in multiprocessing!

-- Tom
 

Read other answers
RELEVANCY SCORE 78.4

I'm having a problem installing python and blender. I install python for windows through the MSI file provided by Python.org (2.6.1 and 3.0). I then install Blender (2.48). When i fire up blender it gives me this mesege.


Code:

Checking for installed Python... No installed Python Found.
Only built-in modules are available. Some scripts may not run.
So i go and check my environment vars and ofcorse the PYTHONPATH var is missing. so i set it up


Code:

PYTHONPATH
C:\Python3;C:\Python3\DLLs;C:\Python3\Lib;C:\Python3\Lib\lib-tk;
Still nothing

===
I tryed again with python 2.6
Uninstalled everything, re-installed everything, setup the environment vars again.


Code:

PYTHONPATH
C:\Python26;C:\Python26\DLLs;C:\Python26\Lib;C:\Python26\Lib\lib-tk;
and now i get


Code:

Checking for installed Python... C:\Python26\lib\site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6
No installed Python found.
Only built-in modules are available. Some scripts may not run.

A:Python and Blender

Hi,

I think you did everything right. For me a practical solution was to install Python 2.5.2 besides the 2.6 installation. After you've done this, all you have to do is change the PATHs from PYTHON26 to PYTHON25 (also LIB etc.).
This worked for me in Vista 64x, but I think this is not a specific Windows 7 problem. I guess Blender2.48 just doesn't like newer versions of PYTHON. Let us see which version Blender 2.49 will use.

Greetings from Holland,
Rich.

Read other 2 answers
RELEVANCY SCORE 78.4

Hi, i just started my csc 102 course in college and it was supposed to be C++. Instead of that, we're going to be learning python which was never done before according to the professor. His explanation was that we could learn more of python in one introductory semester course than c++. I agree with his reasoning, but i'm still somewhat saddened since i always saw c++ as a kind of king in programming and was hoping for the course to give me a better push into the language that i could achieve by learning myself, since every time i start to learn alone, after a while i start playing games and don't come back to it. I was wondering if python could be used to make high quality game engines that don't lack in performance to c++ game engines from which( as far as i know) all the great engines come from such as the Unreal Tournament Engine and the Crysis Engine.
 

Read other answers
RELEVANCY SCORE 78.4

I ran a Secunia check to see if any of my applications needed updating, and it said that Python did. Since I'd never heard of it, I've been trying to research it. I know it was not deliberately installed, but don't know how it may have gotten installed (whether part of new HP system, or a particular application), and whether I should keep it. It doesn't show up in the list of Installed Programs.

Does anyone have more insight on this software?

A:How can I find out why I have Python?

Itunes, Realtek software, games?

Read other 3 answers
RELEVANCY SCORE 78.4

I am trying to use some Python functions from C, using Dev C++ compiler. However, everything I try does not work, as it gives me a compiler and linker error, every time I try to compile the C code. Any input or help would be much appreciated. Thanks -Fabez-
 

A:C \ Python Interface

Read other 7 answers
RELEVANCY SCORE 78.4

I have a file which is created using C++ code. I'm parsing that file with python and I need to know the size of a struct that is the header of the file. Is there any way I can import the C or C++ code into my python code and call the C function sizeof()? Or is there a better way to do this?

More specifically, line 336 of this file
http://lxr.mozilla.org/mozilla1.8/source/netwerk/cache/src/nsDiskCacheMap.h
is the structure that I need the size of, but I honestly can't even fathom a way to get it from python. I can just assume little_endian is true (I think most platforms that run netscape & firefox are little endian??), which is not ideal, but I still wouldn't know how big that structure is...what's the sizeof() a function anyway--the same as the data type of the function plus all the sizes of the variables in it?

If anyone could help me out with this, I would really appreciate it. Thanks!
 

A:Python getting sizeof from C

Read other 6 answers
RELEVANCY SCORE 78.4

I feel a bit trapped, because there doesn't seem to be a good version of Python for windows. I know there are some, but they aren't open source, and I kind of need that for the project I'm doing (not a project in Python, but rather a project for school.) So, are there any other simple programming languages that are free and open-source? And when I say simple, I mean kindergarten simple.
 

A:Python For Windows

Read other 7 answers
RELEVANCY SCORE 78.4

Does anybody know a good Python starting book. I know a little C, but a beginners book would be good.

Thanks
 

A:Python Book

Read other 8 answers
RELEVANCY SCORE 78.4

I need to know what some of Pythons server/net commands are, since I can't find any good lists of commands anywhere.
So if anyone knows any, or if someone would like to write me a simple server engine, I would be very happy.
 

Read other answers