473,796 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

(VERY) New to Python. Need Help!


Greetings, oh scaly ones... :)

I'm a Mac user with a fairly high level of computer literacy, including
reasonable programming skills in BASIC, C, Pascal, and several flavors
of ML, just trying to run a "canned" Python... Uhhh... Program? Script?
Module? - Yeesh... I'm such a rookie at Python I'm not even sure of the
right terminology to use here...

At this point in the game, I'm not actually trying to *DO* anything in
Python, I just want to run a program that's written in Python.
Specifically, I'm trying to run a P2P package called "BitTorrent ".

So I've downloaded and installed a package calling itself "MacPython-OS9
2.2.3", which claims to be functional back to MacOS 8.1. (I'm running
8.6)

That was fairly painless. Now that I've got it installed, I'm slamming
face-first into a brick wall at high velocity - After diddling file
types per the docs for MacPython, I double-click the
"btdownloadhead less.py" file that the FAQ for BitTorrent says should run
for me, and I get a window opening up with this:

Python 2.2.3 (#139, Jun 1 2003, 23:11:08) [CW CARBON GUSI2 THREADS GC]
on mac
Type "copyright" , "credits" or "license" for more information.

Traceback (most recent call last):
File "Megalon City
I:Downloads:Bit Torrent-3.2.1b:btdownlo adheadless.py", line 6, in ?
from BitTorrent.down load import download
File "Megalon City
I:Downloads:Bit Torrent-3.2.1b:BitTorre nt:download.py" , line 23, in ?
from os import getpid, path, makedirs
ImportError: cannot import name getpid

and nothing further happens.

Looks pretty obvious that something it wants can't be found. At this
point in my Python "career", I don't have a freakin' clue what, where to
tell it to look for it, or even *HOW* to tell it to look for it!

Anybody wanna to throw this newbie a bone?

Yes, I realize this is quite vague. Quite frankly, I don't know enough
about the language to even properly describe the problem.

So can Somebody please lend a hand here? Before you're forced to taunt
me a second time! :)

(Hey! Quit throwing those tomatoes! The docs said Monty Python
references are not only acceptable, but *ENCOURAGED*! :) )

--
Don Bruder - da****@sonic.ne t <--- Preferred Email - unmunged, SpamAssassinate d
Hate SPAM? See <http://www.spamassassi n.org> for some seriously great info.
I will choose a path that's clear: I will choose Free Will! - N. Peart
Fly trap info pages: <http://www.sonic.net/~dakidd/Horses/FlyTrap/index.html>
Jul 18 '05 #1
1 1526

"Don Bruder" <da****@sonic.n et> wrote in message
news:be******** ***********@typ hoon.sonic.net. ..
Any indication of whether there's a "getpid" function in the Carbon
version of MacPython? And how would I go about checking to see (aside from the obvious "fire up the program - if it pukes, the function isn't there") if an arbitrarily selected function is available in a particular Python implementation?


In the installation directory is a subdirectly Lib (at least for *nix,
windows versions, don't know if mac is same). In that directory is a
file called os.py which, when imported, becomes the os module. In
that file are a number of definitions. Your BT program, by including
from os import getpid, path, makedirs


is looking for those three particular names. So you could look thru
the file to see if they are there. Running the program seems easier
;-), although looking will verify that os.py, path, and makedirs *are*
present (and getpid present or not).

If so, you could verify the that absence of getpid is exactly the
problem by deleting it from import list and adding as the next line
print 'got here'; raise SystemExit

Terry J. Reedy

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2177
by: York | last post by:
Hi, R language has very high-level IO functions, its read.table can read a total .csv file and recogonize the types of each column. write.table can do the reverse. R's MySQL interface has high-level functions, too, e.g. dbWriteTable can automatically build a MySQL table and write a table of R data into it.
17
2446
by: Steve R. Hastings | last post by:
I have been studying Python recently, and I read a comment on one web page that said something like "the people using Python for heavy math really wish they could define their own operators". The specific example was to define an "outer product" operator for matrices. (There was even a PEP, number 211, about this.) I gave it some thought, and Googled for previous discussions about this, and came up with this suggestion: User-defined...
16
2420
by: Durumdara | last post by:
Hi ! I have a problem. I have a little tool that can get data about filesystems and wrote it in python. The main user asked me a GUI for this software. This user is needed a portable program, so I create this kind of the software with Py2Exe.
17
1645
by: hanumizzle | last post by:
I have used Perl for a long time, but I am something of an experimental person and mean to try something new. Most of my 'work' with Vector Linux entails the use of Perl (a bit of a misnomer as it is not now a paid position -- I am not yet even out of K-12), and there a lot of things I love about it. I can look past a number of misfeatures in Perl, but I am surprised to see that Python has very few (that I know of). Most of them are...
29
560
by: Gerald | last post by:
Hi ,Im a BSc4 Maths/Computer Science student.Unfortunately my curriculum did not include Python programming yet I see many vacancies for Python developers.I studied programming Pascal,C++ and Delphi.So I need to catch up quickly and master Python programming.How do you suggest that I achieve this goal?Is python platform independent?What is the best way?And how long would it take before I can develop applications using python?Can you...
27
2859
by: Paulo da Silva | last post by:
Hi! I was told in this NG that string is obsolet. I should use str methods. So, how do I join a list of strings delimited by a given char, let's say ','? Old way:
4
3384
by: Alia Khouri | last post by:
Can we open up the discussion here about how to improve setuptools which has become the de facto standard for distributing / installing python software. I've been playing around with ruby's gems which seems to be more more mature and usable. From my perspective, the relative immaturity of setuptools and its simultaneous widespread use is a clear python weakness and can make python less easy to absorb than it should be. A few...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.