15,175 Topics

Member Avatar for
Member Avatar for Gribouillis

In the Perl language, you can fork a child process with the following syntax [code=perl] open CHILD, " | programA | programB | program C"; print CHILD "this is an example input"; [/code] (at least, you can do this under linux). This statement starts 3 processes in fact; programA, B …

Member Avatar for slate
0
225
Member Avatar for agibbons

I am making my own file manager for linux, hopefully it will be cross platform, and I am trying to identify different file types, in particular folders. I have already searched google but I could only find a way of identifying text files. Does anyone have any advice on identifying …

Member Avatar for slate
0
303
Member Avatar for magicMan123

Hey everyone, I am a beginner at python, and on these forums (even though I have lurked here quite a bit). Anyway, I really need some help with recursive functions. I don't exactly know how they work, and I have to be able to answer the following questions: [code] Turn …

Member Avatar for slate
0
184
Member Avatar for magicMan123

I need to do the following question: [code]Turn a line of input containing matching pairs of round (()) or curly ({}) brackets into a mountain range. The height of the mountain should indicate how deeply nested the brackets are. For example, given this input: {({(){}()}{(){}()})({(){}()}{(){}()})({(){}()}{(){}()})} Your program should output: (){}() …

Member Avatar for slate
0
315
Member Avatar for dmlandrum

I'm trying to create a table of values based upon tanh(x) (nevermind the cubic function for the moment): [code=python]#!/usr/bin/python import math def cubic(y0, y1, y2, y3, mu): a0 = y3 - y2 - y0 + y1 a1 = y0 - y1 - a0 a2 = y2 - y0 a3 = …

Member Avatar for dmlandrum
0
112
Member Avatar for JA5ONS

I have created a program that records my input through the python command line, it asks for ie, name, favourite food, (they are examples only) it than writes the inputs to a text file, and calls the text file by one of the inputs (eg, name) i now want it …

Member Avatar for slate
0
98
Member Avatar for bimaljr

Hi I just want to count files of particular type (like *.txt) in a folder. I searched net and found this for all files count : file_count = len(os.walk(valid_path).next()[2]) But I need perticuler type like *.txt . (means how many .txt files in folder) How to do this ? Thanks …

Member Avatar for bimaljr
0
8K
Member Avatar for OffbeatPatriot

I'm making my first python program that uses multiple threads. Basically you have the main program, in this program by use of various widgets you can define how many threads you want to run and the details of how these threads will run, then you can click on a menu …

Member Avatar for Gribouillis
0
94
Member Avatar for keripix

Im making this application that lists all of my ebook and the subjects i assign them to. But i have problem to display the value of the item that i select in the QListWidget to the lineeditor. Can somebody help me? And last question, how do i open the ebook …

0
50
Member Avatar for Jadellll

My code is below. Try running it if possible to see the problem. But basically, after returning the word as backwards (cc2) it then displays none on a new line. Why? and how do I prevent this in the future? [CODE]print "Welcome to the string reverser and palindrome checker. \n …

Member Avatar for Aia
0
137
Member Avatar for Scuppery

Hi everyone I am having a little problem with a program that I wrote [code=Python] def P(): a = "a" aa = "aa" b = "b" bb = "bb" text = raw_input("Enter Text: ") SpacedText = ' '.join(list(text)) OutputText = SpacedText if a in OutputText: print aa if b in …

Member Avatar for shadwickman
0
96
Member Avatar for Dekudude

Hi there! For starters, let me say I am something of a Python newbie at the moment, but I'm learning more every day! Unfortunately, my script is at a standstill, and I can't figure out how to continue. I don't have an error, per se, but rather the inability to …

Member Avatar for Dekudude
0
218
Member Avatar for Jadellll

