Jump to content


steelchizzle

Member Since 20 Jun 2017
Offline Last Active Aug 21 2017 07:17 AM
-----

Topics I've Started

Simple Python Help - Phrasing File

21 August 2017 - 12:25 AM

Hello every one how’s tricks? I hope all is well!! I look forward to been able to post more once my limit is lifted J .

 

Ok so I need some help with a little python, my skills with python are very basic. I am doing my research besides here.

 

 My code is very basic and I intend on keeping it that way if possible. Short  N Sweet J.

 

Long story short, I want to

1. Open a file in this case a text file that was created from a xml documented (Copy And Pasted, don’t ask.) !!  (I have this much completed)

 

                     So the contents of this text file will be the xml code.

 

2. Scan the text file line by line or how ever for any content between two quotation marks and set this content to two separate variables. There are two sets of quotation marks per line.

 

                    Example <Brand Name =”Toyota” Value =”100.0” />

 

                    I would like for var1=Toyota  and  var2=100.0.

 

                    But the content of the file changes every time so it cannot be predicted easily with a pattern.

 

                    I have this completed, but everything is stored in one single variable e.g. ( var1=Toyota100.0 ),  I would like two separate variables for each value.

 

3. And simply print out the contents of the separate variables to screen and I can format them then after how I like.

 

                   I have this completed – But printing out the one single variable only and its messy.

 

 

If I can achieve this my task is pretty much finished.

 

Regardless if I receive help here or not I will still post my solution here as it might help others !. Thanks Ladies and Gentlemen !!

 

By the way I can only post so much untill my limit is lifted so please keep that in mind if I don't reply, I think I can edit at least one so its not that bad.

 

I also have a few books im reading for this if I find anything interesting I will be sure to reference it.

 

Again Thanks every one - I really do appreciate all the help here ! 

 

My Code Is Below.

 

-------------------------------------------------------------------

 

import re

 

 infile = open("inputFile.txt", "r")  # Open Input File

 

count=0

while(count<10): 

 

    lines = infile.readlines(count)

 

    newLines = str (lines)  # Needs to be a string for re.findall

 

    var1  = re.findall(r'"([^"]*)"', newLines)

 

   outfile.writelines(var1)

 

    count +=1

else:

    infile.close()

--------------------------------------------------------------------

---------------------------------------------------


New Project Idea - Need Some Guidance

26 June 2017 - 04:30 AM

Hello Again All.

 

I am starting a new project soon. It will be fully documented some where online when it is completed.I shall let all you fello nerds know !

 

Basically my idea is a game  powered by Either a  Raspberry Pi or an Arduino and the desired features are.

 

-  To input a name on a webpage and store in a database (Ideally on the Pi).

-  Gather GPIO readings and store them in the database.

-  Display the name and the GPIO data in real time on a web page with Apache or something compatible with raspberry pi

 

Scope of the game

Basically what I would like to do is take a reading ( Digital for now)  from raspberry pi or arduino and  store this in some sort of data base and in real time display it on a web page, and also be able to look up previous game scores later. I also plan to make this multi player  probably settle for two players.

 

 

So I think I will use a Raspberry Pi for this project but depending on the method ill use anything. Ive both a Pi 3 and an Arduino. I can have the raspberry pi controlling the arduino either.

 

My main idea was turn the raspberry pi into a access point with a Apache web server to display the desired data.

 

To get the data I was thinking of using python to detect the I/O pins and some how throw them into a data base and then in real time display them to a webpage.

 

I do know their is a program or a script to allow python to interact with a web page , I do forget what the name of it is  I briefly used it and I dont think it will work but I do have more testing to do.

 

I am not asking any one to do the project for me but would really appreciate if any one with some experience on making this sort of interface to give some guidance or a few headings I could look up.

 

Im pretty unsure on what to be searching for the particular term.

 

 

I am able to set up the access point on the pi with apache and have web design experience.

I can use the GPIO pins in python .

 

I just dont know how to store and update in real time.

 

Again any guidance is appreciated !! 

 

I also only have one post a day for now :(

 

Thanks So Much !! 

 

 

 

 

 


New Build Problem

21 June 2017 - 04:20 AM

Hello all I am super happy to be back on OCC its been so long I am back for good hopefully.

 

OK so I have a problem you guys might be able to help me with. I will post any up dates and solutions after I figure it out and hopefully some one as well will benefit besides me. 

 

 

 

I recently bought some parts and built a powerful enough pc ( Perfect for my needs).

 

Now the recommended PSU for this motherboard is 400W I only have 300W which might explain part of my problem.And YES I KNOW I need a new more power full one.

 

So I boot up linux mint - no problems booting perhaps a bit slow. After booted I open a browser and notice its slow for the machine driving it , so I continue to play random youtube videos

and its like the system feels slow or sloppy , in the mean time I pluged in my external drive to do a back up so I was copying around 40gb at 26/26Mbs and I noticed the system became very slow and glitchy and eventually hung.

The cooling is a little warm but the heat sink is the stock heat sink and I am not overclocking or anything mad - the setup is pure standard out of the box kinda thing. 

 

I have not tested the hard ware yet but I presume the hardware is perfect as its from a trusted source but it will be tested later tonight. 

 

My opinion is the power supply is not power full enough, my observation was when I started copying over data to my external their was a big increase lack of stability and was very slow.

Also when booting even off a standard hhd it was slow considering I was booting into Linux Mint.

 

I think it is either the PSU not throwing out enough power or their is a fault in the hardware some where.

 

As I said I will be testing everything later tonight so I will be back on here then to share .

 

Any sort of insight would be amazing guys. 

 

 

Here are some specs.

 

Motherboard : Asus p5Q Dulexe

Processor : Intel Quad Q6600

Ram : Cant remember Model but quality 8Gb I think its Transcend 

Graphics : Nvidia GT220 

PSU : A load of **** : 300 Watts 

2 x HHD Drives and a external that time I was using it.