This is my custom module: [CODE]class Player(object): def __init__(self, name, score = 0): self.name = name self.score = score def __str__(self): rep = self.name + ":\t" + str(self.score) return rep def ask_yes_no(self, question): response = None while response not in ("y", "n"): response = input(question).lower() return response def ask_number(self, question, low, high): response = None while response not in range (low, high): response = int(input(question)) return response[/CODE] The program: [CODE]import games, random print "Welcome to the world's simplest game!\n" again = None while again != "n": players = [] num = games.ask_number(question = "How many players? (2-5): ", low = …

Member Avatar
Member Avatar
+0 forum 10

Good afternoon, I have to create a program to only be used as a tool (no main function). Below is the background information related to task: Your goal for this assignment is to create a tool that manages an equivalence relation that can be changed by the program. The equivalence relation is always over a set of integers {1, 2, 3, …, n} for some n. This tool is not a complete program. It is intended to be part of a larger program. It must not have a main function. For this assignment, an equivalence relation has type ER. A …

Member Avatar
Member Avatar
+0 forum 18

Is it possible to use import for third party modules in Python? How? Thanks

Member Avatar
Member Avatar
+0 forum 6

A simple way to find out a Python module's location on your drive.

Member Avatar
Member Avatar
+3 forum 4

Hi guys, I just followed the tutorial on epesi and have finished making their tutorial on "Hello World". Now, I'm trying to create another module but it doesn't show up at the administrator availanble install. It was just a simple code following the skeleton presented at the HelloWorld tutorial just changing the classnames. This is the code: SUP_EPESI_EMP_0.php <?php defined("_VALID_ACCESS") || die('Direct access forbidden'); class Custom_EMP extends Module { public function body() { print('EMP'); } } ?> SUP_EPESI_EMPInstall.php <?php defined("_VALID_ACCESS") || die('Direct access forbidden'); class Custom_EMPInstall extends ModuleInstall { public function install() { return true; } public function uninstall() { …

Member Avatar
+0 forum 0

Hello, I have few question regarding importing modules. I have created a folder for my python work [quote]/usr/home/pratz/pyfiles[/quote] I have exported this to set the $PATH. And now if I issue the command [code]echo $PATH [/code] I am getting the string the "/usr/home/pratz/pyfiles" in the list. If I am not wrong then this means that the path is been set correctly. Also, I have set the python path in the environment variable and even that is correct. Now I have a module called "mod.py" and it has a class "cls1" and this class contains a function func() [code]mod.py -> cls1 …

Member Avatar
Member Avatar
+0 forum 2

Consider a stack module like (two files stack.h stack.cpp) which supports the these functions; void push (stack *, std::string); std::string & pop(stack &); bool isEmpty(stack &); std::string & top (stack *); I didnt understand this part what it means. Also I declared stack like; struct stack { … }; But with these functions, can i write this module without class?

Member Avatar
Member Avatar
+0 forum 9

Program runs without errors, unfortunately it will not calculate the days overdue. Any Suggestions? I have attached the code as a pdf, i have also done this as an IF, THEN, ELSE statement with the exact same results, but it will not let me upload it. Help! Private Sub calculateFees (ByVal intDays As Integer, ByRef decTotalDue As Decimal) If intDays <= 3 Then decTotalDue = dec Fee Else If intDays > 3 Then decTotalDue = CDec((intDays - 3) * 1.5 + decFee) End If

Member Avatar
Member Avatar
+0 forum 11

I am studying vb.net through the help received through this forum. While I was making a small programme Out of curiosity/error I created a module.later I thought it is not necesssary.So I wanted to remove it.I searched in the project Tab But I could not see the Delete command.So I closed the project and opened the folder where the files are stored and deleted the module,But after that the programme is not working. 1.Whether I have done it properly ? 2.If not how can we remove the module from the project? (In the project tab only ADD provision is there) …

Member Avatar
Member Avatar
+0 forum 1

How to create extension module in magento ?

Member Avatar
Member Avatar
+0 forum 1

HI: I'm new to prstashop developement Enviroinment. In Prestashop I have created on module, In that I want to create a page and need to place the link in user dashboard once the user was logged in this link will be display in user dashboard, how to do this. Thanks in Advance.

Member Avatar
+0 forum 0

Hello, I'm using import win32crypt from my python file. When I execute the python using IronPython in C# ? I got this error : No Module found Win32Crypt. var ipy = Python.CreateRuntime(); dynamic test = ipy.UseFile(@"mypythonscript.py"); mypythonscript.py import win32crypt ...

Member Avatar
Member Avatar
+0 forum 1

Evening Community! Alright. As you can see I am "newbie" on the block. When I try approaching my professor for assistance she tells me to go to my book. But I digress. If I was able to use a while loop this would be more simplified. But our professor is asking us to use a FOR loop and we have to use 2 functions. Alright, easy enough. but WAIT, theres more. So below is my code but unfortunately I am getting back the awful " TypeError: 'module' object is not iterable I am sure it is something I completely overlooking …

Member Avatar
Member Avatar
+0 forum 10

Hi htaccess is not working in godaddy hosting. but it is working in other servers. Please help me to solve this. Thank you

Member Avatar
Member Avatar
+0 forum 2

am a python beginner, receeently started learning about classesand i wrote this got this little code that keeps bringing this error . please i need someone here to help debug it: class employee(): ` empcount=0` def _init_(self,name,salary): self.name=name self.salary=salary employee.empcount=+1 def displaycount(self): print 'Total employee: %d' %employee.empcount def displayemployee(self): print 'Name:',self.name,'salary:',self.salary ######################################################### #main program emp1n=raw_input('enter name of employee1:') emp2n=raw_input('enter name of employee2:') emp1s=input('enter salary of employee1:') emp1n=input('enter salary of employee2:') emp1=employee(emp1n,emp1s) emp2=employee(emp2n,emp2s) emp1.displayemployee() emp2.displayepmloyee() print 'total employees:',employee.empcount

Member Avatar
Member Avatar
+0 forum 4

Does anyone have a clue how to fix this and make the program work smoothly? #I've been trying to make a python module called math.py def add(no1, no2): num = no1 + no2 print num def subtract(no1, no2): num = no1 - no2 print num # That all works fine but when I import it in to a new program: import math math.add(1, 1) math.subtract(2, 1) #It says AttributeError, no attribute 'add'

Member Avatar
Member Avatar
+0 forum 2

To begin with thank everybody for any help. I am trying to convert an html site into a Joomla site for a client, but I am having trouble converting the homepage slideshow into a working Joomla module. As far as I can see I have everything that I need, but the actual slides refuse to work for me. So now I'm pretty lost on why this is. I've looking at other similar joomla slideshows to see if my structure is correct, but I still can't come up with an answer to why my slideshow doesn't work. Here's the html version …

Member Avatar
Member Avatar
+0 forum 7

I have a search in my drupal website which searches for users registered in my website (finder module). Upon clicking any user from the user search result, it takes to that user's profile page. At the top of that page, a text 'Relationship' is displayed. Under it, a link saying 'become X's friend' (X is the drupal generated name of a user). Now 'X' is the default name generated by drupal when the user registers to the site. Users have their own real name. So i want to display the link as 'become XYZ's friend' (X's real name). Where should …

Member Avatar
Member Avatar
+0 forum 1

Hi. Does anyone know how to migrate a Merge Module project from .Net Framework 2.0 to 3.5? I have been able to move the WindowsFormApplications and msi project but got stuck with the msm. Thanks

Member Avatar
Member Avatar
+0 forum 8

hello everyone i created a python file DailyExpensessave.py when i need to import this in another python program i was getting this error > Traceback (most recent call last): > File "C:\Python32\DailyExpensessave", line 1, in <module> > from DailyExpenses import * > ImportError: No module named DailyExpenses Both the python files are in the same folder C:\Python32

Member Avatar
Member Avatar
+0 forum 6

#module nametest def showName(): print("__name__ is: " + str(__name__)) If I import nametest into another module or into the shell interpreter and call nametest.showName() I find that name = "nametest", in other words __name__ gets the module name it is a built-in member of? The only exception I know of is if I define showName directly in the shell without importing it in a module, then __name__ shows "__main__". Is there any other way to get the function "showName()" to print a value other than "nametest".

Member Avatar
Member Avatar
+0 forum 4

Hi i just started learning pygame and i was trying to run a simple block of code but an error keeps popping up: import pygame from pygame.locals import * screen = pygame.display.set_mode((640, 400)) when on running i get this error : module 'pygame' from 'C:/Python27/Files\pygame.pyc'> Traceback (most recent call last): File "C:/Python27/Files/tries", line 2, in <module> from pygame.locals import * ImportError: No module named locals i have the python 2.7.3 ver and pygame-1.9.1.win32-py2.7. please let me know cause being stuck at a simple code block is frustrating me

Member Avatar
Member Avatar
+0 forum 1

I'm working on softwares that were built without taking into account that they could be sold in modules. At the present time, when we (the company I'm working in) sell the software we have to install all features on the client. I know that currently there's a technique using "Prism" that solves this situation, but our softwares are already made and we can't start them all over again. Does anyone know any technique on how to handle this situation? My thanks in advanced

Member Avatar
Member Avatar
+0 forum 1

i searched a llot but in vain. can anyone help me with how to include code written using GTK+ as module in a code that uses wxpython as toolkit. any help whatsoever is appreciated.

Member Avatar
Member Avatar
+0 forum 1

Hie all, I'm developing a bulk sms website, there are users and resellers for the site. I want to map my to another ip through A record. Problem is how to identify the ip user / reseller ? Please help me.

Member Avatar
Member Avatar
+0 forum 2

Hello Friends, I am using Free edition of Vevocart. Now i want to add a new module in the default page, where i can run special offers. To be specific i want to have special offers on weeks basis. Weekly i want to upload new images through admin which will shown in the default page in the middle space below banner, these images will redirect to another page, which will have complete details about the offers. I know bit of .net development need some guidance on how to go about this thing.I hope my query is clear. Looking for a …

Member Avatar
+0 forum 0

Hello Friends....One more doubt... I have a connection module in which I have written the open and close database connection.... if database connection is an error it will return false else if success it will return true the function of the modules will be called from the form code.... what I need is if the connection is an error the module should also get the form name which returned the error...is it possible??? check my below code.... DBConnection.module Imports System.Data.SqlClient Module DBConnection Public Connection As SqlConnection = New SqlConnection() Public Function Open_DB_Connection() As String Try Connection.ConnectionString = "Data Source = …

Member Avatar
Member Avatar
+0 forum 4

I'm having some trouble defining constants correctly. I know the format should be this: Const CONSTANT_NAME [As ConstantType] = value But I'm a little unclear of how to word it. So here is the Line I need to change into a Constant. Normally I would have a BAS file do this but I can't find one (Refer to other post). Code: With oXLSheet.Range("A1:A10") .Font.ColorIndex = 50 .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter End With That's the entire section that I'm dealing with. I don't think all of it needs to be constants, but maybe it does? I'm not sure. All …

Member Avatar
Member Avatar
+0 forum 1

# Introduction to the Issue # I'm currently working on a piece of code that was put together by someone else on my team. All of his logic was in the `index.html` file, so I'm trying to factor it out into a modular library. Part of the reason is that I now need to include an AJAX and UI library and I want to avoid collisions. I'm not a JavaScript programmer by any stretch of the imagination, so I have been working to understand the process of moving the code to separate files. # The Goal # The goal of …

Member Avatar
Member Avatar
+0 forum 8

Hello there guys, im having little problem and help would be appreciated :) I have few tags <name> <capacity> <lectureslot> <tutorialslot> and so on, and i want to read each tag separatly into separate field(label), or listbox. Here is part of my XML <?xml version="1.0" encoding="utf-8"?> <timetable> <module code="3SFE504"> <name>Algorithms and Data Structures</name> <capacity cap="5">5</capacity> <semester sem="1">1</semester> <prerequisite preq="none">none</prerequisite> <lectureslot ls="0">Mon 9.00-11.00</lectureslot> <tutorialslot ts="1">Mon 11.00-13.00</tutorialslot> </module> And my source code is private void show_Click(object sender, EventArgs e) { //Clear all of the items out of the list box modulelist.Items.Clear(); //String workingDir = Directory.GetCurrentDirectory(); //XmlTextReader textReader = new XmlTextReader(workingDir + @"\xmlmodulelist.xml"); …

Member Avatar
Member Avatar
+0 forum 3

The End.