Hi, I'm looking for where either the sort module or the sorted() function resides. I'm thinking a module in the default folders, but have no idea where it is, or how to locate it (sorted is in the path, but I don't know how to display a parent based of …

Member Avatar for Jadellll
0
105
Member Avatar for autumnwinter

hiya, I am new to python but I must using it to write for my assessment. I am required to write an IMAP program which use to test the response time and throughput from the Courier-IMAP server in time-being. It is mainly uses to measure the courier-IMAP server performance. I …

Member Avatar for shadwickman
0
82
Member Avatar for besktrap
Member Avatar for besktrap
0
194
Member Avatar for flhtc

Please excuse me if I'm posting something that's been asked 100 times. I've done some searching but can't find what I'm looking for. Also please forgive my greenness, I've only been at this for a week now. I've have extensive experience with shell scripting, some C++, although non of the …

Member Avatar for flhtc
0
112
Member Avatar for mruane

I intend on creating, or at least simulating, Artificial Intelligence in a birthday gift I am making in python. The basic package is planned to be a multi-purposed program mostly concerned with entertaining. I am attempting to create Sally, the programs 'brain' if you will. Basic Idea came from the …

Member Avatar for Alonechild101
0
144
Member Avatar for rob spade

I was trying to create a control script for an HP procurve switch. The chararcters being returned from the python telnet read_until command appear to contain a variety of unexpected characters. See example below. When accessing the same device using the default redhat telnet client the characters do not appear …

Member Avatar for Gribouillis
0
934
Member Avatar for ccclay

Looking for help : I run abc.py with normal output as I expect, but get error in abc.pyc. Below is what I have done. Would you tell me what I have mistaken ? Thank you very much !! abc.py #!/usr/bin/python import datetime test_time = open('test.time', 'w') test_time.write('oh, today is\n') test_time.close() …

Member Avatar for Gribouillis
0
175
Member Avatar for Jadellll

I'm new here, so if this isn't the right place for this, just let me know and I'll move :) So I'm just learning python, and reading the tutorial [URL="http://www.python.org/doc/tut/node7.html"]python tutorial[/URL] and I don't really get this part. The first (seq = 0,1,2...,8) is fine, but then how does map …

Member Avatar for Gribouillis
0
127
Member Avatar for ohyeah

Hi I just started out with python.. I'm trying to write some code that will request a file with HTTP GET, be able to send custom headers to the remote host, download this file and save it locally, and show some kind of percentage downloaded which updates WHILE its downloading. …

Member Avatar for EAnder
0
480
Member Avatar for Jadellll

I know there exists the sort() function. What I want to know is how it was built. Is there a function in python to call the contents of a function Or can someone show me how that one was made. I'm doing a test, and it wants me to sort …

Member Avatar for sneekula
0
104
Member Avatar for dmpop

Hello, I need to fetch and display message subjects containing a specific word. Here is what I've got so far: [CODE]import imaplib imap = IMAP4("imap.mail.com") imap.login("username", "password") r, data = imap.select('INBOX') r, data = imap.search(None, '(SUBJECT "Reminder")')[/CODE] What I need now is to print a list of subjects of the …

Member Avatar for dmpop
0
7K
Member Avatar for Seagull One

Hello again, everybody. Now that I've just about learned all I can for programming my robot with 'smarts' (I think), I think I'm ready for a bigger challenge: Having my robot program aspects of itself. Right now I'm going to try to implement it into my robot's human socialization program. …

Member Avatar for Seagull One
0
452
Member Avatar for EAnder

I am in the process of writing a brainfsck interpreter. It's just a skeleton and I still have to add Ascii, multi-character, and loops but, I was wondering was their any way I could create a compiler with python? I heard I could use lex and yacc but I am …

Member Avatar for Gribouillis
0
113
Member Avatar for iamoldest

Okay everyone first heres a source page for this module that im having trouble with... [url]http://www.pygame.org/docs/ref/font.html[/url] Anyways my problem is finding out how to use this module to be able to print a variable with font.render....... anyone know how? Heres the code... [ICODE] #! usr/bin/env python import pygame, sys, os …

Member Avatar for sneekula
0
2K
Member Avatar for lllllIllIlllI

Hi What i want to do for this is to have my program run in the background simulate pressing a button such as ENTER every 10 seconds or so. I have trauled the net and found solutions for VB and C++ but none for python. Is this possible in python …

Member Avatar for lllllIllIlllI
0
374
Member Avatar for leegeorg07

hi my brother has created a program called 'guess my number' (see it here: [url]http://www.naughtyottselprograms.tk/[/url]) and i know the coding that i need but i dont know if there is a module that includes numbers does anyone know the name for that module if it exists?

Member Avatar for friendklay
0
228
Member Avatar for friendklay

I tried the package my application which has only two files, one for the GUI (wxPython) and a Library used by the GUI. Below is my setup.py code: [code=python] from distutils.core import setup import py2exe setup(name="U51 Converter", scripts=['convertapp.pyw']) class Target: def __init__(self, **kw): self.__dict__.update(kw) # for the versioninfo resources self.version …

Member Avatar for vegaseat
0
96
Member Avatar for lllllIllIlllI

Hi I have been trying to do one of the projects in the projects for beginners section that asks you to get your computer to log off after a certain amount of time has passed without any mouse or keyboard movement. I am not yet up to that bit, in …

Member Avatar for Gribouillis
0
1K

The End.